[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 2/2] misra: deviate R2.6 for the labels generated by CASE_SIMD_*
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: "Chen, Shuaidong" <Shuaidong.Chen@xxxxxxx>
- Date: Tue, 10 Nov 2026 21:09:47 +0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ORIXRxBWxF5bDZDrVCcKh591romBOFDqJSpUOA00wpU=; b=EMXQnY8FTLSqsTgdL6knZbmA4V5Pt+X8D7iy67B1n3cERUf9pX+EfC39upo6qpqmZN750wsW74V+uhatCpLHg8XS4Zc1BQRB+ELM3HQgYvOIBQZEenvdjxwR8/07pBYTq7OPcoHoPKWtZW7Fv83VoOK7IrxEjcHS80kd1a9OtS3/q9KdAPP/UCYVIxZWdOvKDZJh8uE9yoD8w4srTFOuEtShPg7Z9oJBTLhs1fl5uKLR5Y867TM2Xz2HwRtNcGp+mRoCt1DGGLR3rL4lgCyp59Pqmq+Amrv8QMuKPgZJZ17t3hE6PkHP8ZTB4QY4bZsXiwnZNd5FZsKb5k8+CdbCSg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W9w+zUIBHIVa+sambrbhqo0veEydkqR1fxCQeZWDc3X3HcavxtdCBfak/P5fURn+/wsCiXi3Fr+hyLE4RoIpvUn1T/PlU/FnET0kb8siEFJr+uZh4V8mhvmVAsFVPiSlysJJvg+wZlhqf0in7ltorOu89bx9+sIKuwHIWieZdG0V61QZgPz9zkfJwtJIUNeCUfOqwAgtuPtQSL3hxlpibRTCfEO3PKVhw3aEPXcN0gUtl6qOphZW1fP5cd4d7GRz7pxZs7kQPQxgD3/oFuXOjKT9To1MhQiq72Gv2oE4eYknxR6tPRV3faXdjRH3VfJCbAWRu/6qKD7MamK1l7UWbQ==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>, Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, Penny Zheng <penny.zheng@xxxxxxx>, Ray Huang <Ray.Huang@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 10 Nov 2026 13:10:34 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 11/10/2026 5:41 PM, Jan Beulich wrote:
On 10.11.2026 08:12, Shuaidong Chen wrote:
MISRA C:2012 Rule 2.6 (advisory) states that "a function should not
contain unused label declarations".
When SIMD emulation is compiled out of the x86 emulator (CONFIG_HVM=n),
private.h defines X86EMUL_NO_SIMD and the CASE_SIMD_* macros
deliberately expand to plain identifiers instead of case labels, so
that the opcode switch builds without conditionals around every case.
The labels they produce (e.g. Cs0x0f_0x2b) are never the target of a
goto, and the build already passes -Wno-unused-label for this object.
These cannot be annotated in the source: ECLAIR reports them at the
macro's use site, while __maybe_unused could only live in the macro's
replacement list, out of reach of the existing text-based R2.6
deviation. Extend that deviation to labels coming from the expansion
of a CASE_SIMD_* macro, and document it.
__maybe_unused could be passed as another argument into the macros. That
would feel redundant, but if that's the only way to please Eclair, maybe
that's the way to go.
That would work for Eclair, but it means touching all 82 use sites and
every CASE_SIMD_* definition, which is the kind of churn you'd rather
avoid.
Like for the other patch I'd also like to understand why fiddling with
emulator code suddenly becomes necessary, when we already have a blanket
exclusion for e.g. rule 16.2.
It isn't necessary. I'll send a v2 that drops patch 1 and replaces this
patch with an R2.6 deviation for the emulator as a whole, modelled on
the existing R16.2 one. It covers all 91 reports without touching the
emulator source, and -Wno-unused-label stays as it is.
Finally, for both patches - aren't your Cc lists excessively long?
Sorry. I'll trim it for v2.
Jan
--
Thx and BRs,
Shuaidong Chen
|