lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200317052821.GP24267@linux.intel.com>
Date:   Mon, 16 Mar 2020 22:28:21 -0700
From:   Sean Christopherson <sean.j.christopherson@...el.com>
To:     Vitaly Kuznetsov <vkuznets@...hat.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, Xiaoyao Li <xiaoyao.li@...el.com>
Subject: Re: [PATCH 10/10] KVM: VMX: Convert vcpu_vmx.exit_reason to a union

On Fri, Mar 13, 2020 at 03:18:09PM +0100, Vitaly Kuznetsov wrote:
> Sean Christopherson <sean.j.christopherson@...el.com> writes:
> > diff --git a/arch/x86/kvm/vmx/vmx.h b/arch/x86/kvm/vmx/vmx.h
> > index e64da06c7009..2d9a005d11ab 100644
> > --- a/arch/x86/kvm/vmx/vmx.h
> > +++ b/arch/x86/kvm/vmx/vmx.h
> > @@ -93,6 +93,29 @@ struct pt_desc {
> >  	struct pt_ctx guest;
> >  };
> >  
> > +union vmx_exit_reason {
> > +	struct {
> > +		u32	basic			: 16;
> > +		u32	reserved16		: 1;
> > +		u32	reserved17		: 1;
> > +		u32	reserved18		: 1;
> > +		u32	reserved19		: 1;
> > +		u32	reserved20		: 1;
> > +		u32	reserved21		: 1;
> > +		u32	reserved22		: 1;
> > +		u32	reserved23		: 1;
> > +		u32	reserved24		: 1;
> > +		u32	reserved25		: 1;
> > +		u32	reserved26		: 1;
> > +		u32	enclave_mode		: 1;
> > +		u32	smi_pending_mtf		: 1;
> > +		u32	smi_from_vmx_root	: 1;
> > +		u32	reserved30		: 1;
> > +		u32	failed_vmentry		: 1;
> 
> Just wondering, is there any particular benefit in using 'u32' instead
> of 'u16' here?

Not that I know of.  Paranoia that the compiler will do something weird?

> > +	};
> > +	u32 full;
> > +};
> > +
> >  /*
> >   * The nested_vmx structure is part of vcpu_vmx, and holds information we need
> >   * for correct emulation of VMX (i.e., nested VMX) on this vcpu.
> > @@ -263,7 +286,7 @@ struct vcpu_vmx {
> >  	int vpid;
> >  	bool emulation_required;
> >  
> > -	u32 exit_reason;
> > +	union vmx_exit_reason exit_reason;
> >  
> >  	/* Posted interrupt descriptor */
> >  	struct pi_desc pi_desc;
> 
> Reviewed-by: Vitaly Kuznetsov <vkuznets@...hat.com>
> 
> -- 
> Vitaly
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ