|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC 10/31] xen/x86: Calculate HVM featureset
On 22/12/15 17:11, Jan Beulich wrote:
>>>> On 16.12.15 at 22:24, <andrew.cooper3@xxxxxxxxxx> wrote:
>> @@ -22,6 +24,27 @@ void __init calculate_featuresets(void)
>>
>> /* Unconditionally claim to be able to set the hypervisor bit. */
>> __set_bit(X86_FEATURE_HYPERVISOR, pv_featureset);
>> +
>> + /* HVM featureset. */
>> + if ( hvm_enabled )
>> + {
>> + const uint32_t *hvm_featuremask = hvm_funcs.hap_supported
>> + ? hvm_hap_featuremask : hvm_shadow_featuremask;
>> +
>> + for ( i = 0; i < ARRAY_SIZE(hvm_featureset); ++i )
>> + hvm_featureset[i] = host_featureset[i] & hvm_featuremask[i];
>> +
>> + /* Unconditionally claim to be able to set the hypervisor bit. */
>> + __set_bit(X86_FEATURE_HYPERVISOR, hvm_featureset);
>> +
>> + /*
>> + * On AMD, PV guests are entirely unable to use 'sysenter' as Xen
>> runs
>> + * in long mode, but HVM guests are able if running in protected
>> mode.
>> + */
>> + if ( (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) &&
>> + !test_bit(X86_FEATURE_SEP, boot_cpu_data.x86_capability) )
> Is the ! correct here?
Yes - init_amd() deliberately clobbers the feature.
> And please use cpu_has_sep.
Actually, thinking about it, the check isn't quite correct. We need to
only advertise the feature if it was available before init_amd()
clobbered it.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |