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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 x86/vmx.c | 19 +++----------------
 1 file 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
@@ -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) {
-- 
2.24.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux