On 11/10/2026 5:30 PM, Jan Beulich wrote:
On 10.11.2026 08:12, Shuaidong Chen wrote:
In builds where the FPU, MMX and SIMD sections of the emulator are
compiled out - with CONFIG_HVM=n, private.h defines X86EMUL_NO_FPU,
X86EMUL_NO_MMX and X86EMUL_NO_SIMD - every `goto' targeting
simd_0f_fp, simd_0f_xmm, simd_0f_ymm, simd_0f_cvt, simd_0f_mmx,
simd_0f_imm8_avx2, simd_0f_imm8_ymm, simd_0f38_common and
simd_0f3a_common is preprocessed out, while the labels themselves
stay. They are unused by construction, which the build already
acknowledges by passing -Wno-unused-label for this translation unit.
If we choose to go this route, why would we then keep passing that extra
compiler option?
We'd have to keep it: patch 1 only covers the 9 hand-written labels,
while the 82 labels coming from the CASE_SIMD_* macros stay unused in
this configuration, and the compiler would still warn about them.
As to going this route - I wonder what the other x86
maintainers think. Afaic: I can live with the annotations, but I wouldn't
be over happy see them appear (as their amount is only going to grow).
Fair enough. I'll drop the annotations, see below.
Say it on the labels as well, the way the rest of the tree does
(unimplemented_insn here, done in blk.c). That also clears the reports
MISRA C:2012 Rule 2.6 (advisory) - "A function should not contain unused
label declarations" - raises against them, with no new deviation:
docs/misra/deviations.rst already recognises __maybe_unused as the way
to express this.
Emulator code is excluded from scanning in various other regards. Is there
a particular reason why this rule needs complying with?
Jan
No strong one. R2.6 is advisory, and the reports only show up in an
HVM-less configuration that upstream's ECLAIR jobs don't analyse.
--
Thx and BRs,
Shuaidong Chen