From b764bb1c50c279b95a486d338418f7fda74fff71 Mon Sep 17 00:00:00 2001 From: Heinz Graalfs Date: Wed, 12 Jun 2013 13:54:56 +0200 Subject: KVM: s390,perf: Detect if perf samples belong to KVM host or guest This patch is based on an original patch of David Hildenbrand. The perf core implementation calls architecture specific code in order to ask for specific information for a particular sample: perf_instruction_pointer() When perf core code asks for the instruction pointer, architecture specific code must detect if a KVM guest was running when the sample was taken. A sample can be associated with a KVM guest when the PSW supervisor state bit is set and the PSW instruction pointer part contains the address of 'sie_exit'. A KVM guest's instruction pointer information is then retrieved via gpsw entry pointed to by the sie control-block. perf_misc_flags() perf code code calls this function in order to associate the kernel vs. user state infomation with a particular sample. Architecture specific code must also first detectif a KVM guest was running at the time the sample was taken. Signed-off-by: Heinz Graalfs Reviewed-by: Hendrik Brueckner Signed-off-by: Christian Borntraeger Signed-off-by: Cornelia Huck Signed-off-by: Paolo Bonzini --- arch/s390/kernel/entry64.S | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/s390/kernel/entry64.S') diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S index 51d99acc16fd..b094ced7a182 100644 --- a/arch/s390/kernel/entry64.S +++ b/arch/s390/kernel/entry64.S @@ -964,6 +964,7 @@ sie_done: # See also HANDLE_SIE_INTERCEPT rewind_pad: nop 0 + .globl sie_exit sie_exit: lg %r14,__SF_EMPTY+8(%r15) # load guest register save area stmg %r0,%r13,0(%r14) # save guest gprs 0-13 -- cgit v1.2.3