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

Re: [Xen-devel] [PATCH 08/10] x86/cpuid: Introduce and use default CPUID policies



On 26.02.2020 21:22, Andrew Cooper wrote:
> For now, the default and max policies remain identical, but this will change
> in the future.  Write calculate_{pv,hvm}_def_policy() in a way which will cope
> with simple feature differences for now.
> 
> Update XEN_SYSCTL_get_cpu_policy and init_domain_cpuid_policy() to use the
> default policies.

For the sysctl the statement looks to be broader than reality,
as (of course) you don't touch XEN_SYSCTL_cpu_policy_*_max.

> @@ -381,6 +386,23 @@ static void __init calculate_pv_max_policy(void)
>      p->extd.raw[0xa] = EMPTY_LEAF; /* No SVM for PV guests. */
>  }
>  
> +static void __init calculate_pv_def_policy(void)
> +{
> +    struct cpuid_policy *p = &pv_def_cpuid_policy;
> +    uint32_t pv_featureset[FSCAPINTS];
> +    unsigned int i;
> +
> +    *p = pv_max_cpuid_policy;
> +    cpuid_policy_to_featureset(p, pv_featureset);
> +
> +    for ( i = 0; i < ARRAY_SIZE(pv_featureset); ++i )
> +        pv_featureset[i] &= pv_def_featuremask[i];
> +
> +    sanitise_featureset(pv_featureset);
> +    cpuid_featureset_to_policy(pv_featureset, p);
> +    recalculate_xstate(p);
> +}

Is there a reason the call to guest_common_feature_adjustments()
is missing here? If so, I think you want to say a word on the why
in the description. If not, with it added
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.