On 26.02.2020 21:22, Andrew Cooper wrote:
> @@ -76,16 +77,27 @@ void __init init_guest_msr_policy(void)
>  {
>      calculate_raw_policy();
>      calculate_host_policy();
> -    calculate_hvm_max_policy();
> -    calculate_pv_max_policy();
> +
> +    if ( IS_ENABLED(CONFIG_PV) )
> +        calculate_pv_max_policy();
> +
> +    if ( hvm_enabled )


Any chance of talking you into doing things more symmetrically,
by either also using IS_ENABLED(CONFIG_HVM) here or ...

> +        calculate_hvm_max_policy();
>  }
>  
>  int init_domain_msr_policy(struct domain *d)
>  {
> -    struct msr_policy *mp =
> -        xmemdup(is_pv_domain(d) ?  &pv_max_msr_policy
> -                                : &hvm_max_msr_policy);
> +    struct msr_policy *mp = is_pv_domain(d)
> +        ? (IS_ENABLED(CONFIG_PV)  ?  &pv_max_msr_policy : NULL)
> +        : (IS_ENABLED(CONFIG_HVM) ? &hvm_max_msr_policy : NULL);

... (imo preferably) hvm_enabled here? Either way
Reviewed-by: Jan Beulich <jbeul...@suse.com>

Jan

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

Reply via email to