Message ID | 569f350e-21bc-4fd3-8bba-991d6c34d08a@suse.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | x86emul: make test harness build again as 32-bit binary | expand |
On 31/03/2025 4:55 pm, Jan Beulich wrote: > 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>
--- a/xen/arch/x86/x86_emulate/private.h +++ b/xen/arch/x86/x86_emulate/private.h @@ -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,
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>