All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86emul: keep compiler from using {x, y, z}mm registers itself
@ 2017-10-16 12:32 Jan Beulich
  2017-10-16 12:37 ` Andrew Cooper
  2017-10-16 15:05 ` George Dunlap
  0 siblings, 2 replies; 11+ messages in thread
From: Jan Beulich @ 2017-10-16 12:32 UTC (permalink / raw)
  To: xen-devel; +Cc: George Dunlap, Andrew Cooper, Julien Grall

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 <george.dunlap@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
While this doesn't affect core functionality, I think it would still be
nice for it to be allowed in for 4.10.

--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -4,6 +4,11 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
+
+#if __GNUC__ >= 6
+#pragma GCC target("no-sse")
+#endif
+
 #include <xen/xen.h>
 
 #include <asm/msr-index.h>




_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-11-22 16:09 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 12:32 [PATCH] x86emul: keep compiler from using {x, y, z}mm registers itself Jan Beulich
2017-10-16 12:37 ` Andrew Cooper
2017-10-16 12:42   ` Jan Beulich
2017-11-06 11:59   ` Ping: " Jan Beulich
2017-11-06 15:04     ` George Dunlap
2017-11-13 16:22       ` Julien Grall
2017-11-21 13:26       ` Ping#2: " Jan Beulich
2017-11-21 13:29         ` Andrew Cooper
2017-11-22 16:09           ` Julien Grall
2017-10-16 15:05 ` George Dunlap
2017-10-16 15:44   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.