[PATCH kvm-unit-tests 2/4] x86: vmx: fix vm{launch,resume} early exit logic

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

 



If vmlaunch or vmresume returns immediately, there's definitely been
an error -- rflags only needs to be consulted to determine what
error occurred. By setting fail=1 unconditionally, the test framework
will now detect problems with rflags *not* being set properly.

Signed-off-by: Peter Feiner <pfeiner@xxxxxxxxxx>
---
 x86/vmx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/x86/vmx.c b/x86/vmx.c
index b2e015f..27e85eb 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -911,6 +911,7 @@ static int vmx_run()
 	u32 ret = 0, fail = 0;
 
 	while (1) {
+
 		asm volatile (
 			"mov %%rsp, %%rsi\n\t"
 			"mov %2, %%rdi\n\t"
@@ -926,7 +927,7 @@ static int vmx_run()
 			"vmresume\n\t"
 			"2: "
 			SAVE_GPR_C
-			"setbe %0\n\t"
+			"movl $1, %0\n\t"
 			"jmp 3f\n\t"
 			"vmx_return:\n\t"
 			SAVE_GPR_C
-- 
2.8.0.rc3.226.g39d4020

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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