All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Michael Ellerman <mpe@ellerman.id.au>, qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org, alfs@linux.vnet.ibm.com,
	jfrei@linux.vnet.ibm.com, agraf@suse.de, jan.kiszka@siemens.com,
	aik@ozlabs.ru
Subject: Re: [PATCH 2/6] kvm_stat: Fix the non-x86 exit reasons
Date: Fri, 31 Oct 2014 16:49:33 +0100	[thread overview]
Message-ID: <5453AF8D.5090601@redhat.com> (raw)
In-Reply-To: <1402991675-24905-2-git-send-email-mpe@ellerman.id.au>



On 17/06/2014 09:54, Michael Ellerman wrote:
> In kvm_stat we have a dictionary of exit reasons for s390. Firstly these
> are not s390 specific, they are the generic exit reasons. So rename the
> dictionary to reflect that.
> 
> Secondly, the values are defined using hex, but in the kernel header
> they are decimal. That means values above 9 in kvm_stat are incorrect.
> 
> As far as I can tell this does not matter in practice because s390 does
> not define a kvm_exit trace point.

Right, this should be for kvm_userspace_exit.  If we do this instead of
your patch 4, we should get kvm_userspace_exit on x86 too:

diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index fe2eae3..5cd2758 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -142,7 +142,7 @@ svm_exit_reasons = {
 }

 # From include/uapi/linux/kvm.h, KVM_EXIT_xxx
-generic_exit_reasons = {
+userspace_exit_reasons = {
      0: 'UNKNOWN',
      1: 'EXCEPTION',
      2: 'IO',
@@ -172,7 +172,6 @@ generic_exit_reasons = {
 vendor_exit_reasons = {
     'vmx': vmx_exit_reasons,
     'svm': svm_exit_reasons,
-    'IBM/S390': generic_exit_reasons,
 }

 syscall_numbers = {
@@ -190,9 +189,11 @@ for line in file('/proc/cpuinfo').readlines():
                 exit_reasons = vendor_exit_reasons[flag]
             if flag in syscall_numbers:
                 sc_perf_evt_open = syscall_numbers[flag]
-filters = {
-    'kvm_exit': ('exit_reason', exit_reasons)
-}
+
+filters = {}
+filters['kvm_userspace_exit'] = ('reason', userspace_exit_reasons)
+if exit_reasons:
+    filters['kvm_exit'] = ('exit_reason', exit_reasons)

 def invert(d):
     return dict((x[1], x[0]) for x in d.iteritems())

> 
> While we're there, fix the whitespace to match the rest of the file.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>  scripts/kvm/kvm_stat | 49 +++++++++++++++++++++++++++----------------------
>  1 file changed, 27 insertions(+), 22 deletions(-)
> 
> diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
> index 2a788bc..fe2eae3 100755
> --- a/scripts/kvm/kvm_stat
> +++ b/scripts/kvm/kvm_stat
> @@ -141,33 +141,38 @@ svm_exit_reasons = {
>      0x400: 'NPF',
>  }
>  
> -s390_exit_reasons = {
> -	0x000: 'UNKNOWN',
> -	0x001: 'EXCEPTION',
> -	0x002: 'IO',
> -	0x003: 'HYPERCALL',
> -	0x004: 'DEBUG',
> -	0x005: 'HLT',
> -	0x006: 'MMIO',
> -	0x007: 'IRQ_WINDOW_OPEN',
> -	0x008: 'SHUTDOWN',
> -	0x009: 'FAIL_ENTRY',
> -	0x010: 'INTR',
> -	0x011: 'SET_TPR',
> -	0x012: 'TPR_ACCESS',
> -	0x013: 'S390_SIEIC',
> -	0x014: 'S390_RESET',
> -	0x015: 'DCR',
> -	0x016: 'NMI',
> -	0x017: 'INTERNAL_ERROR',
> -	0x018: 'OSI',
> -	0x019: 'PAPR_HCALL',
> +# From include/uapi/linux/kvm.h, KVM_EXIT_xxx
> +generic_exit_reasons = {
> +     0: 'UNKNOWN',
> +     1: 'EXCEPTION',
> +     2: 'IO',
> +     3: 'HYPERCALL',
> +     4: 'DEBUG',
> +     5: 'HLT',
> +     6: 'MMIO',
> +     7: 'IRQ_WINDOW_OPEN',
> +     8: 'SHUTDOWN',
> +     9: 'FAIL_ENTRY',
> +    10: 'INTR',
> +    11: 'SET_TPR',
> +    12: 'TPR_ACCESS',
> +    13: 'S390_SIEIC',
> +    14: 'S390_RESET',
> +    15: 'DCR',
> +    16: 'NMI',
> +    17: 'INTERNAL_ERROR',
> +    18: 'OSI',
> +    19: 'PAPR_HCALL',
> +    20: 'S390_UCONTROL',
> +    21: 'WATCHDOG',
> +    22: 'S390_TSCH',
> +    23: 'EPR',
>  }
>  
>  vendor_exit_reasons = {
>      'vmx': vmx_exit_reasons,
>      'svm': svm_exit_reasons,
> -    'IBM/S390': s390_exit_reasons,
> +    'IBM/S390': generic_exit_reasons,
>  }
>  
>  syscall_numbers = {
> 

WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Michael Ellerman <mpe@ellerman.id.au>, qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org, aik@ozlabs.ru, jan.kiszka@siemens.com,
	agraf@suse.de, jfrei@linux.vnet.ibm.com, alfs@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 2/6] kvm_stat: Fix the non-x86 exit reasons
Date: Fri, 31 Oct 2014 16:49:33 +0100	[thread overview]
Message-ID: <5453AF8D.5090601@redhat.com> (raw)
In-Reply-To: <1402991675-24905-2-git-send-email-mpe@ellerman.id.au>



On 17/06/2014 09:54, Michael Ellerman wrote:
> In kvm_stat we have a dictionary of exit reasons for s390. Firstly these
> are not s390 specific, they are the generic exit reasons. So rename the
> dictionary to reflect that.
> 
> Secondly, the values are defined using hex, but in the kernel header
> they are decimal. That means values above 9 in kvm_stat are incorrect.
> 
> As far as I can tell this does not matter in practice because s390 does
> not define a kvm_exit trace point.

Right, this should be for kvm_userspace_exit.  If we do this instead of
your patch 4, we should get kvm_userspace_exit on x86 too:

diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
index fe2eae3..5cd2758 100755
--- a/scripts/kvm/kvm_stat
+++ b/scripts/kvm/kvm_stat
@@ -142,7 +142,7 @@ svm_exit_reasons = {
 }

 # From include/uapi/linux/kvm.h, KVM_EXIT_xxx
-generic_exit_reasons = {
+userspace_exit_reasons = {
      0: 'UNKNOWN',
      1: 'EXCEPTION',
      2: 'IO',
@@ -172,7 +172,6 @@ generic_exit_reasons = {
 vendor_exit_reasons = {
     'vmx': vmx_exit_reasons,
     'svm': svm_exit_reasons,
-    'IBM/S390': generic_exit_reasons,
 }

 syscall_numbers = {
@@ -190,9 +189,11 @@ for line in file('/proc/cpuinfo').readlines():
                 exit_reasons = vendor_exit_reasons[flag]
             if flag in syscall_numbers:
                 sc_perf_evt_open = syscall_numbers[flag]
-filters = {
-    'kvm_exit': ('exit_reason', exit_reasons)
-}
+
+filters = {}
+filters['kvm_userspace_exit'] = ('reason', userspace_exit_reasons)
+if exit_reasons:
+    filters['kvm_exit'] = ('exit_reason', exit_reasons)

 def invert(d):
     return dict((x[1], x[0]) for x in d.iteritems())

> 
> While we're there, fix the whitespace to match the rest of the file.
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>  scripts/kvm/kvm_stat | 49 +++++++++++++++++++++++++++----------------------
>  1 file changed, 27 insertions(+), 22 deletions(-)
> 
> diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat
> index 2a788bc..fe2eae3 100755
> --- a/scripts/kvm/kvm_stat
> +++ b/scripts/kvm/kvm_stat
> @@ -141,33 +141,38 @@ svm_exit_reasons = {
>      0x400: 'NPF',
>  }
>  
> -s390_exit_reasons = {
> -	0x000: 'UNKNOWN',
> -	0x001: 'EXCEPTION',
> -	0x002: 'IO',
> -	0x003: 'HYPERCALL',
> -	0x004: 'DEBUG',
> -	0x005: 'HLT',
> -	0x006: 'MMIO',
> -	0x007: 'IRQ_WINDOW_OPEN',
> -	0x008: 'SHUTDOWN',
> -	0x009: 'FAIL_ENTRY',
> -	0x010: 'INTR',
> -	0x011: 'SET_TPR',
> -	0x012: 'TPR_ACCESS',
> -	0x013: 'S390_SIEIC',
> -	0x014: 'S390_RESET',
> -	0x015: 'DCR',
> -	0x016: 'NMI',
> -	0x017: 'INTERNAL_ERROR',
> -	0x018: 'OSI',
> -	0x019: 'PAPR_HCALL',
> +# From include/uapi/linux/kvm.h, KVM_EXIT_xxx
> +generic_exit_reasons = {
> +     0: 'UNKNOWN',
> +     1: 'EXCEPTION',
> +     2: 'IO',
> +     3: 'HYPERCALL',
> +     4: 'DEBUG',
> +     5: 'HLT',
> +     6: 'MMIO',
> +     7: 'IRQ_WINDOW_OPEN',
> +     8: 'SHUTDOWN',
> +     9: 'FAIL_ENTRY',
> +    10: 'INTR',
> +    11: 'SET_TPR',
> +    12: 'TPR_ACCESS',
> +    13: 'S390_SIEIC',
> +    14: 'S390_RESET',
> +    15: 'DCR',
> +    16: 'NMI',
> +    17: 'INTERNAL_ERROR',
> +    18: 'OSI',
> +    19: 'PAPR_HCALL',
> +    20: 'S390_UCONTROL',
> +    21: 'WATCHDOG',
> +    22: 'S390_TSCH',
> +    23: 'EPR',
>  }
>  
>  vendor_exit_reasons = {
>      'vmx': vmx_exit_reasons,
>      'svm': svm_exit_reasons,
> -    'IBM/S390': s390_exit_reasons,
> +    'IBM/S390': generic_exit_reasons,
>  }
>  
>  syscall_numbers = {
> 

  reply	other threads:[~2014-10-31 15:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17  7:54 [PATCH 1/6] kvm_stat: Only consider online cpus Michael Ellerman
2014-06-17  7:54 ` [Qemu-devel] " Michael Ellerman
2014-06-17  7:54 ` [PATCH 2/6] kvm_stat: Fix the non-x86 exit reasons Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-10-31 15:49   ` Paolo Bonzini [this message]
2014-10-31 15:49     ` Paolo Bonzini
2014-06-17  7:54 ` [PATCH 3/6] kvm_stat: Rework platform detection Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-06-17  7:54 ` [PATCH 4/6] kvm_stat: Fix tracepoint filter definition for s390 Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-06-17  7:54 ` [PATCH 5/6] kvm_stat: Abstract ioctl numbers Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-06-17  7:54 ` [PATCH 6/6] kvm_stat: Add powerpc support Michael Ellerman
2014-06-17  7:54   ` [Qemu-devel] " Michael Ellerman
2014-06-17  8:27   ` Alexander Graf
2014-06-17  8:27     ` [Qemu-devel] " Alexander Graf
2014-06-18  0:50     ` Michael Ellerman
2014-06-18  0:50       ` [Qemu-devel] " Michael Ellerman
2014-06-18  0:59       ` Alexander Graf
2014-06-18  0:59         ` [Qemu-devel] " Alexander Graf
2014-06-18  1:37         ` Michael Ellerman
2014-06-18  1:37           ` [Qemu-devel] " Michael Ellerman
2014-06-18  1:54           ` Alexander Graf
2014-06-18  1:54             ` [Qemu-devel] " Alexander Graf
2014-10-31 15:36   ` Paolo Bonzini
2014-10-31 15:36     ` [Qemu-devel] " Paolo Bonzini
2014-11-03  0:40     ` Michael Ellerman
2014-11-03  0:40       ` [Qemu-devel] " Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5453AF8D.5090601@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=alfs@linux.vnet.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.