On 15.12.2021 23:21, Andrew Cooper wrote:
> To implement dom0-cpuid= support, the special cases would need extending.
> However there is already a problem with late hwdom where the special cases
> override toolstack settings, which is unintended and poor behaviour.
> 
> Introduce a new init_dom0_cpuid_policy() for the purpose, moving the ITSC and
> ARCH_CAPS logic.  The is_hardware_domain() can be dropped, and for now there
> is no need to rerun recalculate_cpuid_policy(); this is a relatively expensive
> operation, and will become more-so over time.

Would you mind leaving it there in a commented out form, hinting at when
it may need re-enabling?

> Rearrange the logic in create_dom0() to make room for a call to
> init_dom0_cpuid_policy().  The AMX plans for having variable sized XSAVE
> states require that modifications to the policy happen before vCPUs are
> created.
> 
> Additionally, factor out domid into a variable so we can be slightly more
> correct in the case of a failure, and also print the error from
> domain_create().  This will at least help distinguish -EINVAL from -ENOMEM.
> 
> No practical change in behaviour.
> 
> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>

Preferably with said comment added:
Reviewed-by: Jan Beulich <jbeul...@suse.com>

Jan


Reply via email to