[PATCH] x86emul: MOVBE requires a memory operand

Jan Beulich posted 1 patch 1 week, 2 days ago
Failed in applying to current master (apply log)
[PATCH] x86emul: MOVBE requires a memory operand
Posted by Jan Beulich 1 week, 2 days ago
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>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -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 )
         {
Re: [PATCH] x86emul: MOVBE requires a memory operand
Posted by Andrew Cooper 1 week, 2 days ago
On 27/11/2024 7:15 am, Jan Beulich wrote:
> 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>