[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 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? And please use cpu_has_sep.

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