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

Re: [Xen-devel] [V4] x86/xsaves: fix overwriting between non-lazy/lazy xsaves



On Wed, Mar 16, 2016 at 04:08:07AM -0600, Jan Beulich wrote:
> >>> On 16.03.16 at 10:35, <shuai.ruan@xxxxxxxxxxxxxxx> wrote:
> > #define XSTATE_SUPER 0
> 
> Not an ideal name I would say. XSTATE_XSAVES_ONLY maybe?
> 
Ok.
> > #define using_xsaves 0
> > 
> > if ( using_xsaves && (v->arch.xcr0_accum & XSTATE_SUPER) )
> > {
> > 
> > .....
> >     XSAVES/XRSTORS;
> > }
> 
> So what does the left side of the && then do that the right side
> doesn't already cover? When there's no XSAVES support, then
> code elsewhere should (and already does afaict) guarantee that
> the respective bits in xcr0_accum can't ever get turned on.
Yes. "v->arch.xcr0_accum & XSTATE_XSAVES_ONLY" has already cover the 
left one. For only the states set in xfeature_mask(will never turn on
XSTATE_XSAVES_ONLY nowdays) will appear in xcr0_accum. Then I will
drop all "using_xsaves" and only use v->arch.xcr0_accum & XSTATE_XSAVES_ONLY.

Really thanks for reminding me this.
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.