[PATCH] x86emul: MOVRS are NOREP

Jan Beulich posted 1 patch 1 week ago
[PATCH] x86emul: MOVRS are NOREP
Posted by Jan Beulich 1 week ago
REP prefixes alter the encoding (to, presently, #UD), which wants
reflecting in what is recorded during decode.

Fixes: 59b18eb757db ("x86emul: support non-SIMD MOVRS")
Reported-by: Roger Pau Monné <roger.pau@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -918,6 +918,8 @@ decode_0f38(struct x86_emulate_state *s,
         s->desc = DstReg | SrcMem | Mov;
         if ( !(ctxt->opcode & 1) )
             s->desc |= ByteOp;
+        if ( s->vex.pfx >= vex_f3 )
+            ctxt->opcode |= MASK_INSR(s->vex.pfx, X86EMUL_OPC_PFX_MASK);
         s->simd_size = simd_none;
         break;