linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools lib traceevent: update KVM plugin
@ 2015-10-01 10:28 Paolo Bonzini
  2015-10-09 20:10 ` Paolo Bonzini
  2015-10-22  9:22 ` [tip:perf/core] " tip-bot for Paolo Bonzini
  0 siblings, 2 replies; 12+ messages in thread
From: Paolo Bonzini @ 2015-10-01 10:28 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: acme

The format of the role word has changed through the years and the
plugin was never updated; some VMX exit reasons were missing too.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tools/lib/traceevent/plugin_kvm.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index 88fe83dff7cd..18536f756577 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -124,7 +124,10 @@ static const char *disassemble(unsigned char *insn, int len, uint64_t rip,
 	_ER(WBINVD,		 54)		\
 	_ER(XSETBV,		 55)		\
 	_ER(APIC_WRITE,		 56)		\
-	_ER(INVPCID,		 58)
+	_ER(INVPCID,		 58)		\
+	_ER(PML_FULL,		 62)		\
+	_ER(XSAVES,		 63)		\
+	_ER(XRSTORS,		 64)
 
 #define SVM_EXIT_REASONS \
 	_ER(EXIT_READ_CR0,	0x000)		\
@@ -352,15 +355,18 @@ static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *
 union kvm_mmu_page_role {
 	unsigned word;
 	struct {
-		unsigned glevels:4;
 		unsigned level:4;
+		unsigned cr4_pae:1;
 		unsigned quadrant:2;
-		unsigned pad_for_nice_hex_output:6;
 		unsigned direct:1;
 		unsigned access:3;
 		unsigned invalid:1;
-		unsigned cr4_pge:1;
 		unsigned nxe:1;
+		unsigned cr0_wp:1;
+		unsigned smep_and_not_wp:1;
+		unsigned smap_and_not_wp:1;
+		unsigned pad_for_nice_hex_output:8;
+		unsigned smm:8;
 	};
 };
 
@@ -385,15 +391,18 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct pevent_record *record,
 	if (pevent_is_file_bigendian(event->pevent) ==
 	    pevent_is_host_bigendian(event->pevent)) {
 
-		trace_seq_printf(s, "%u/%u q%u%s %s%s %spge %snxe",
+		trace_seq_printf(s, "%u q%u%s %s%s %spae %snxe %swp%s%s%s",
 				 role.level,
-				 role.glevels,
 				 role.quadrant,
 				 role.direct ? " direct" : "",
 				 access_str[role.access],
 				 role.invalid ? " invalid" : "",
-				 role.cr4_pge ? "" : "!",
-				 role.nxe ? "" : "!");
+				 role.cr4_pae ? "" : "!",
+				 role.nxe ? "" : "!",
+				 role.cr0_wp ? "" : "!",
+				 role.smep_and_not_wp ? " smep" : "",
+				 role.smap_and_not_wp ? " smap" : "",
+				 role.smm ? " smm" : "");
 	} else
 		trace_seq_printf(s, "WORD: %08x", role.word);
 
-- 
2.5.0


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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-01 10:28 [PATCH] tools lib traceevent: update KVM plugin Paolo Bonzini
@ 2015-10-09 20:10 ` Paolo Bonzini
  2015-10-20 14:32   ` Arnaldo Carvalho de Melo
  2015-10-22  9:22 ` [tip:perf/core] " tip-bot for Paolo Bonzini
  1 sibling, 1 reply; 12+ messages in thread
From: Paolo Bonzini @ 2015-10-09 20:10 UTC (permalink / raw)
  To: linux-kernel, kvm; +Cc: acme



On 01/10/2015 12:28, Paolo Bonzini wrote:
> The format of the role word has changed through the years and the
> plugin was never updated; some VMX exit reasons were missing too.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  tools/lib/traceevent/plugin_kvm.c | 25 +++++++++++++++++--------
>  1 file changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
> index 88fe83dff7cd..18536f756577 100644
> --- a/tools/lib/traceevent/plugin_kvm.c
> +++ b/tools/lib/traceevent/plugin_kvm.c
> @@ -124,7 +124,10 @@ static const char *disassemble(unsigned char *insn, int len, uint64_t rip,
>  	_ER(WBINVD,		 54)		\
>  	_ER(XSETBV,		 55)		\
>  	_ER(APIC_WRITE,		 56)		\
> -	_ER(INVPCID,		 58)
> +	_ER(INVPCID,		 58)		\
> +	_ER(PML_FULL,		 62)		\
> +	_ER(XSAVES,		 63)		\
> +	_ER(XRSTORS,		 64)
>  
>  #define SVM_EXIT_REASONS \
>  	_ER(EXIT_READ_CR0,	0x000)		\
> @@ -352,15 +355,18 @@ static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *
>  union kvm_mmu_page_role {
>  	unsigned word;
>  	struct {
> -		unsigned glevels:4;
>  		unsigned level:4;
> +		unsigned cr4_pae:1;
>  		unsigned quadrant:2;
> -		unsigned pad_for_nice_hex_output:6;
>  		unsigned direct:1;
>  		unsigned access:3;
>  		unsigned invalid:1;
> -		unsigned cr4_pge:1;
>  		unsigned nxe:1;
> +		unsigned cr0_wp:1;
> +		unsigned smep_and_not_wp:1;
> +		unsigned smap_and_not_wp:1;
> +		unsigned pad_for_nice_hex_output:8;
> +		unsigned smm:8;
>  	};
>  };
>  
> @@ -385,15 +391,18 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct pevent_record *record,
>  	if (pevent_is_file_bigendian(event->pevent) ==
>  	    pevent_is_host_bigendian(event->pevent)) {
>  
> -		trace_seq_printf(s, "%u/%u q%u%s %s%s %spge %snxe",
> +		trace_seq_printf(s, "%u q%u%s %s%s %spae %snxe %swp%s%s%s",
>  				 role.level,
> -				 role.glevels,
>  				 role.quadrant,
>  				 role.direct ? " direct" : "",
>  				 access_str[role.access],
>  				 role.invalid ? " invalid" : "",
> -				 role.cr4_pge ? "" : "!",
> -				 role.nxe ? "" : "!");
> +				 role.cr4_pae ? "" : "!",
> +				 role.nxe ? "" : "!",
> +				 role.cr0_wp ? "" : "!",
> +				 role.smep_and_not_wp ? " smep" : "",
> +				 role.smap_and_not_wp ? " smap" : "",
> +				 role.smm ? " smm" : "");
>  	} else
>  		trace_seq_printf(s, "WORD: %08x", role.word);
>  
> 

Ping?  Arnaldo, ok to include this patch in my tree?

Paolo

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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-09 20:10 ` Paolo Bonzini
@ 2015-10-20 14:32   ` Arnaldo Carvalho de Melo
  2015-10-20 14:44     ` Steven Rostedt
  0 siblings, 1 reply; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-10-20 14:32 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: linux-kernel, kvm, Steven Rostedt, acme

Em Fri, Oct 09, 2015 at 10:10:13PM +0200, Paolo Bonzini escreveu:
> On 01/10/2015 12:28, Paolo Bonzini wrote:
> > The format of the role word has changed through the years and the
> > plugin was never updated; some VMX exit reasons were missing too.
> > 
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> >  tools/lib/traceevent/plugin_kvm.c | 25 +++++++++++++++++--------
> >  1 file changed, 17 insertions(+), 8 deletions(-)
> > 
> > diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
> > index 88fe83dff7cd..18536f756577 100644
> > --- a/tools/lib/traceevent/plugin_kvm.c
> > +++ b/tools/lib/traceevent/plugin_kvm.c
> > @@ -124,7 +124,10 @@ static const char *disassemble(unsigned char *insn, int len, uint64_t rip,
> >  	_ER(WBINVD,		 54)		\
> >  	_ER(XSETBV,		 55)		\
> >  	_ER(APIC_WRITE,		 56)		\
> > -	_ER(INVPCID,		 58)
> > +	_ER(INVPCID,		 58)		\
> > +	_ER(PML_FULL,		 62)		\
> > +	_ER(XSAVES,		 63)		\
> > +	_ER(XRSTORS,		 64)
> >  
> >  #define SVM_EXIT_REASONS \
> >  	_ER(EXIT_READ_CR0,	0x000)		\
> > @@ -352,15 +355,18 @@ static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *
> >  union kvm_mmu_page_role {
> >  	unsigned word;
> >  	struct {
> > -		unsigned glevels:4;
> >  		unsigned level:4;
> > +		unsigned cr4_pae:1;
> >  		unsigned quadrant:2;
> > -		unsigned pad_for_nice_hex_output:6;
> >  		unsigned direct:1;
> >  		unsigned access:3;
> >  		unsigned invalid:1;
> > -		unsigned cr4_pge:1;
> >  		unsigned nxe:1;
> > +		unsigned cr0_wp:1;
> > +		unsigned smep_and_not_wp:1;
> > +		unsigned smap_and_not_wp:1;
> > +		unsigned pad_for_nice_hex_output:8;
> > +		unsigned smm:8;
> >  	};
> >  };
> >  
> > @@ -385,15 +391,18 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct pevent_record *record,
> >  	if (pevent_is_file_bigendian(event->pevent) ==
> >  	    pevent_is_host_bigendian(event->pevent)) {
> >  
> > -		trace_seq_printf(s, "%u/%u q%u%s %s%s %spge %snxe",
> > +		trace_seq_printf(s, "%u q%u%s %s%s %spae %snxe %swp%s%s%s",
> >  				 role.level,
> > -				 role.glevels,
> >  				 role.quadrant,
> >  				 role.direct ? " direct" : "",
> >  				 access_str[role.access],
> >  				 role.invalid ? " invalid" : "",
> > -				 role.cr4_pge ? "" : "!",
> > -				 role.nxe ? "" : "!");
> > +				 role.cr4_pae ? "" : "!",
> > +				 role.nxe ? "" : "!",
> > +				 role.cr0_wp ? "" : "!",
> > +				 role.smep_and_not_wp ? " smep" : "",
> > +				 role.smap_and_not_wp ? " smap" : "",
> > +				 role.smm ? " smm" : "");
> >  	} else
> >  		trace_seq_printf(s, "WORD: %08x", role.word);
> >  
> > 
> 
> Ping?  Arnaldo, ok to include this patch in my tree?

Applying, I saw it before, but lost track, perhaps was waiting for
Steven Rostedt to chime in, but now I noticed he wasn't CCed, he is now.

- Arnaldo

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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-20 14:32   ` Arnaldo Carvalho de Melo
@ 2015-10-20 14:44     ` Steven Rostedt
  2015-10-20 15:19       ` Paolo Bonzini
  0 siblings, 1 reply; 12+ messages in thread
From: Steven Rostedt @ 2015-10-20 14:44 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: Paolo Bonzini, linux-kernel, kvm, acme

On Tue, 20 Oct 2015 12:32:44 -0200
Arnaldo Carvalho de Melo <acme@redhat.com> wrote:


> > Ping?  Arnaldo, ok to include this patch in my tree?
> 
> Applying, I saw it before, but lost track, perhaps was waiting for
> Steven Rostedt to chime in, but now I noticed he wasn't CCed, he is now.

What happens if you run new perf on an older kernel. Is this new plugin
going to be screwed up? Plugins should be backward compatible.

Is the plugin even still needed? I'm looking at some of the kvm events
and they seem to be mostly self sufficient. What ones need a plugin
today?

-- Steve

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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-20 14:44     ` Steven Rostedt
@ 2015-10-20 15:19       ` Paolo Bonzini
  2015-10-20 15:26         ` Steven Rostedt
  0 siblings, 1 reply; 12+ messages in thread
From: Paolo Bonzini @ 2015-10-20 15:19 UTC (permalink / raw)
  To: Steven Rostedt, Arnaldo Carvalho de Melo; +Cc: linux-kernel, kvm, acme



On 20/10/2015 16:44, Steven Rostedt wrote:
> What happens if you run new perf on an older kernel. Is this new plugin
> going to be screwed up? Plugins should be backward compatible.

If you run new perf on older kernel, the new plugin will print the 
"role" field (see kvm_mmu_print_role) slightly incorrectly.  That said, 
the existing plugin was _also_ printing the role in a wildly wrong 
format, like 2.6.35 vintage; the glevels field was removed by commit 
5b7e0102ae74, "KVM: MMU: Replace role.glevels with role.cr4_pae", in 
April 2010.

Going forward it's really unlikely that the role will change apart from 
adding new bits.  These can be added to the plugin while keeping it 
backwards-compatible.  Addition to the role happen when you implement 
new virtual MMU features such as SMEP, SMAP or SMM.  That's once per year
or less.

> Is the plugin even still needed? I'm looking at some of the kvm events
> and they seem to be mostly self sufficient. What ones need a plugin
> today?

Yes, most of them are.  It's only needed for kvm_mmu_get_page, 
kvm_mmu_prepare_zap_page and kvm_emulate_insn.  The latter is only 
interesting if you install the disassembler library, and I wouldn't 
really care if it went away.

kvm_mmu_get_page and kvm_mmu_prepare_zap_page, however, have output like

    kvm_mmu_get_page: [FAILED TO PARSE] mmu_valid_gen=0x2 gfn=786432 role=1923 root_count=0 unsync=0 created=1

without the plugin vs.

    kvm_mmu_get_page: new sp gfn c0000 3 q0 direct rwx !pae !nxe !wp root 0 sync

with the plugin.

Paolo

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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-20 15:19       ` Paolo Bonzini
@ 2015-10-20 15:26         ` Steven Rostedt
  2015-10-20 15:37           ` Paolo Bonzini
  0 siblings, 1 reply; 12+ messages in thread
From: Steven Rostedt @ 2015-10-20 15:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Arnaldo Carvalho de Melo, linux-kernel, kvm, acme

On Tue, 20 Oct 2015 17:19:12 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:

> 
> 
> On 20/10/2015 16:44, Steven Rostedt wrote:
> > What happens if you run new perf on an older kernel. Is this new plugin
> > going to be screwed up? Plugins should be backward compatible.
> 
> If you run new perf on older kernel, the new plugin will print the 
> "role" field (see kvm_mmu_print_role) slightly incorrectly.  That said, 
> the existing plugin was _also_ printing the role in a wildly wrong 
> format, like 2.6.35 vintage; the glevels field was removed by commit 
> 5b7e0102ae74, "KVM: MMU: Replace role.glevels with role.cr4_pae", in 
> April 2010.

Can we add a check if glevels field exists, and do the old format if it
does? I'm very strict on making sure event-parse works with all
incarnations of kernels.

> 
> Going forward it's really unlikely that the role will change apart from 
> adding new bits.  These can be added to the plugin while keeping it 
> backwards-compatible.  Addition to the role happen when you implement 
> new virtual MMU features such as SMEP, SMAP or SMM.  That's once per year
> or less.
> 
> > Is the plugin even still needed? I'm looking at some of the kvm events
> > and they seem to be mostly self sufficient. What ones need a plugin
> > today?
> 
> Yes, most of them are.  It's only needed for kvm_mmu_get_page, 
> kvm_mmu_prepare_zap_page and kvm_emulate_insn.  The latter is only 
> interesting if you install the disassembler library, and I wouldn't 
> really care if it went away.
> 
> kvm_mmu_get_page and kvm_mmu_prepare_zap_page, however, have output like
> 
>     kvm_mmu_get_page: [FAILED TO PARSE] mmu_valid_gen=0x2 gfn=786432 role=1923 root_count=0 unsync=0 created=1
> 
> without the plugin vs.
> 
>     kvm_mmu_get_page: new sp gfn c0000 3 q0 direct rwx !pae !nxe !wp root 0 sync
> 
> with the plugin.

Thanks for the update.

-- Steve

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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-20 15:26         ` Steven Rostedt
@ 2015-10-20 15:37           ` Paolo Bonzini
  2015-10-20 15:48             ` Steven Rostedt
  0 siblings, 1 reply; 12+ messages in thread
From: Paolo Bonzini @ 2015-10-20 15:37 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Arnaldo Carvalho de Melo, linux-kernel, kvm, acme



On 20/10/2015 17:26, Steven Rostedt wrote:
> > > > What happens if you run new perf on an older kernel. Is this new plugin
> > > > going to be screwed up? Plugins should be backward compatible.
> > 
> > If you run new perf on older kernel, the new plugin will print the 
> > "role" field (see kvm_mmu_print_role) slightly incorrectly.  That said, 
> > the existing plugin was _also_ printing the role in a wildly wrong 
> > format, like 2.6.35 vintage; the glevels field was removed by commit 
> > 5b7e0102ae74, "KVM: MMU: Replace role.glevels with role.cr4_pae", in 
> > April 2010.
> 
> Can we add a check if glevels field exists, and do the old format if it
> does? I'm very strict on making sure event-parse works with all
> incarnations of kernels.

Note that this is not a glevels _tracepoint_ field.  The tracepoint
field is "role" and it is a 64-bit integer.  The plugin interprets the
bitfields of that integer, and the position/meaning of the bitfields has
changed.

I guess I could use the mmu_valid_gen field as a proxy (it was
introduced after glevels was removed), and only provide the "very old"
(up to 2.6.34) and "new" (4.2+) formats.  The "old" format (2.6.35-4.1)
was never implemented in the plugin; it may well remain that way.

However, it frankly seems a bit academic.  The parsing _will_ work,
apart from printing a nonsensical role just like it has always done for
the past four years.

Paolo

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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-20 15:37           ` Paolo Bonzini
@ 2015-10-20 15:48             ` Steven Rostedt
  2015-10-20 15:49               ` Paolo Bonzini
  0 siblings, 1 reply; 12+ messages in thread
From: Steven Rostedt @ 2015-10-20 15:48 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Arnaldo Carvalho de Melo, linux-kernel, kvm, acme

On Tue, 20 Oct 2015 17:37:43 +0200
Paolo Bonzini <pbonzini@redhat.com> wrote:

> However, it frankly seems a bit academic.  The parsing _will_ work,
> apart from printing a nonsensical role just like it has always done for
> the past four years.

I'm not going to be too picky about it. But things like this may seem
academic, but it's also what we forget about, and people still use
2.6.32 kernels, and this may come back and bite us later.

But it's more likely to bite you than me, so if you don't think it's
worth while, then I'm not going to push it.

-- Steve


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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-20 15:48             ` Steven Rostedt
@ 2015-10-20 15:49               ` Paolo Bonzini
  2015-10-20 15:50                 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 12+ messages in thread
From: Paolo Bonzini @ 2015-10-20 15:49 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Arnaldo Carvalho de Melo, linux-kernel, kvm, acme



On 20/10/2015 17:48, Steven Rostedt wrote:
> On Tue, 20 Oct 2015 17:37:43 +0200
> Paolo Bonzini <pbonzini@redhat.com> wrote:
> 
>> However, it frankly seems a bit academic.  The parsing _will_ work,
>> apart from printing a nonsensical role just like it has always done for
>> the past four years.
> 
> I'm not going to be too picky about it. But things like this may seem
> academic, but it's also what we forget about, and people still use
> 2.6.32 kernels, and this may come back and bite us later.
> 
> But it's more likely to bite you than me, so if you don't think it's
> worth while, then I'm not going to push it.

Thanks.  The role is not going to matter except in really weird cases
and hopefully those are just not there in 2.6.32 kernels.  Thanks also
for educating me so I won't get it wrong in the future!

Paolo

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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-20 15:49               ` Paolo Bonzini
@ 2015-10-20 15:50                 ` Arnaldo Carvalho de Melo
  2015-10-20 16:21                   ` Steven Rostedt
  0 siblings, 1 reply; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-10-20 15:50 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Steven Rostedt, linux-kernel, kvm

Em Tue, Oct 20, 2015 at 05:49:22PM +0200, Paolo Bonzini escreveu:
> 
> 
> On 20/10/2015 17:48, Steven Rostedt wrote:
> > On Tue, 20 Oct 2015 17:37:43 +0200
> > Paolo Bonzini <pbonzini@redhat.com> wrote:
> > 
> >> However, it frankly seems a bit academic.  The parsing _will_ work,
> >> apart from printing a nonsensical role just like it has always done for
> >> the past four years.
> > 
> > I'm not going to be too picky about it. But things like this may seem
> > academic, but it's also what we forget about, and people still use
> > 2.6.32 kernels, and this may come back and bite us later.
> > 
> > But it's more likely to bite you than me, so if you don't think it's
> > worth while, then I'm not going to push it.
> 
> Thanks.  The role is not going to matter except in really weird cases
> and hopefully those are just not there in 2.6.32 kernels.  Thanks also
> for educating me so I won't get it wrong in the future!

Cool, Steven, can I take that as an Acked-by for this patch?

- Arnaldo

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

* Re: [PATCH] tools lib traceevent: update KVM plugin
  2015-10-20 15:50                 ` Arnaldo Carvalho de Melo
@ 2015-10-20 16:21                   ` Steven Rostedt
  0 siblings, 0 replies; 12+ messages in thread
From: Steven Rostedt @ 2015-10-20 16:21 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: Paolo Bonzini, linux-kernel, kvm

On Tue, 20 Oct 2015 12:50:26 -0300
Arnaldo Carvalho de Melo <acme@redhat.com> wrote:

> Cool, Steven, can I take that as an Acked-by for this patch?
> 

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve

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

* [tip:perf/core] tools lib traceevent: update KVM plugin
  2015-10-01 10:28 [PATCH] tools lib traceevent: update KVM plugin Paolo Bonzini
  2015-10-09 20:10 ` Paolo Bonzini
@ 2015-10-22  9:22 ` tip-bot for Paolo Bonzini
  1 sibling, 0 replies; 12+ messages in thread
From: tip-bot for Paolo Bonzini @ 2015-10-22  9:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, tglx, dsahern, rostedt, acme, linux-kernel, namhyung,
	pbonzini, hpa

Commit-ID:  2f465deef7ce8c722121b782dd91c284f5ae80ca
Gitweb:     http://git.kernel.org/tip/2f465deef7ce8c722121b782dd91c284f5ae80ca
Author:     Paolo Bonzini <pbonzini@redhat.com>
AuthorDate: Thu, 1 Oct 2015 12:28:11 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 20 Oct 2015 15:54:14 -0300

tools lib traceevent: update KVM plugin

The format of the role word has changed through the years and the plugin
was never updated; some VMX exit reasons were missing too.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: kvm@vger.kernel.org
Link: http://lkml.kernel.org/r/1443695293-31127-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/lib/traceevent/plugin_kvm.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/tools/lib/traceevent/plugin_kvm.c b/tools/lib/traceevent/plugin_kvm.c
index 88fe83d..18536f7 100644
--- a/tools/lib/traceevent/plugin_kvm.c
+++ b/tools/lib/traceevent/plugin_kvm.c
@@ -124,7 +124,10 @@ static const char *disassemble(unsigned char *insn, int len, uint64_t rip,
 	_ER(WBINVD,		 54)		\
 	_ER(XSETBV,		 55)		\
 	_ER(APIC_WRITE,		 56)		\
-	_ER(INVPCID,		 58)
+	_ER(INVPCID,		 58)		\
+	_ER(PML_FULL,		 62)		\
+	_ER(XSAVES,		 63)		\
+	_ER(XRSTORS,		 64)
 
 #define SVM_EXIT_REASONS \
 	_ER(EXIT_READ_CR0,	0x000)		\
@@ -352,15 +355,18 @@ static int kvm_nested_vmexit_handler(struct trace_seq *s, struct pevent_record *
 union kvm_mmu_page_role {
 	unsigned word;
 	struct {
-		unsigned glevels:4;
 		unsigned level:4;
+		unsigned cr4_pae:1;
 		unsigned quadrant:2;
-		unsigned pad_for_nice_hex_output:6;
 		unsigned direct:1;
 		unsigned access:3;
 		unsigned invalid:1;
-		unsigned cr4_pge:1;
 		unsigned nxe:1;
+		unsigned cr0_wp:1;
+		unsigned smep_and_not_wp:1;
+		unsigned smap_and_not_wp:1;
+		unsigned pad_for_nice_hex_output:8;
+		unsigned smm:8;
 	};
 };
 
@@ -385,15 +391,18 @@ static int kvm_mmu_print_role(struct trace_seq *s, struct pevent_record *record,
 	if (pevent_is_file_bigendian(event->pevent) ==
 	    pevent_is_host_bigendian(event->pevent)) {
 
-		trace_seq_printf(s, "%u/%u q%u%s %s%s %spge %snxe",
+		trace_seq_printf(s, "%u q%u%s %s%s %spae %snxe %swp%s%s%s",
 				 role.level,
-				 role.glevels,
 				 role.quadrant,
 				 role.direct ? " direct" : "",
 				 access_str[role.access],
 				 role.invalid ? " invalid" : "",
-				 role.cr4_pge ? "" : "!",
-				 role.nxe ? "" : "!");
+				 role.cr4_pae ? "" : "!",
+				 role.nxe ? "" : "!",
+				 role.cr0_wp ? "" : "!",
+				 role.smep_and_not_wp ? " smep" : "",
+				 role.smap_and_not_wp ? " smap" : "",
+				 role.smm ? " smm" : "");
 	} else
 		trace_seq_printf(s, "WORD: %08x", role.word);
 

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

end of thread, other threads:[~2015-10-22  9:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-01 10:28 [PATCH] tools lib traceevent: update KVM plugin Paolo Bonzini
2015-10-09 20:10 ` Paolo Bonzini
2015-10-20 14:32   ` Arnaldo Carvalho de Melo
2015-10-20 14:44     ` Steven Rostedt
2015-10-20 15:19       ` Paolo Bonzini
2015-10-20 15:26         ` Steven Rostedt
2015-10-20 15:37           ` Paolo Bonzini
2015-10-20 15:48             ` Steven Rostedt
2015-10-20 15:49               ` Paolo Bonzini
2015-10-20 15:50                 ` Arnaldo Carvalho de Melo
2015-10-20 16:21                   ` Steven Rostedt
2015-10-22  9:22 ` [tip:perf/core] " tip-bot for 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).