aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-03-12 16:27:38 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2020-03-14 11:31:36 +0100
commitdb6f75d8ed3bad508612da5833916390aa6b1e35 (patch)
treee262c3378ca333059e7003f5257736456e51f573
parent2b934609604d16126499c8acef2808d84990968f (diff)
downloadkvm-unit-tests-db6f75d8ed3bad508612da5833916390aa6b1e35.tar.gz
nVMX: Eliminate superfluous entry_failure_handler() wrapper
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> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--x86/vmx.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/x86/vmx.c b/x86/vmx.c
index 0f2521b..99c3791 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -1632,21 +1632,6 @@ static int exit_handler(void)
}
/*
- * 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) {