Skip to contentSkip to conversation

x86: vmx: skip atomic_switch_overflow_msrs_test on bare metal

PATCH Applied Nadav Amit 2 participants 3 messages Mar 21, 2020 – Mar 31, 2020 KVM

lore
Share & tools
lore

Nadav Amit

author
#0 lore raw

PATCH 1/1 x86: vmx: skip atomic_switch_overflow_msrs_test on bare metal

The test atomic_switch_overflow_msrs_test is only expected to pass on KVM. Skip the test when the debug device is not supported to avoid failures on bare-metal.

---
 x86/vmx_tests.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
x86/vmx_tests.c +4 -1
index 2014e54..be5c952 100644
@@ -9546,7 +9546,10 @@ static void atomic_switch_max_msrs_test(void)
 
 static void atomic_switch_overflow_msrs_test(void)
 {
-	atomic_switch_msrs_test(max_msr_list_size() + 1);
+	if (test_device_enabled())
+		atomic_switch_msrs_test(max_msr_list_size() + 1);
+	else
+		test_skip("Test is only supported on KVM");
 }
 
 #define TEST(name) { #name, .v2 = name }
Signature · 1 line
2.17.1
author
#1 lore raw

I mistakenly forgot the kvm-unit-tests in the patch subject. Sorry for that.

Quoted 30 lines · Nadav Amit

The test atomic_switch_overflow_msrs_test is only expected to pass on KVM. Skip the test when the debug device is not supported to avoid failures on bare-metal.

---
x86/vmx_tests.c | 5 ++++-

1 file changed, 4 insertions(+), 1 deletion(-)
x86/vmx_tests.c +4 -1
index 2014e54..be5c952 100644
@@ -9546,7 +9546,10 @@ static void atomic_switch_max_msrs_test(void)
 
 static void atomic_switch_overflow_msrs_test(void)
 {
-	atomic_switch_msrs_test(max_msr_list_size() + 1);
+	if (test_device_enabled())
+		atomic_switch_msrs_test(max_msr_list_size() + 1);
+	else
+		test_skip("Test is only supported on KVM");
 }
 
 #define TEST(name) { #name, .v2 = name }

—
2.17.1

maintainer Applied
#2 lore raw
In reply to Nadav Amit
Quoted 17 lines · Nadav Amit

The test atomic_switch_overflow_msrs_test is only expected to pass on KVM. Skip the test when the debug device is not supported to avoid failures on bare-metal.

---
 x86/vmx_tests.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
x86/vmx_tests.c +0 -0
index 2014e54..be5c952 100644
@@ -9546,7 +9546,10 @@ static void atomic_switch_max_msrs_test(void)
 

x86/vmx_tests.c static void atomic_switch_max_msrs_test(void) · line 9555

Quoted 10 lines
x86/vmx_tests.c +4 -1
 static void atomic_switch_overflow_msrs_test(void)
 {
-	atomic_switch_msrs_test(max_msr_list_size() + 1);
+	if (test_device_enabled())
+		atomic_switch_msrs_test(max_msr_list_size() + 1);
+	else
+		test_skip("Test is only supported on KVM");
 }
 
 #define TEST(name) { #name, .v2 = name }

Queued, thanks.

Paolo