]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
vvmx: Test vmxon in VMX root w/ CPL = 0 and w/o current VMCS
authorHaozhong Zhang <haozhong.zhang@intel.com>
Fri, 16 Dec 2016 13:43:45 +0000 (21:43 +0800)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 30 Jun 2017 09:21:43 +0000 (10:21 +0100)
VMfailInvalid 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 8d0b24fcfe69c82f8a1fc7c8ec7b812829dfde92..61d0cd2db24bfb9a18c6048f9fc19a62b33636bd 100644 (file)
@@ -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();
 }
 
 /*