From: Andrew Cooper Date: Mon, 12 Feb 2018 13:38:31 +0000 (+0000) Subject: Introduce a nested-svm skeleton test X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a9519a0a16eff2de88f307d0281c0dad5f91c022;p=xtf.git Introduce a nested-svm skeleton test Signed-off-by: Andrew Cooper --- diff --git a/arch/x86/include/arch/cpuid.h b/arch/x86/include/arch/cpuid.h index a51a829..e6fe5b9 100644 --- a/arch/x86/include/arch/cpuid.h +++ b/arch/x86/include/arch/cpuid.h @@ -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) diff --git a/docs/all-tests.dox b/docs/all-tests.dox index 78588c5..6acddd0 100644 --- a/docs/all-tests.dox +++ b/docs/all-tests.dox @@ -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 index 0000000..a457d8a --- /dev/null +++ b/tests/nested-svm/Makefile @@ -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 index 0000000..ae494f8 --- /dev/null +++ b/tests/nested-svm/extra.cfg.in @@ -0,0 +1 @@ +nestedhvm = 1 diff --git a/tests/nested-svm/main.c b/tests/nested-svm/main.c new file mode 100644 index 0000000..3dc0ff1 --- /dev/null +++ b/tests/nested-svm/main.c @@ -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 + +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: + */