|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFC PATCH 1/2] x86emul: mark the trimmed emulator's section-internal labels maybe-unused
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.
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.
No functional change.
Signed-off-by: Shuaidong Chen <shuaidong.chen@xxxxxxx>
---
xen/arch/x86/x86_emulate/x86_emulate.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c
b/xen/arch/x86/x86_emulate/x86_emulate.c
index f168f3ebcf..8bafe6b308 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -3406,7 +3406,7 @@ x86_emulate(
/* vdiv{p,s}{s,d}
{x,y}mm/mem,{x,y}mm,{x,y}mm */
CASE_SIMD_ALL_FP_VEX(0x0f, 0x5f): /* max{p,s}{s,d} xmm/mem,xmm */
/* vmax{p,s}{s,d}
{x,y}mm/mem,{x,y}mm,{x,y}mm */
- simd_0f_fp:
+ simd_0f_fp: __maybe_unused;
if ( vex.opcx == vex_none )
{
if ( vex.pfx & VEX_PREFIX_DOUBLE_MASK )
@@ -3416,7 +3416,7 @@ x86_emulate(
}
else
vcpu_must_have(sse);
- simd_0f_xmm:
+ simd_0f_xmm: __maybe_unused;
get_fpu(X86EMUL_FPU_xmm);
}
else
@@ -3426,7 +3426,7 @@ x86_emulate(
d |= TwoOp;
simd_0f_avx:
vcpu_must_have(avx);
- simd_0f_ymm:
+ simd_0f_ymm: __maybe_unused;
get_fpu(X86EMUL_FPU_ymm);
}
simd_0f_common:
@@ -4147,7 +4147,7 @@ x86_emulate(
/* vcvts{s,d}2s{s,d}
xmm/mem,xmm,xmm */
op_bytes = 4 << (((vex.pfx & VEX_PREFIX_SCALAR_MASK) ? 0 : 1 + vex.l) +
!!(vex.pfx & VEX_PREFIX_DOUBLE_MASK));
- simd_0f_cvt:
+ simd_0f_cvt: __maybe_unused;
if ( vex.opcx == vex_none )
goto simd_0f_sse2;
goto simd_0f_avx;
@@ -4354,7 +4354,7 @@ x86_emulate(
if ( vex.pfx )
goto simd_0f_sse2;
#endif /* !X86EMUL_NO_SIMD */
- simd_0f_mmx:
+ simd_0f_mmx: __maybe_unused;
vcpu_must_have(mmx);
get_fpu(X86EMUL_FPU_mmx);
goto simd_0f_common;
@@ -4607,7 +4607,7 @@ x86_emulate(
#endif
if ( vex.l )
{
- simd_0f_imm8_avx2:
+ simd_0f_imm8_avx2: __maybe_unused;
vcpu_must_have(avx2);
}
else
@@ -4624,7 +4624,7 @@ x86_emulate(
simd_0f_imm8_avx:
vcpu_must_have(avx);
}
- simd_0f_imm8_ymm:
+ simd_0f_imm8_ymm: __maybe_unused;
get_fpu(X86EMUL_FPU_ymm);
}
else if ( vex.pfx )
@@ -5683,7 +5683,7 @@ x86_emulate(
vcpu_must_have(ssse3);
if ( vex.pfx )
{
- simd_0f38_common:
+ simd_0f38_common: __maybe_unused;
get_fpu(X86EMUL_FPU_xmm);
}
else
@@ -7206,7 +7206,7 @@ x86_emulate(
vcpu_must_have(ssse3);
if ( vex.pfx )
{
- simd_0f3a_common:
+ simd_0f3a_common: __maybe_unused;
get_fpu(X86EMUL_FPU_xmm);
}
else
--
2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |