[xen master] x86emul/test: keep compiler from using {x, y, z}mm registers itself

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] x86emul/test: keep compiler from using {x, y, z}mm registers itself

patchbot
commit 79136f2673b52db7b4bbd6cb5da194f2f4c39a9d
Author:     Jan Beulich <[hidden email]>
AuthorDate: Thu Nov 23 11:40:31 2017 +0100
Commit:     Jan Beulich <[hidden email]>
CommitDate: Thu Nov 23 11:40:31 2017 +0100

    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 <[hidden email]>
    Signed-off-by: Jan Beulich <[hidden email]>
    Acked-by: Andrew Cooper <[hidden email]>
    Release-acked-by: Julien Grall <[hidden email]>
---
 tools/tests/x86_emulator/x86-emulate.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/tests/x86_emulator/x86-emulate.h b/tools/tests/x86_emulator/x86-emulate.h
index b901010..fbf2944 100644
--- 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>
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog