Skip to contentSkip to conversation

x86emul: prune an excess EVEX.Z check

PATCH In review Jan Beulich 2 participants 2 messages Jul 17 – Jul 20

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86emul: prune an excess EVEX.Z check

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")
xen/arch/x86/x86_emulate/x86_emulate.c +1 -1
@@ -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);
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Jan Beulich

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")