[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [XTF PATCH 10/16] vvmx: test vmxon with mismatched VMCS revision ID



VMfailInvalid is expected in this test.

Signed-off-by: Haozhong Zhang <haozhong.zhang@xxxxxxxxx>
---
 tests/vvmx/vmxon.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/tests/vvmx/vmxon.c b/tests/vvmx/vmxon.c
index f230fdf..75b6dcb 100644
--- a/tests/vvmx/vmxon.c
+++ b/tests/vvmx/vmxon.c
@@ -102,6 +102,22 @@ static bool test_vmxon_unaligned_addr(void)
                               VMXERR_VMFAIL_INVALID, 0, 0);
 }
 
+/**
+ * vmxon with VMCS revision ID mismatched with MSR_IA32_VMX_BASIC
+ *
+ * Expect: VMfailInvalid
+ */
+static bool test_vmxon_mismatched_revid(void)
+{
+    clear_vmcs(vmxon_region, get_vmcs_revid() + 1);
+
+    exinfo_t fault;
+    uint8_t ret = vmxon((uint64_t)vmxon_region, &fault);
+
+    return handle_vmxinsn_err(__func__, ret, fault,
+                              VMXERR_VMFAIL_INVALID, 0, 0);
+}
+
 bool test_vmxon(void)
 {
     if ( !test_vmxon_novmxe() )
@@ -119,6 +135,9 @@ bool test_vmxon(void)
     if ( !test_vmxon_unaligned_addr() )
         return false;
 
+    if ( !test_vmxon_mismatched_revid() )
+        return false;
+
     return true;
 }
 
-- 
2.10.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.