@@ -134,6 +134,21 @@ static bool test_vmxon_revid_bit31(void)
VMXERR_VMFAIL_INVALID, 0, 0);
}
+/**
+ * vmxon expected to succeed
+ *
+ * Expect: not errors
+ */
+static bool test_vmxon_correct(void)
+{
+ clear_vmcs(vmxon_region, get_vmcs_revid());
+
+ exinfo_t fault;
+ uint8_t ret = vmxon((uint64_t)vmxon_region, &fault);
+
+ return handle_vmxinsn_err(__func__, ret, fault, VMXERR_NOERR, 0, 0);
+}
+
bool test_vmxon(void)
{
if ( !test_vmxon_novmxe() )
@@ -157,6 +172,9 @@ bool test_vmxon(void)
if ( !test_vmxon_revid_bit31() )
return false;
+ if ( !test_vmxon_correct() )
+ return false;
+
return true;
}
No error is expected in this test. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> --- tests/vvmx/vmxon.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)