diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2020-03-12 16:27:38 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-03-14 11:31:36 +0100 |
commit | db6f75d8ed3bad508612da5833916390aa6b1e35 (patch) | |
tree | e262c3378ca333059e7003f5257736456e51f573 | |
parent | 2b934609604d16126499c8acef2808d84990968f (diff) | |
download | kvm-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.c | 19 |
1 files changed, 3 insertions, 16 deletions
@@ -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) { |