[PATCH] x86emul: MOVRS are mem-only and 64-bit-only

Jan Beulich posted 1 patch 1 day, 1 hour ago
[PATCH] x86emul: MOVRS are mem-only and 64-bit-only
Posted by Jan Beulich 1 day, 1 hour ago
Register forms are supposed to #UD, and the encodings are undefined
outside of 64-bit mode.

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/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -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;

Re: [PATCH] x86emul: MOVRS are mem-only and 64-bit-only
Posted by Andrew Cooper 1 day, 1 hour ago
On 25/11/2026 9:38 am, Jan Beulich wrote:
> Register forms are supposed to #UD, and the encodings are undefined
> outside of 64-bit mode.
>
> Fixes: 59b18eb757db ("x86emul: support non-SIMD MOVRS")
> Reported-by: Roger Pau Monné <roger.pau@amd.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>