aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-04-23 13:05:43 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2020-04-23 17:00:28 -0400
commit7e7aa86f7418a8343de46583977f631e55fd02ed (patch)
treec2000213cbc2e818beb9d5d914c33985cc6b4e12
parent7af4533e9ceae1e2b610d8b085daa0f2f9c726ad (diff)
downloadkvm-unit-tests-7e7aa86f7418a8343de46583977f631e55fd02ed.tar.gz
SVM: move guest past HLT
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@redhat.com>
-rw-r--r--x86/svm_tests.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/x86/svm_tests.c b/x86/svm_tests.c
index c2725af..727870a 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 and RIP still points to it. */
+ 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 and RIP still points to it. */
+ vmcb->save.rip++;
+
report(true, "NMI intercept while running guest");
break;