Skip to contentSkip to conversation

KVM: selftests: Ignore CPUID.0DH.1H in get_cpuid_test

PATCH Applied David Matlack 2 participants 3 messages May 19, 2021 – May 24, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: selftests: Ignore CPUID.0DH.1H in get_cpuid_test

Similar to CPUID.0DH.0H this entry depends on the vCPU's XCR0 register and IA32_XSS MSR. Since this test does not control for either before assigning the vCPU's CPUID, these entries will not necessarily match the supported CPUID exposed by KVM.

This fixes get_cpuid_test on Cascade Lake CPUs.

---
 tools/testing/selftests/kvm/x86_64/get_cpuid_test.c | 5 +++++
 1 file changed, 5 insertions(+)
tools/testing/selftests/kvm/x86_64/get_cpuid_test.c +5 -0
index 9b78e8889638..8c77537af5a1 100644
@@ -19,7 +19,12 @@ struct {
 	u32 function;
 	u32 index;
 } mangled_cpuids[] = {
+	/*
+	 * These entries depend on the vCPU's XCR0 register and IA32_XSS MSR,
+	 * which are not controlled for by this test.
+	 */
 	{.function = 0xd, .index = 0},
+	{.function = 0xd, .index = 1},
 };
 
 static void test_guest_cpuids(struct kvm_cpuid2 *guest_cpuid)
Signature · 1 line
2.31.1.751.gd2f1c929bd-goog
#1 lore raw
Quoted 9 lines · David Matlack

Similar to CPUID.0DH.0H this entry depends on the vCPU's XCR0 register and IA32_XSS MSR. Since this test does not control for either before assigning the vCPU's CPUID, these entries will not necessarily match the supported CPUID exposed by KVM.

This fixes get_cpuid_test on Cascade Lake CPUs.

Apologies, forgot to add:

Quoted 24 lines
---
 tools/testing/selftests/kvm/x86_64/get_cpuid_test.c | 5 +++++
 1 file changed, 5 insertions(+)
tools/testing/selftests/kvm/x86_64/get_cpuid_test.c +5 -1
index 9b78e8889638..8c77537af5a1 100644
@@ -19,7 +19,12 @@ struct {
        u32 function;
        u32 index;
 } mangled_cpuids[] = {
+       /*
+        * These entries depend on the vCPU's XCR0 register and IA32_XSS MSR,
+        * which are not controlled for by this test.
+        */
        {.function = 0xd, .index = 0},
+       {.function = 0xd, .index = 1},
 };
 
 static void test_guest_cpuids(struct kvm_cpuid2 *guest_cpuid)
--

2.31.1.751.gd2f1c929bd-goog

maintainer Applied
#2 lore raw
In reply to David Matlack
Quoted 20 lines · David Matlack

Similar to CPUID.0DH.0H this entry depends on the vCPU's XCR0 register and IA32_XSS MSR. Since this test does not control for either before assigning the vCPU's CPUID, these entries will not necessarily match the supported CPUID exposed by KVM.

This fixes get_cpuid_test on Cascade Lake CPUs.

---
  tools/testing/selftests/kvm/x86_64/get_cpuid_test.c | 5 +++++
  1 file changed, 5 insertions(+)
tools/testing/selftests/kvm/x86_64/get_cpuid_test.c +0 -0
index 9b78e8889638..8c77537af5a1 100644
@@ -19,7 +19,12 @@ struct {
  	u32 function;
  	u32 index;

tools/testing/selftests/kvm/x86_64/get_cpuid_test.c struct { · line 30

Quoted 10 lines
tools/testing/selftests/kvm/x86_64/get_cpuid_test.c +5 -0
  } mangled_cpuids[] = {
+	/*
+	 * These entries depend on the vCPU's XCR0 register and IA32_XSS MSR,
+	 * which are not controlled for by this test.
+	 */
  	{.function = 0xd, .index = 0},
+	{.function = 0xd, .index = 1},
  };
 
  static void test_guest_cpuids(struct kvm_cpuid2 *guest_cpuid)

Queued, thanks.

Paolo