]> xenbits.xensource.com Git - xtf.git/commitdiff
Introduce a nested-svm skeleton test
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 12 Feb 2018 13:38:31 +0000 (13:38 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 12 Feb 2018 14:32:53 +0000 (14:32 +0000)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
arch/x86/include/arch/cpuid.h
docs/all-tests.dox
tests/nested-svm/Makefile [new file with mode: 0644]
tests/nested-svm/extra.cfg.in [new file with mode: 0644]
tests/nested-svm/main.c [new file with mode: 0644]

index a51a8291e7a7649fde5283cce4cf337233e3f1ed..e6fe5b9ffae5a966b5a4ef37d760eb24825f06ba 100644 (file)
@@ -85,6 +85,8 @@ static inline bool cpu_has(unsigned int feature)
 #define cpu_has_page1gb         cpu_has(X86_FEATURE_PAGE1GB)
 #define cpu_has_lm              cpu_has(X86_FEATURE_LM)
 
+#define cpu_has_svm             cpu_has(X86_FEATURE_SVM)
+
 #define cpu_has_fsgsbase        cpu_has(X86_FEATURE_FSGSBASE)
 #define cpu_has_smep            cpu_has(X86_FEATURE_SMEP)
 #define cpu_has_smap            cpu_has(X86_FEATURE_SMAP)
index 78588c5a6404347249647a7c33cb9b905cfe4671..6acddd0531f1d52c7e41b5da6cc1ec598a673e86 100644 (file)
@@ -122,5 +122,7 @@ guest breakout.
 
 @section index-in-development In Development
 
+@subpage test-nested-svm - Nested SVM tests.
+
 @subpage test-nested-vmx - Nested VT-x tests.
 */
diff --git a/tests/nested-svm/Makefile b/tests/nested-svm/Makefile
new file mode 100644 (file)
index 0000000..a457d8a
--- /dev/null
@@ -0,0 +1,11 @@
+include $(ROOT)/build/common.mk
+
+NAME      := nested-svm
+CATEGORY  := in-development
+TEST-ENVS := $(HVM_ENVIRONMENTS)
+
+TEST-EXTRA-CFG := extra.cfg.in
+
+obj-perenv += main.o
+
+include $(ROOT)/build/gen.mk
diff --git a/tests/nested-svm/extra.cfg.in b/tests/nested-svm/extra.cfg.in
new file mode 100644 (file)
index 0000000..ae494f8
--- /dev/null
@@ -0,0 +1 @@
+nestedhvm = 1
diff --git a/tests/nested-svm/main.c b/tests/nested-svm/main.c
new file mode 100644 (file)
index 0000000..3dc0ff1
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * @file tests/nested-svm/main.c
+ * @ref test-nested-svm
+ *
+ * @page test-nested-svm Nested SVM
+ *
+ * Functional testing of the SVM features in a nested-virt environment.
+ *
+ * @see tests/nested-svm/main.c
+ */
+#include <xtf.h>
+
+const char test_title[] = "Nested SVM testing";
+
+void test_main(void)
+{
+    if ( !cpu_has_svm )
+        return xtf_skip("Skip: SVM not available\n");
+
+    if ( !vendor_is_amd )
+        xtf_warning("Warning: SVM found on non-AMD processor\n");
+
+    xtf_success(NULL);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */