[PATCH kvm-unit-tests] SVM: move guest past HLT

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

 



On AMD, the guest is not woken up from HLT by the interrupt or NMI vmexits.
Therefore we have to fix up the RIP manually.

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 x86/svm_tests.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/x86/svm_tests.c b/x86/svm_tests.c
index c2725af..1f2975c 100644
--- a/x86/svm_tests.c
+++ b/x86/svm_tests.c
@@ -1316,6 +1316,11 @@ static bool interrupt_finished(struct svm_test *test)
             return true;
         }
 
+        /* The guest is not woken up from HLT, unlike Intel.  Fix that up.  */
+        if (get_test_stage(test) == 3) {
+            vmcb->save.rip++;
+        }
+
         irq_enable();
         asm volatile ("nop");
         irq_disable();
@@ -1501,6 +1506,9 @@ static bool nmi_hlt_finished(struct svm_test *test)
             return true;
         }
 
+        /* The guest is not woken up from HLT, unlike Intel.  Fix that up.  */
+        vmcb->save.rip++;
+
         report(true, "NMI intercept while running guest");
         break;
 
-- 
2.18.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