Re: [PATCH v3 1/2] perf/kvm: Port perf kvm to powerpc

2015-05-20 Thread Hemant Kumar
Hi Scott, On 05/13/2015 08:52 AM, Scott Wood wrote: On Tue, 2015-05-12 at 21:34 +0530, Hemant Kumar wrote: Hi Scott, On 05/12/2015 03:38 AM, Scott Wood wrote: On Fri, 2015-05-08 at 06:37 +0530, Hemant Kumar wrote: diff --git a/arch/powerpc/include/uapi/asm/kvm_perf.h b/arch/powerpc/include/

[PATCH v4 2/2] perf/kvm: Support HCALL events

2015-05-20 Thread Hemant Kumar
powerpc provides hcall events that also provides insights into guest behaviour. Enhance perf kvm to record and analyze hcall events. - To trace hcall events : perf kvm stat record - To show the results : perf kvm stat report --event=hcall The result shows the number of hypervisor calls fro

[PATCH v4 1/2] perf/kvm: Port perf kvm to powerpc

2015-05-20 Thread Hemant Kumar
From: Srikar Dronamraju perf kvm can be used to analyze guest exit reasons. This support already exists in x86. Hence, porting it to powerpc. - To trace KVM events : perf kvm stat record If many guests are running, we can track for a specific guest by using --pid as in : perf kvm stat rec

[PATCH v4 2/3] kvm/powerpc: Add exit reason for return code 0x0

2015-05-20 Thread Hemant Kumar
This patch adds an exit reason "RETURN_TO_HOST" for the return code 0x0. Note that this is not related to any interrupt vector address, but this is added just to make sure that perf doesn't complain if and when a kvm exit happens with a trap code as 0x0. Signed-off-by: Hemant Kumar --- arch/powe

[PATCH v4 3/3] kvm/powerpc: Export HCALL reason codes

2015-05-20 Thread Hemant Kumar
For perf to analyze the KVM events like hcalls, we need the hypervisor calls and their codes to be exported through uapi. This patch moves most of the pSeries hcall codes from arch/powerpc/include/asm/hvcall.h to arch/powerpc/include/uapi/asm/pseries_hcalls.h. It also moves the mapping from arch/

[PATCH v4 1/3] kvm/powerpc: Export kvm exit reasons

2015-05-20 Thread Hemant Kumar
To analyze the kvm exits with perf, we will need to map the exit codes with the exit reasons. Such a mapping exists today in trace_book3s.h. Currently its not exported to perf. This patch moves these kvm exit reasons and their mapping from "arch/powerpc/kvm/trace_book3s.h" to "arch/powerpc/include

Re: [PATCH 1/1] KVM: PPC: Book3S: correct width in XER handling

2015-05-20 Thread Paul Mackerras
On Wed, May 20, 2015 at 05:35:08PM -0500, Scott Wood wrote: > > It's nominally a 64-bit register, but the upper 32 bits are reserved in > ISA 2.06. Do newer ISAs or certain implementations define things in the > upper 32 bits, or is this just about the asm accesses being wrong on > big-endian? I

Re: [PATCH 1/1] KVM: PPC: Book3S: correct width in XER handling

2015-05-20 Thread Scott Wood
On Wed, 2015-05-20 at 15:26 +1000, Sam Bobroff wrote: > In 64 bit kernels, the Fixed Point Exception Register (XER) is a 64 > bit field (e.g. in kvm_regs and kvm_vcpu_arch) and in most places it is > accessed as such. > > This patch corrects places where it is accessed as a 32 bit field by a > 64

Re: [PATCH 1/1] KVM: PPC: Book3S: correct width in XER handling

2015-05-20 Thread Paul Mackerras
On Wed, May 20, 2015 at 03:26:12PM +1000, Sam Bobroff wrote: > In 64 bit kernels, the Fixed Point Exception Register (XER) is a 64 > bit field (e.g. in kvm_regs and kvm_vcpu_arch) and in most places it is > accessed as such. > > This patch corrects places where it is accessed as a 32 bit field by