[PATCH] x86/emul: Reject MOVNTI without a memory operand

Andrew Cooper posted 1 patch 1 day, 22 hours ago
xen/arch/x86/x86_emulate/x86_emulate.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] x86/emul: Reject MOVNTI without a memory operand
Posted by Andrew Cooper 1 day, 22 hours ago
MOVNTI encoded with two registers is treated as a plain reg->reg move by the
emulator, but it's a nonsensical encoding which hardware rejects with #UD.

Fixes: 372da9b41e0f ("x86: add movnti emulation")
Reported-by: Teddy Astie <teddy.astie@vates.tech>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau Monné <roger@xenproject.org>
CC: Teddy Astie <teddy.astie@vates.tech>
---
 xen/arch/x86/x86_emulate/x86_emulate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c
index 09d43d204b8a..dc349115ba66 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -5429,6 +5429,7 @@ x86_emulate(
 
     case X86EMUL_OPC(0x0f, 0xc3): /* movnti */
         /* Ignore the non-temporal hint for now. */
+        generate_exception_if(ea.type != OP_MEM, X86_EXC_UD);
         vcpu_must_have(sse2);
         dst.val = src.val;
         sfence = true;

base-commit: 3b65ff9f372fb85a453a952977cc033298cba8b5
-- 
2.39.5


Re: [PATCH] x86/emul: Reject MOVNTI without a memory operand
Posted by Jan Beulich 1 day, 21 hours ago
On 24.11.2026 13:37, Andrew Cooper wrote:
> MOVNTI encoded with two registers is treated as a plain reg->reg move by the
> emulator, but it's a nonsensical encoding which hardware rejects with #UD.
> 
> Fixes: 372da9b41e0f ("x86: add movnti emulation")
> Reported-by: Teddy Astie <teddy.astie@vates.tech>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>