Skip to contentSkip to conversation

x86/CPUID: also check leaf 7 max subleaf to be compatible

PATCH In review Jan Beulich 2 participants 2 messages Nov 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/CPUID: also check leaf 7 max subleaf to be compatible

Just like is done for basic and extended major leaves.

xen/lib/x86/policy.c +3 -0
@@ -18,6 +18,9 @@ int x86_cpu_policies_are_compatible(cons
     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);