qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] kvm_stat: Define RESET ioctl number for PPC
@ 2015-01-30 18:17 Wei Huang
  2015-01-30 18:17 ` [Qemu-devel] [PATCH 2/2] kvm_stat: Add kvm_exit reasons for aarch64 Wei Huang
  2015-02-03 12:58 ` [Qemu-devel] [PATCH 1/2] kvm_stat: Define RESET ioctl number for PPC Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Huang @ 2015-01-30 18:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: marc.zyngier, pbonzini, christoffer.dall, mpe

This patch defines the RESET ioctl number for PPC architecture. Without it,
the reset() function of Event class can potentionally cause exception on
PPC.

Signed-off-by: Wei Huang <wei@redhat.com>
---
 scripts/kvm/kvm_stat | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index c0c4ff0..7af5947 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -207,6 +207,7 @@ def ppc_init():
             'SET_FILTER' : 0x80002406 | (ctypes.sizeof(ctypes.c_char_p) << 16),
             'ENABLE'     : 0x20002400,
             'DISABLE'    : 0x20002401,
+            'RESET'      : 0x20002403,
         }
     })
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PATCH 2/2] kvm_stat: Add kvm_exit reasons for aarch64
  2015-01-30 18:17 [Qemu-devel] [PATCH 1/2] kvm_stat: Define RESET ioctl number for PPC Wei Huang
@ 2015-01-30 18:17 ` Wei Huang
  2015-02-03 12:58 ` [Qemu-devel] [PATCH 1/2] kvm_stat: Define RESET ioctl number for PPC Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Wei Huang @ 2015-01-30 18:17 UTC (permalink / raw)
  To: qemu-devel; +Cc: marc.zyngier, pbonzini, christoffer.dall, mpe

This patch defines the list of kvm_exit reasons for aarch64. This list is
based on the Exception Class (EC) field of HSR register. With this patch
users can trace the execution of guest VMs better. A sample output from
command "kvm_stat -1 -t" is shown as the following:
<...>
kvm_exit(WATCHPT_HYP)          0         0
kvm_exit(WFI)               9422      9361

NOTE: This patch requires TRACE_EVENT(kvm_exit) to include exit_reason
field in TP_ARGS. A patch to upstream kernel has been submitted.

Signed-off-by: Wei Huang <wei@redhat.com>
---
 scripts/kvm/kvm_stat | 42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index 7af5947..2a9ca98 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -145,6 +145,45 @@ svm_exit_reasons = {
     0x400: 'NPF',
 }
 
+# EC definition of HSR (from arch/arm64/include/asm/kvm_arm.h)
+aarch64_exit_reasons = {
+    0x00: 'UNKNOWN',
+    0x01: 'WFI',
+    0x03: 'CP15_32',
+    0x04: 'CP15_64',
+    0x05: 'CP14_MR',
+    0x06: 'CP14_LS',
+    0x07: 'FP_ASIMD',
+    0x08: 'CP10_ID',
+    0x0C: 'CP14_64',
+    0x0E: 'ILL_ISS',
+    0x11: 'SVC32',
+    0x12: 'HVC32',
+    0x13: 'SMC32',
+    0x15: 'SVC64',
+    0x16: 'HVC64',
+    0x17: 'SMC64',
+    0x18: 'SYS64',
+    0x20: 'IABT',
+    0x21: 'IABT_HYP',
+    0x22: 'PC_ALIGN',
+    0x24: 'DABT',
+    0x25: 'DABT_HYP',
+    0x26: 'SP_ALIGN',
+    0x28: 'FP_EXC32',
+    0x2C: 'FP_EXC64',
+    0x2F: 'SERROR',
+    0x30: 'BREAKPT',
+    0x31: 'BREAKPT_HYP',
+    0x32: 'SOFTSTP',
+    0x33: 'SOFTSTP_HYP',
+    0x34: 'WATCHPT',
+    0x35: 'WATCHPT_HYP',
+    0x38: 'BKPT32',
+    0x3A: 'VECTOR32',
+    0x3C: 'BRK64',
+}
+
 # From include/uapi/linux/kvm.h, KVM_EXIT_xxx
 userspace_exit_reasons = {
      0: 'UNKNOWN',
@@ -213,7 +252,8 @@ def ppc_init():
 
 def aarch64_init():
     globals().update({
-        'sc_perf_evt_open' : 241
+        'sc_perf_evt_open' : 241,
+        'exit_reasons' : aarch64_exit_reasons,
     })
 
 def detect_platform():
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] kvm_stat: Define RESET ioctl number for PPC
  2015-01-30 18:17 [Qemu-devel] [PATCH 1/2] kvm_stat: Define RESET ioctl number for PPC Wei Huang
  2015-01-30 18:17 ` [Qemu-devel] [PATCH 2/2] kvm_stat: Add kvm_exit reasons for aarch64 Wei Huang
@ 2015-02-03 12:58 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2015-02-03 12:58 UTC (permalink / raw)
  To: Wei Huang, qemu-devel; +Cc: marc.zyngier, mpe, christoffer.dall



On 30/01/2015 19:17, Wei Huang wrote:
> This patch defines the RESET ioctl number for PPC architecture. Without it,
> the reset() function of Event class can potentionally cause exception on
> PPC.
> 
> Signed-off-by: Wei Huang <wei@redhat.com>
> ---
>  scripts/kvm/kvm_stat | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
> index c0c4ff0..7af5947 100755
> --- a/scripts/kvm/kvm_stat
> +++ b/scripts/kvm/kvm_stat
> @@ -207,6 +207,7 @@ def ppc_init():
>              'SET_FILTER' : 0x80002406 | (ctypes.sizeof(ctypes.c_char_p) << 16),
>              'ENABLE'     : 0x20002400,
>              'DISABLE'    : 0x20002401,
> +            'RESET'      : 0x20002403,
>          }
>      })
>  
> 

Applying both to uq/master.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-03 12:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-30 18:17 [Qemu-devel] [PATCH 1/2] kvm_stat: Define RESET ioctl number for PPC Wei Huang
2015-01-30 18:17 ` [Qemu-devel] [PATCH 2/2] kvm_stat: Add kvm_exit reasons for aarch64 Wei Huang
2015-02-03 12:58 ` [Qemu-devel] [PATCH 1/2] kvm_stat: Define RESET ioctl number for PPC Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).