diff mbox series

[kvm-unit-tests,v2,2/2] x86: nVMX: Set guest as active after NMI/INTR-window tests

Message ID 20190518160231.4063-3-nadav.amit@gmail.com (mailing list archive)
State New, archived
Headers show
Series x86: nVMX: Fix NMI/INTR-window tests | expand

Commit Message

Nadav Amit May 18, 2019, 4:02 p.m. UTC
Running tests which are similar to verify_nmi_window_exit() and
verify_intr_window_exit() on bare-metal suggests that real CPUs do not
wake up. It appears, according to Sean, that the activity state should
not change after NMI/INTR-window.

Remove the offending test and set the activity state to "active" after
each test to prevent the whole test-suite from getting stuck.

Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Nadav Amit <nadav.amit@gmail.com>
---
 x86/vmx_tests.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index f921286..1092fad 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -7060,9 +7060,7 @@  static void verify_nmi_window_exit(u64 rip)
 	       exit_reason == VMX_NMI_WINDOW, exit_reason);
 	report("RIP (%#lx) is %#lx", vmcs_read(GUEST_RIP) == rip,
 	       vmcs_read(GUEST_RIP), rip);
-	report("Activity state (%ld) is 'ACTIVE'",
-	       vmcs_read(GUEST_ACTV_STATE) == ACTV_ACTIVE,
-	       vmcs_read(GUEST_ACTV_STATE));
+	vmcs_write(GUEST_ACTV_STATE, ACTV_ACTIVE);
 }
 
 static void vmx_nmi_window_test(void)
@@ -7196,9 +7194,7 @@  static void verify_intr_window_exit(u64 rip)
 	       exit_reason == VMX_INTR_WINDOW, exit_reason);
 	report("RIP (%#lx) is %#lx", vmcs_read(GUEST_RIP) == rip,
 	       vmcs_read(GUEST_RIP), rip);
-	report("Activity state (%ld) is 'ACTIVE'",
-	       vmcs_read(GUEST_ACTV_STATE) == ACTV_ACTIVE,
-	       vmcs_read(GUEST_ACTV_STATE));
+	vmcs_write(GUEST_ACTV_STATE, ACTV_ACTIVE);
 }
 
 static void vmx_intr_window_test(void)