]> xenbits.xensource.com Git - xen.git/commitdiff
x86emul: make test harness build again as 32-bit binary
authorJan Beulich <jbeulich@suse.com>
Tue, 1 Apr 2025 10:48:23 +0000 (12:48 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 1 Apr 2025 10:48:23 +0000 (12:48 +0200)
Adding Q suffixes to FXSAVE/FXRSTOR did break the 32-bit build. Don't go
back though, as the hand-coded 0x48 there weren't quite right either for
the 32-bit case (they might well cause confusion when looking at the
disassembly). Instead arrange for the compiler to DCE respective asm()-s,
by short-circuiting REX_* to zero.

Fixes: 5a33ea2800c1 ("x86emul: drop open-coding of REX.W prefixes")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/private.h

index ef4745f56e27d1e7caf75c124a32908fdd152051..f33330c7874165064262e94bf1349339a80d4bed 100644 (file)
@@ -110,11 +110,19 @@ struct operand {
     } mem;
 };
 
+#if defined(__x86_64__)
 #define REX_PREFIX 0x40
 #define REX_B 0x01
 #define REX_X 0x02
 #define REX_R 0x04
 #define REX_W 0x08
+#elif defined(__i386__)
+#define REX_PREFIX 0
+#define REX_B 0
+#define REX_X 0
+#define REX_R 0
+#define REX_W 0
+#endif
 
 enum simd_opsize {
     simd_none,