x86emul: drop open-coding of REX.W prefixes
PATCH 1/1 x86emul: drop open-coding of REX.W prefixes
Along the lines of 0e3642514719 ("x86: drop REX64_PREFIX"), move to well formed FXSAVEQ / FXRSTORQ here as well.
Signed-off-by Jan Beulich <[email protected]>
xen/arch/x86/x86_emulate/blk.c +3 -20
@@ -259,16 +259,7 @@ int x86_emul_blk(if ( s->op_bytes <sizeof (*fxsr) ) {if ( s->rex_prefix &REX_W ) - { -/* -* The only way to force fxsaveq on a wide range of gas -* versions. On older versions the rex64 prefix works only if -* we force an addressing mode that doesn't require extended -* registers. -*/ - asmvolatile (".byte 0x48; fxsave (%1)" - :"=m" (*fxsr) :"R" (fxsr) ); - } + asmvolatile ("fxsaveq %0" :"=m" (*fxsr) );else asmvolatile ("fxsave %0" :"=m" (*fxsr) ); }
@@ -285,11 +276,7 @@ int x86_emul_blk(generate_exception_if (fxsr->mxcsr & ~mxcsr_mask,X86_EXC_GP ,0 );if ( s->rex_prefix &REX_W ) - { -/* See above for why operand/constraints are this way. */ - asmvolatile (".byte 0x48; fxrstor (%1)" - ::"m" (*fxsr),"R" (fxsr) ); - } + asmvolatile ("fxrstorq %0" ::"m" (*fxsr) );else asmvolatile ("fxrstor %0" ::"m" (*fxsr) );break ;
@@ -310,11 +297,7 @@ int x86_emul_blk( fxsr = ptr;if ( s->rex_prefix &REX_W ) - { -/* See above for why operand/constraints are this way. */ - asmvolatile (".byte 0x48; fxsave (%1)" - :"=m" (*fxsr) :"R" (fxsr) ); - } + asmvolatile ("fxsaveq %0" :"=m" (*fxsr) );else asmvolatile ("fxsave %0" :"=m" (*fxsr) );
Quoted 4 lines · Jan Beulich
Along the lines of
0e3642514719("x86: dropREX64_PREFIX"), move to well formed FXSAVEQ / FXRSTORQ here as well.Signed-off-by Jan Beulich <[email protected]>
Acked-by Andrew Cooper <[email protected]>