Skip to contentSkip to conversation

x86emul: MOVBE requires a memory operand

PATCH In review Jan Beulich 2 participants 2 messages Nov 27, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86emul: MOVBE requires a memory operand

The reg-reg forms should cause #UD; they come into existence only with APX, where MOVBE also extends BSWAP (for the latter not being "eligible" to a REX2 prefix).

xen/arch/x86/x86_emulate/x86_emulate.c +1 -0
@@ -6824,6 +6824,7 @@ x86_emulate(
 
     case X86EMUL_OPC(0x0f38, 0xf0): /* movbe m,r */
     case X86EMUL_OPC(0x0f38, 0xf1): /* movbe r,m */
+        generate_exception_if(ea.type != OP_MEM, X86_EXC_UD);
         vcpu_must_have(movbe);
         switch ( op_bytes )
         {