[PATCH] kvm-unit-tests: Fix GCC's 4.8 labels as values for nVMX tests.

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

 



Commit 3b1274463fa8d074dd3bc77efe25b59a4ddd491e uses GCCs extension
labels as values to handle exceptions, but GCC 4.8 ``mistakingly''
uses the next body function as a jump label, for functions which
do not return. Fixed by returning a int value for those functions.

See http://thread.gmane.org/gmane.comp.emulators.kvm.devel/119186

Signed-off-by: Marius Vlad <mv@xxxxxxxxxxxxxxxxx>
---
 x86/vmx.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/x86/vmx.c b/x86/vmx.c
index fe950e6..0c895af 100644
--- a/x86/vmx.c
+++ b/x86/vmx.c
@@ -548,7 +548,7 @@ static void exception_handler(struct ex_regs *regs)
 	regs->rip = (u64)exception_return;
 }
 
-static int test_for_exception(unsigned int ex, void (*func)(void))
+static int test_for_exception(unsigned int ex, int (*func)(void))
 {
 	handle_exception(ex, exception_handler);
 	exception = false;
@@ -557,23 +557,23 @@ static int test_for_exception(unsigned int ex, void (*func)(void))
 	return exception;
 }
 
-static void do_vmxon_off(void)
+static int do_vmxon_off(void)
 {
 	exception_return = &&resume;
 	barrier();
 	vmx_on();
 	vmx_off();
 resume:
-	return;
+	return 0;
 }
 
-static void do_write_feature_control(void)
+static int do_write_feature_control(void)
 {
 	exception_return = &&resume;
 	barrier();
 	wrmsr(MSR_IA32_FEATURE_CONTROL, 0);
 resume:
-	return;
+	return 0;
 }
 
 static int test_vmx_feature_control(void)
-- 
1.8.5.3

--
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