Skip to contentSkip to conversation

x86emul: MOVRS are mem-only and 64-bit-only

PATCH In review Jan Beulich 2 participants 2 messages Nov 25

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86emul: MOVRS are mem-only and 64-bit-only

Register forms are supposed to #UD, and the encodings are undefined outside of 64-bit mode.

Fixes 59b18eb757db ("x86emul: support non-SIMD MOVRS")
xen/arch/x86/x86_emulate/x86_emulate.c +1 -0
@@ -6381,6 +6381,7 @@ x86_emulate(
 
     case X86EMUL_OPC(0x0f38, 0x8a)
      ... X86EMUL_OPC(0x0f38, 0x8b): /* movrs */
+        generate_exception_if(!mode_64bit() || ea.type != OP_MEM, X86_EXC_UD);
         vcpu_must_have(movrs);
         dst.val = src.val;
         break;