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

[Xen-devel] [XTF PATCH 09/16] vvmx: test vmxon with unaligned VMXON region address



VMfailInvalid is expected in this case.

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

diff --git a/tests/vvmx/vmxon.c b/tests/vvmx/vmxon.c
index 8147679..f230fdf 100644
--- a/tests/vvmx/vmxon.c
+++ b/tests/vvmx/vmxon.c
@@ -87,6 +87,21 @@ static bool test_vmxon_invalid_paddr_width(void)
                               VMXERR_VMFAIL_INVALID, 0, 0);
 }
 
+/**
+ * vmxon with VMXON region address not aligned to 4096
+ *
+ * Expect: VMfailInvalid
+ */
+static bool test_vmxon_unaligned_addr(void)
+{
+    uint64_t unaligned_addr = (uint64_t)vmxon_region | 0xff;
+    exinfo_t fault;
+    uint8_t ret = vmxon(unaligned_addr, &fault);
+
+    return handle_vmxinsn_err(__func__, ret, fault,
+                              VMXERR_VMFAIL_INVALID, 0, 0);
+}
+
 bool test_vmxon(void)
 {
     if ( !test_vmxon_novmxe() )
@@ -101,6 +116,9 @@ bool test_vmxon(void)
     if ( !test_vmxon_invalid_paddr_width() )
         return false;
 
+    if ( !test_vmxon_unaligned_addr() )
+        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®.