]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
vvmx: Test the correct vmxon
authorHaozhong Zhang <haozhong.zhang@intel.com>
Fri, 16 Dec 2016 13:43:44 +0000 (21:43 +0800)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 30 Jun 2017 09:21:43 +0000 (10:21 +0100)
No error 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 8b92d5d0daa833d6f9585aac1c452cea2bf939c4..8d0b24fcfe69c82f8a1fc7c8ec7b812829dfde92 100644 (file)
@@ -3,6 +3,9 @@
 /* vmxon region which shouldn't be latched in the hardware vmxon pointer. */
 static uint8_t vmxon_region_unused[PAGE_SIZE] __page_aligned_bss;
 
+/* vmxon region which gets latched in hardware. */
+static uint8_t vmxon_region_real[PAGE_SIZE] __page_aligned_bss;
+
 /**
  * vmxon with CR4.VMXE cleared
  *
@@ -97,6 +100,19 @@ static void test_vmxon_revid_bit31(void)
     check(__func__, ex, VMERR_INVALID);
 }
 
+/**
+ * vmxon expected to succeed
+ *
+ * Expect: Success
+ */
+static void test_vmxon_correct(void)
+{
+    clear_vmcs(vmxon_region_real, vmcs_revid);
+    exinfo_t ex = stub_vmxon(_u(vmxon_region_real));
+
+    check(__func__, ex, VMERR_SUCCESS);
+}
+
 void test_vmxon(void)
 {
     unsigned long cr4 = read_cr4();
@@ -116,6 +132,9 @@ void test_vmxon(void)
     test_vmxon_unaligned_paddr();
     test_vmxon_mismatched_revid();
     test_vmxon_revid_bit31();
+    test_vmxon_correct();
+
+    /* Test should now be operating in VMX Root mode. */
 }
 
 /*