]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
vvmx: Test vmxon in VMX root w/ CPL = 3 and w/ current VMCS
authorHaozhong Zhang <haozhong.zhang@intel.com>
Fri, 16 Dec 2016 13:43:48 +0000 (21:43 +0800)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 30 Jun 2017 09:21:43 +0000 (10:21 +0100)
Fault #GP(0) is expected in this test.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Rebase and cleanup.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
tests/vvmx/vmxon.c

index a72d2e8643beef5afba88a0408a12b566336113f..74b1182c09a3481eec585043c5a80fbae75621fe 100644 (file)
@@ -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();
 }
 
 /*