]> xenbits.xensource.com Git - people/andrewcoop/xen-test-framework.git/commitdiff
vvmx: Test vmxon with invalidly wide VMXON region address
authorHaozhong Zhang <haozhong.zhang@intel.com>
Fri, 16 Dec 2016 13:43:40 +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 aa65aa2dcb5f8237a75211a6ed969af086052ce4..3fe40a6c82a0d98e326a331be94128ff1e9f155d 100644 (file)
@@ -47,6 +47,18 @@ static void test_vmxon_in_user(void)
     check(__func__, ex, EXINFO_SYM(GP, 0));
 }
 
+/**
+ * vmxon with a physical address that exceeds the maximum address width
+ *
+ * Expect: VMfailInvalid
+ */
+static void test_vmxon_overly_wide_paddr(void)
+{
+    exinfo_t ex = stub_vmxon(1ULL << maxphysaddr);
+
+    check(__func__, ex, VMERR_INVALID);
+}
+
 void test_vmxon(void)
 {
     unsigned long cr4 = read_cr4();
@@ -62,6 +74,7 @@ void test_vmxon(void)
     write_cr4(cr4 |= X86_CR4_VMXE);
 
     test_vmxon_in_user();
+    test_vmxon_overly_wide_paddr();
 }
 
 /*