Re: [PATCH v3 4/4] KVM: VMX: Change ple_window type to unsigned int

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 05, 2019 at 08:58:23AM -0700, Sean Christopherson wrote:
> On Thu, Sep 05, 2019 at 10:36:16AM +0800, Peter Xu wrote:
> > The VMX ple_window is 32 bits wide, so logically it can overflow with
> > an int.  The module parameter is declared as unsigned int which is
> > good, however the dynamic variable is not.  Switching all the
> > ple_window references to use unsigned int.
> > 
> > The tracepoint changes will also affect SVM, but SVM is using an even
> > smaller width (16 bits) so it's always fine.
> > 
> > Suggested-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx>
> > Signed-off-by: Peter Xu <peterx@xxxxxxxxxx>
> > ---
> >  arch/x86/kvm/trace.h   | 8 ++++----
> >  arch/x86/kvm/vmx/vmx.c | 4 ++--
> >  arch/x86/kvm/vmx/vmx.h | 2 +-
> >  3 files changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
> > index f1177e03768f..ae924566c401 100644
> > --- a/arch/x86/kvm/trace.h
> > +++ b/arch/x86/kvm/trace.h
> > @@ -891,13 +891,13 @@ TRACE_EVENT(kvm_pml_full,
> >  );
> >  
> >  TRACE_EVENT(kvm_ple_window_update,
> > -	TP_PROTO(unsigned int vcpu_id, int new, int old),
> > +	TP_PROTO(unsigned int vcpu_id, unsigned int new, unsigned int old),
> >  	TP_ARGS(vcpu_id, new, old),
> >  
> >  	TP_STRUCT__entry(
> >  		__field(        unsigned int,   vcpu_id         )
> > -		__field(                 int,       new         )
> > -		__field(                 int,       old         )
> > +		__field(        unsigned int,       new         )
> > +		__field(        unsigned int,       old         )
> 
> Changing the trace event storage needs to be done in patch 3/4, otherwise
> we're knowingly introducing a bug (for one commit).  Alternatively, swap
> the order of the patches.

I'll swap.  Thanks,

-- 
Peter Xu



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux