[PATCH] x86emul: prune an excess EVEX.Z check

Jan Beulich posted 1 patch 6 days, 6 hours ago
Failed in applying to current master (apply log)
[PATCH] x86emul: prune an excess EVEX.Z check
Posted by Jan Beulich 6 days, 6 hours ago
DstMem processing early in x86_emulate() raises #UD when EVEX.Z is set
with a memory destination. Open-coded checks like this one are therefore
dead / unreachable code, violating Misra rules.

Fixes: 4037a62ef93e ("x86emul: support AVX512F floating-point conversion insns")
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
@@ -7348,7 +7348,7 @@ x86_emulate(
         if ( evex_encoded() )
         {
             generate_exception_if((evex.w || evex.reg != 0xf || !evex.RX ||
-                                   (ea.type != OP_REG && (evex.z || evex.brs))),
+                                   (ea.type != OP_REG && evex.brs)),
                                   X86_EXC_UD);
             host_and_vcpu_must_have(avx512f);
             avx512_vlen_check(false);
Re: [PATCH] x86emul: prune an excess EVEX.Z check
Posted by Andrew Cooper 3 days, 6 hours ago
On 17/07/2026 3:06 pm, Jan Beulich wrote:
> DstMem processing early in x86_emulate() raises #UD when EVEX.Z is set
> with a memory destination. Open-coded checks like this one are therefore
> dead / unreachable code, violating Misra rules.
>
> Fixes: 4037a62ef93e ("x86emul: support AVX512F floating-point conversion insns")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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