]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
x86emul: MOVBE requires a memory operand
authorJan Beulich <jbeulich@suse.com>
Mon, 2 Dec 2024 08:50:14 +0000 (09:50 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 2 Dec 2024 08:50:14 +0000 (09:50 +0100)
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).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c

index 0600df789c2876f88b0465d98906341405aadcf8..b89d4401339b7dc6c6a25cd78fc8bf035d6a0aa2 100644 (file)
@@ -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 )
         {