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

[Xen-changelog] [xen master] x86emul: fix 32-bit test build



commit 71b165d2d4215c1556b62231d127a233225360ee
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon Mar 14 13:02:56 2016 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Mar 14 13:02:56 2016 +0100

    x86emul: fix 32-bit test build
    
    Commit 5644ce0142 ("x86emul: relax asm() constraints") introduced a
    64-bit only instruction suffix, which breaks running the emulator test
    on a 32-bit system. Mirror __OS (and _OP for completeness) to the test
    wrapper source file.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 tools/tests/x86_emulator/x86_emulate.c | 9 +++++++++
 xen/arch/x86/x86_emulate/x86_emulate.c | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/tools/tests/x86_emulator/x86_emulate.c 
b/tools/tests/x86_emulator/x86_emulate.c
index f5b450d..5d7fae4 100644
--- a/tools/tests/x86_emulator/x86_emulate.c
+++ b/tools/tests/x86_emulator/x86_emulate.c
@@ -18,6 +18,15 @@ typedef bool bool_t;
 
 #define __packed __attribute__((packed))
 
+/* For generic assembly code: use macros to define operation/operand sizes. */
+#ifdef __i386__
+# define __OS          "l"  /* Operation Suffix */
+# define __OP          "e"  /* Operand Prefix */
+#else
+# define __OS          "q"  /* Operation Suffix */
+# define __OP          "r"  /* Operand Prefix */
+#endif
+
 #include "x86_emulate/x86_emulate.h"
 
 #define get_stub(stb) ((void *)((stb).addr = (uintptr_t)(stb).buf))
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c 
b/xen/arch/x86/x86_emulate/x86_emulate.c
index 07fdaeb..10a2959 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -853,7 +853,7 @@ static bool_t div_dbl(unsigned long u[2], unsigned long v)
 {
     if ( (v == 0) || (u[1] >= v) )
         return 1;
-    asm ( "divq %2" : "+a" (u[0]), "+d" (u[1]) : "rm" (v) );
+    asm ( "div"__OS" %2" : "+a" (u[0]), "+d" (u[1]) : "rm" (v) );
     return 0;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.