[kvm-unit-tests PATCH] x86: prevent GCC from using sse2 instructions

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

 



GCC 8 emitted MOVDQU when compiling vmx.elf, but we do not enable
CR4.OSFXSR in that test, so the instruction throws #UD.
This patch forbids all sse2 instructions, instead of enabling
CR4.OSFXSR, as I think it's better to keep the environment minimal.

Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
---
This probably hit a minor KVM bug: the instruction was "f3 0f 6f 41 28",
but KVM reported that #UD happened on "f3 0f 6f 41".
---
 x86/Makefile.x86_64 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/x86/Makefile.x86_64 b/x86/Makefile.x86_64
index 623fc5b37726..6caa3a8863f1 100644
--- a/x86/Makefile.x86_64
+++ b/x86/Makefile.x86_64
@@ -1,7 +1,7 @@
 cstart.o = $(TEST_DIR)/cstart64.o
 bits = 64
 ldarch = elf64-x86-64
-COMMON_CFLAGS += -mno-red-zone
+COMMON_CFLAGS += -mno-red-zone -mno-sse2
 
 cflatobjs += lib/x86/setjmp64.o
 cflatobjs += lib/x86/intel-iommu.o
-- 
2.16.2




[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