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

Re: [PATCH] x86/xstate: reset cached register values on resume



On Wed, Aug 18, 2021 at 02:05:05PM +0200, Jan Beulich wrote:
> On 18.08.2021 13:30, Marek Marczykowski-Górecki wrote:
> > --- a/xen/arch/x86/xstate.c
> > +++ b/xen/arch/x86/xstate.c
> > @@ -642,6 +642,13 @@ void xstate_init(struct cpuinfo_x86 *c)
> >          return;
> >      }
> >  
> > +    /*
> > +     * Clear the cached value to make set_xcr0() and set_msr_xss() really
> > +     * write it.
> > +     */
> > +    this_cpu(xcr0) = 0;
> 
> While XCR0 cannot be successfully written with 0, ...
> 
> > +    this_cpu(xss) = 0;
> 
> ... XSS can. XSS can't be written with various other values; I'd
> suggest using ~0 here. Then
> 
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> and I'd be happy to make the adjustment while committing, so long
> as you agree.

Yes, makes sense. Thanks!

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

Attachment: signature.asc
Description: PGP signature


 


Rackspace

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