[kvm-unit-tests PATCH] vmx: zero value moved into CR8

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

 



"instruction intercept" test for CR8 was moving an uninitialized value from
eax into CR8. This could cause kvm_set_cr8 to fail the check against
CR8_RESERVED_BITS and generate a #GP.

Signed-off-by: Peter Shier <pshier@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 f57050eb6308..8f70014dc12d 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"
-- 
2.18.0.203.gfac676dfb9-goog




[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