diff mbox series

[kvm-unit-tests,1/8] nVMX: Eliminate superfluous entry_failure_handler() wrapper

Message ID 20200312232745.884-2-sean.j.christopherson@intel.com (mailing list archive)
State New, archived
Headers show
Series nVMX: Clean up __enter_guest() and co. | expand

Commit Message

Sean Christopherson March 12, 2020, 11:27 p.m. UTC
Check and invoke the current entry failure handler directly from
vmx_run() to eliminate an unnecessary layer and its stale comment.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 x86/vmx.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)
diff mbox series

Patch

diff --git a/x86/vmx.c b/x86/vmx.c
index 0f2521b..99c3791 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -1631,21 +1631,6 @@  static int exit_handler(void)
 	return ret;
 }
 
-/*
- * Called if vmlaunch or vmresume fails.
- *	@early    - failure due to "VMX controls and host-state area" (26.2)
- *	@vmlaunch - was this a vmlaunch or vmresume
- *	@rflags   - host rflags
- */
-static int
-entry_failure_handler(struct vmentry_failure *failure)
-{
-	if (current->entry_failure_handler)
-		return current->entry_failure_handler(failure);
-	else
-		return VMX_TEST_EXIT;
-}
-
 /*
  * Tries to enter the guest. Returns true if entry succeeded. Otherwise,
  * populates @failure.
@@ -1704,8 +1689,10 @@  static int vmx_run(void)
 			 */
 			launched = 1;
 			ret = exit_handler();
+		} else if (current->entry_failure_handler) {
+			ret = current->entry_failure_handler(failure);
 		} else {
-			ret = entry_failure_handler(&failure);
+			ret = VMX_TEST_EXIT;
 		}
 
 		switch (ret) {