From: Haozhong Zhang Date: Fri, 16 Dec 2016 13:43:45 +0000 (+0800) Subject: vvmx: Test vmxon in VMX root w/ CPL = 0 and w/o current VMCS X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bf97d4fb323194bff1d92f2ed52dcaeedcf4c39e;p=people%2Fandrewcoop%2Fxen-test-framework.git vvmx: Test vmxon in VMX root w/ CPL = 0 and w/o current VMCS VMfailInvalid is expected in this test. Signed-off-by: Haozhong Zhang Rebase and cleanup. Signed-off-by: Andrew Cooper --- diff --git a/tests/vvmx/vmxon.c b/tests/vvmx/vmxon.c index 8d0b24f..61d0cd2 100644 --- a/tests/vvmx/vmxon.c +++ b/tests/vvmx/vmxon.c @@ -113,6 +113,19 @@ static void test_vmxon_correct(void) check(__func__, ex, VMERR_SUCCESS); } +/** + * vmxon in VMX root w/ CPL = 0 and w/o current VMCS + * + * Expect: VMfailInvalid + */ +static void test_vmxon_novmcs_in_root_cpl0(void) +{ + clear_vmcs(vmxon_region_unused, vmcs_revid); + exinfo_t ex = stub_vmxon(_u(vmxon_region_unused)); + + check(__func__, ex, VMERR_INVALID); +} + void test_vmxon(void) { unsigned long cr4 = read_cr4(); @@ -135,6 +148,8 @@ void test_vmxon(void) test_vmxon_correct(); /* Test should now be operating in VMX Root mode. */ + + test_vmxon_novmcs_in_root_cpl0(); } /*