diff mbox series

[kvm-unit-tests,v5,3/4] x86: Add a helper to allow tests to signal completion without a vmcall()

Message ID 20220125203127.1161838-4-aaronlewis@google.com (mailing list archive)
State New, archived
Headers show
Series Add additional testing for routing L2 exceptions | expand

Commit Message

Aaron Lewis Jan. 25, 2022, 8:31 p.m. UTC
Putting a vmcall() at the end of a nested test isn't always convenient
to do, and isn't necessary.  Add a helper to allow the nested test
to make it possible to skip this requirement.

Signed-off-by: Aaron Lewis <aaronlewis@google.com>
---
 x86/vmx.c | 5 +++++
 x86/vmx.h | 1 +
 2 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/x86/vmx.c b/x86/vmx.c
index b2d8393..51eed8c 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -1910,6 +1910,11 @@  void test_override_guest(test_guest_func func)
 	init_vmcs_guest();
 }
 
+void test_set_guest_finished(void)
+{
+	guest_finished = 1;
+}
+
 static void check_for_guest_termination(union exit_reason exit_reason)
 {
 	if (is_hypercall(exit_reason)) {
diff --git a/x86/vmx.h b/x86/vmx.h
index dabd5da..11cb665 100644
--- a/x86/vmx.h
+++ b/x86/vmx.h
@@ -1058,5 +1058,6 @@  void test_set_guest(test_guest_func func);
 void test_override_guest(test_guest_func func);
 void test_add_teardown(test_teardown_func func, void *data);
 void test_skip(const char *msg);
+void test_set_guest_finished(void);
 
 #endif