[kvm-unit-test nVMX 1/2]: vmlaunch_succeeds() needs to check failure of VM-entry MSR-load

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

 



 .. as that is one of the valid reasons for vmentry failure.

Signed-off-by: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx>
Reviewed-by: Mihai Carabas <mihai.carabas@xxxxxxxxxx>
---
 x86/vmx_tests.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index ee0c9ff..02cd868 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -3262,6 +3262,8 @@ static void invvpid_test_v2(void)
  */
 static bool vmlaunch_succeeds(void)
 {
+	u32 exit_reason;
+
 	/*
 	 * Indirectly set VMX_INST_ERR to 12 ("VMREAD/VMWRITE from/to
 	 * unsupported VMCS component"). The caller can then check
@@ -3277,8 +3279,9 @@ static bool vmlaunch_succeeds(void)
 				   : success);
 	return false;
 success:
-	TEST_ASSERT(vmcs_read(EXI_REASON) ==
-		    (VMX_FAIL_STATE | VMX_ENTRY_FAILURE));
+	exit_reason = vmcs_read(EXI_REASON);
+	TEST_ASSERT(exit_reason == (VMX_FAIL_STATE | VMX_ENTRY_FAILURE) ||
+		    exit_reason == (VMX_FAIL_MSR | VMX_ENTRY_FAILURE));
 	return true;
 }
 
-- 
2.17.2




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux