[PATCH kvm-unit-tests] vmx: fix CR8 load intercept test

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

 



If the RAX register has invalid bits set, a mov to CR8 instruction can
raise a #GP.  This has not been happening so far only because the compiler
gods were good friends with the original author of the tests; but they
did not like Thomas as well, and the test started failing with commit
19230e96697efa1e65a8945b6911a6eb4506d4e9 (Make vmx_tests.c compilable with
-Wmissing-prototypes and -Wstrict-prototypes).

Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 x86/vmx_tests.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/x86/vmx_tests.c b/x86/vmx_tests.c
index 215953d..cbbb701 100644
--- a/x86/vmx_tests.c
+++ b/x86/vmx_tests.c
@@ -762,7 +762,7 @@ asm(
 	"insn_cr3_load: mov cr3,%rax; mov %rax,%cr3;ret\n\t"
 	"insn_cr3_store: mov %cr3,%rax;ret\n\t"
 #ifdef __x86_64__
-	"insn_cr8_load: mov %rax,%cr8;ret\n\t"
+	"insn_cr8_load: xor %eax, %eax; mov %rax,%cr8;ret\n\t"
 	"insn_cr8_store: mov %cr8,%rax;ret\n\t"
 #endif
 	"insn_monitor: xor %eax, %eax; xor %ecx, %ecx; xor %edx, %edx; monitor;ret\n\t"
-- 
1.8.3.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