From: Haozhong Zhang Date: Fri, 16 Dec 2016 13:43:48 +0000 (+0800) Subject: vvmx: Test vmxon in VMX root w/ CPL = 3 and w/ current VMCS X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0d6dddbd5a5666cb7d052688724662214a771033;p=people%2Fandrewcoop%2Fxen-test-framework.git vvmx: Test vmxon in VMX root w/ CPL = 3 and w/ current VMCS Fault #GP(0) 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 a72d2e8..74b1182 100644 --- a/tests/vvmx/vmxon.c +++ b/tests/vvmx/vmxon.c @@ -155,6 +155,19 @@ static void test_vmxon_in_root_cpl0(void) check(__func__, ex, VMERR_VALID(VMERR_VMXON_IN_ROOT)); } +/** + * vmxon in VMX root w/ CPL = 3 and w/ current VMCS + * + * Expect: @#GP(0) + */ +static void test_vmxon_in_root_user(void) +{ + clear_vmcs(vmxon_region_unused, vmcs_revid); + exinfo_t ex = exec_user(vmxon_in_user); + + check(__func__, ex, EXINFO_SYM(GP, 0)); +} + void test_vmxon(void) { unsigned long cr4 = read_cr4(); @@ -189,6 +202,7 @@ void test_vmxon(void) return xtf_failure("Fail: unexpected vmptrld failure %08x\n", ex); test_vmxon_in_root_cpl0(); + test_vmxon_in_root_user(); } /*