]> xenbits.xensource.com Git - xen.git/commitdiff
x86/CPUID: correct error indicator for max extended leaf
authorJan Beulich <jbeulich@suse.com>
Thu, 30 Apr 2020 08:45:09 +0000 (10:45 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 30 Apr 2020 08:45:09 +0000 (10:45 +0200)
With the max base leaf using 0, this one should be using the extended
leaf counterpart thereof, rather than some arbitrary extended leaf.

Fixes: 588a966a572e ("libx86: Introduce x86_cpu_policies_are_compatible()")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/tests/cpu-policy/test-cpu-policy.c
xen/lib/x86/policy.c

index 20ebed923b10ec83b9bb0dc90bd2c9c07b2e00eb..fe8cdf6ea93dae543cb92bfdc09e13e4ded17752 100644 (file)
@@ -570,7 +570,7 @@ static void test_is_compatible_failure(void)
         {
             .name = "Host extd.max_leaf out of range",
             .guest_cpuid.extd.max_leaf = 1,
-            .e = { 0x80000008, -1, -1 },
+            .e = { 0x80000000, -1, -1 },
         },
         {
             .name = "Host no CPUID faulting, Guest wanted",
index b156a304f45da6054f1dad08482a19d27867fc43..4beca8767a937709048d01324aaad76e2514002f 100644 (file)
@@ -19,7 +19,7 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
         FAIL_CPUID(0, NA);
 
     if ( guest->cpuid->extd.max_leaf > host->cpuid->extd.max_leaf )
-        FAIL_CPUID(0x80000008, NA);
+        FAIL_CPUID(0x80000000, NA);
 
     /* TODO: Audit more CPUID data. */