From: Jan Beulich Date: Thu, 23 Nov 2017 10:40:31 +0000 (+0100) Subject: x86emul/test: keep compiler from using {x,y,z}mm registers itself X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~1021 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=79136f2673b52db7b4bbd6cb5da194f2f4c39a9d;p=xen.git x86emul/test: keep compiler from using {x,y,z}mm registers itself Since the emulator acts on the live hardware registers, we need to prevent the compiler from using them e.g. for inlined memcpy() / memset() (as gcc7 does). We can't, however, set this from the command line, as otherwise the 64-bit build would face issues with functions returning floating point values and being declared in standard headers. As the pragma isn't available prior to gcc6, we need to invoke it conditionally. Luckily up to gcc6 we haven't seen generated code access SIMD registers beyond what our asm()s do. Reported-by: George Dunlap Signed-off-by: Jan Beulich Acked-by: Andrew Cooper Release-acked-by: Julien Grall --- diff --git a/tools/tests/x86_emulator/x86-emulate.h b/tools/tests/x86_emulator/x86-emulate.h index b90101004f..fbf2944547 100644 --- a/tools/tests/x86_emulator/x86-emulate.h +++ b/tools/tests/x86_emulator/x86-emulate.h @@ -4,6 +4,11 @@ #include #include #include + +#if __GNUC__ >= 6 +#pragma GCC target("no-sse") +#endif + #include #include