diff mbox series

x86: vmx: skip atomic_switch_overflow_msrs_test on bare metal

Message ID 20200321050616.4272-1-namit@vmware.com (mailing list archive)
State New, archived
Headers show
Series x86: vmx: skip atomic_switch_overflow_msrs_test on bare metal | expand

Commit Message

Nadav Amit March 21, 2020, 5:06 a.m. UTC
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.

Cc: Marc Orr <marcorr@google.com>
Signed-off-by: Nadav Amit <namit@vmware.com>
---
 x86/vmx_tests.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Nadav Amit March 23, 2020, 7:42 p.m. UTC | #1
I mistakenly forgot the kvm-unit-tests in the patch subject. Sorry for that.

> On Mar 20, 2020, at 10:06 PM, Nadav Amit <namit@vmware.com> wrote:
> 
> 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.
> 
> Cc: Marc Orr <marcorr@google.com>
> Signed-off-by: Nadav Amit <namit@vmware.com>
> ---
> x86/vmx_tests.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> index 2014e54..be5c952 100644
> --- a/x86/vmx_tests.c
> +++ b/x86/vmx_tests.c
> @@ -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
Paolo Bonzini March 31, 2020, 5:01 p.m. UTC | #2
On 21/03/20 06:06, Nadav Amit wrote:
> 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.
> 
> Cc: Marc Orr <marcorr@google.com>
> Signed-off-by: Nadav Amit <namit@vmware.com>
> ---
>  x86/vmx_tests.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
> index 2014e54..be5c952 100644
> --- a/x86/vmx_tests.c
> +++ b/x86/vmx_tests.c
> @@ -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 }
> 

Queued, thanks.

Paolo
diff mbox series

Patch

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 2014e54..be5c952 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -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 }