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

Re: [Xen-devel] [V3 PATCH 7/9] x86/hvm: pkeys, add pkeys support for guest_walk_tables



>>> On 11.12.15 at 10:23, <huaitong.han@xxxxxxxxx> wrote:
> On Thu, 2015-12-10 at 18:19 +0000, George Dunlap wrote:
>> On 07/12/15 09:16, Huaitong Han wrote:
>> > +    if ( likely(!pte_pkeys) )
>> > +        return 0;
>> > +
>> > +    /* Update vcpu xsave area */
>> > +    fpu_xsave(vcpu);
>> 
>> Is there a reason you're calling fpu_xsave() directly here, rather
>> than
>> just calling vcpu_save_fpu()?  That saves you actually doing the
>> xsave
>> if the fpu hasn't been modified since the last time you read it.
> use fpu_xsave instead of fpu_xsave because Jan's comment:
> Which is bogus by itself: That function isn't meant to be used for
> purposes like the one you have, e.g. due to its side effect of
> clearing ->fpu_dirtied. You really ought to be using a lower level
> function here (and I don't think the corresponding struct vcpu
> should get altered in any way). --Jan
> 
> And I can add 
>     if ( !vcpu->fpu_dirtied )    
> before fpu_xsave(vcpu);

PKRU being non-lazy state, how would fpu_dirtied matter here?

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