[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 15.03.16 at 10:40, <shuai.ruan@xxxxxxxxxxxxxxx> wrote:
>       xrstor() will look as follow:
>       if ( using_xsaves )
>       {
>               if ( unlikely(!(prt->xsave_hdr->xcom_bv &
>                             XSTATE_COMPACTION_ENABLED)) )
>                      ptr->xsave_hdr->xcomp_bv =
>                                   ptr->xsave_hdr->xstate_bv |
>                                   XSTATE_COMPACTION_ENABLED;
>               XRSTORS;
>       }
>       else
>               XRSTOR;

This makes me imply that "using_xsaves" is still a global variable,
set depending on CPU features. That's exactly what I've said
would presumably not be sufficient in code like xrstor(). What
point is there in using XSTORS if the guest never touched XSS?
I would much rather have expected for you to introduce a
flag paralleling v->arch.nonlazy_xstate_used indicating
whether for a particular vCPU XSAVES/XRSTORS really need to be
used (or maybe just looking at xcr0_accum would be sufficient,
and no new flag is needed; in fact I think that flag would also
better go away in favor of just inspecting xcr0_accum).

Jan


_______________________________________________
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®.