From: Jan Beulich Date: Tue, 10 Nov 2020 13:40:09 +0000 (+0100) Subject: x86/CPUID: also check leaf 7 max subleaf to be compatible X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~1417 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e6e85b662be9eab96f4cfc58e9945580cce8b2bb;p=xen.git x86/CPUID: also check leaf 7 max subleaf to be compatible Just like is done for basic and extended major leaves. Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c index 4beca8767a..f6cea4e2f9 100644 --- a/xen/lib/x86/policy.c +++ b/xen/lib/x86/policy.c @@ -18,6 +18,9 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host, if ( guest->cpuid->basic.max_leaf > host->cpuid->basic.max_leaf ) FAIL_CPUID(0, NA); + if ( guest->cpuid->feat.max_subleaf > host->cpuid->feat.max_subleaf ) + FAIL_CPUID(7, 0); + if ( guest->cpuid->extd.max_leaf > host->cpuid->extd.max_leaf ) FAIL_CPUID(0x80000000, NA);