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

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

 



2018-03-07 12:50+0100, Paolo Bonzini:
> On 06/03/2018 21:50, Radim Krčmář wrote:
> > 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".
> 
> That's probably just because "no opcode" does not decode mod/rm/sib.

Good point, moving the EmulateOnUD check down gets the correct result.
I'll send a patch as doing more decoding before dying isn't harmful.

> > ---
> >  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
> 
> Why not -mno-sse?

We have asm some code with the "x" constraint and it wouldn't compile
without -msse.  Should I rewrite that to be explicit?

Thanks.



[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