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

Re: [Xen-devel] [PATCH v3 13/28] xen/x86: Improvements to in-hypervisor cpuid sanity checks



On 21/03/16 16:11, Jan Beulich wrote:
>
>> +        /* OSXSAVE cleared by pv_featureset.  Fast-forward CR4 back in. */
>> +        if ( (is_pv_domain(currd) && guest_kernel_mode(curr, regs) &&
>> +              (this_cpu(cr4) & X86_CR4_OSXSAVE)) ||
>> +             (curr->arch.pv_vcpu.ctrlreg[4] & X86_CR4_OSXSAVE) )
>> +            c |= cpufeat_mask(X86_FEATURE_OSXSAVE);
>> +
>> +        c |= cpufeat_mask(X86_FEATURE_HYPERVISOR);
>>          break;
> Is this correct for PVH (which calls here out of vmx.c)?

Probably not. Not that PVH functioned correctly before either.

>  At least the ->arch.pv_vcpu use unlikely is.

I will guard the entire clause, leaving a note about PVH.  This will
take the behaviour back to how it was before.

>
>> +            /* OSPKE cleared by pv_featureset.  Fast-forward CR4 back in. */
>> +            if ( curr->arch.pv_vcpu.ctrlreg[4] & X86_CR4_PKE )
>> +                c |= cpufeat_mask(X86_FEATURE_OSPKE);
> That's kind of pointless for PV

Not at all.  Fixing Xen's (ab)use of the PTE bits blocking PKE is easy,
and there is already a thread on xen-devel about doing so.

> , and similarly to the above one likely
> wrong for PVH.

I will guard it similarly.

~Andrew

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