From b7972eae5aa91c72c3db2ac991b9317c88f30ff5 Mon Sep 17 00:00:00 2001 From: Haozhong Zhang Date: Fri, 16 Dec 2016 21:43:43 +0800 Subject: [PATCH] vvmx: Test vmxon with bit 31 of VMCS revision ID set VMfailInvalid is expected in this test. Signed-off-by: Haozhong Zhang Rebase and cleanup. Signed-off-by: Andrew Cooper --- tests/vvmx/vmxon.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/vvmx/vmxon.c b/tests/vvmx/vmxon.c index 4fe68e2..8b92d5d 100644 --- a/tests/vvmx/vmxon.c +++ b/tests/vvmx/vmxon.c @@ -84,6 +84,19 @@ static void test_vmxon_mismatched_revid(void) check(__func__, ex, VMERR_INVALID); } +/** + * vmxon with VMCS revision ID[31] set + * + * Expect: VMfailInvalid + */ +static void test_vmxon_revid_bit31(void) +{ + clear_vmcs(vmxon_region_unused, vmcs_revid | (1UL << 31)); + exinfo_t ex = stub_vmxon(_u(vmxon_region_unused)); + + check(__func__, ex, VMERR_INVALID); +} + void test_vmxon(void) { unsigned long cr4 = read_cr4(); @@ -102,6 +115,7 @@ void test_vmxon(void) test_vmxon_overly_wide_paddr(); test_vmxon_unaligned_paddr(); test_vmxon_mismatched_revid(); + test_vmxon_revid_bit31(); } /* -- 2.39.5