diff mbox series

[kvm-unit-tests,6/8] x86/syscall: skip TF-test if running neither on KVM nor AMD

Message ID 20210609182945.36849-7-nadav.amit@gmail.com (mailing list archive)
State New, archived
Headers show
Series x86: non-KVM improvements | expand

Commit Message

Nadav Amit June 9, 2021, 6:29 p.m. UTC
From: Nadav Amit <nadav.amit@gmail.com>

The syscall TF-test runs syscall on 32-bit mode, which is unsupported by
Intel. As a result, if the test is executed on non-KVM environment and
the system does not have AMD CPU, the test crashes. Skip the test in
such case.

Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
---
 x86/syscall.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/x86/syscall.c b/x86/syscall.c
index 8cef860..a8045cb 100644
--- a/x86/syscall.c
+++ b/x86/syscall.c
@@ -4,6 +4,7 @@ 
 #include "processor.h"
 #include "msr.h"
 #include "desc.h"
+#include "fwcfg.h"
 
 static void test_syscall_lazy_load(void)
 {
@@ -101,7 +102,11 @@  static void test_syscall_tf(void)
 int main(int ac, char **av)
 {
     test_syscall_lazy_load();
-    test_syscall_tf();
+
+    if (!no_test_device || !is_intel())
+        test_syscall_tf();
+    else
+        report_skip("syscall TF handling");
 
     return report_summary();
 }