All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chen, Shuaidong" <Shuaidong.Chen@amd.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger@xenproject.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Nicola Vetrini" <nicola.vetrini@bugseng.com>,
	"Doug Goldstein" <cardoe@cardoe.com>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Julien Grall" <julien@xen.org>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Teddy Astie" <teddy.astie@vates.tech>,
	"Dmytro Prokopchuk" <dmytro_prokopchuk1@epam.com>,
	"Grygorii Strashko" <grygorii_strashko@epam.com>,
	"Penny Zheng" <penny.zheng@amd.com>,
	"Ray Huang" <Ray.Huang@amd.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [RFC PATCH 2/2] misra: deviate R2.6 for the labels generated by CASE_SIMD_*
Date: Tue, 10 Nov 2026 21:09:47 +0800	[thread overview]
Message-ID: <4fbd1e45-159d-4483-989a-e2f37e182aee@amd.com> (raw)
In-Reply-To: <49b1f05e-ed9b-49fc-84db-ede026e55343@suse.com>


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



      reply	other threads:[~2026-11-10 13:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  7:12 [RFC PATCH 0/2] x86emul: address MISRA R2.6 in CONFIG_HVM=n builds Shuaidong Chen
2026-11-10  7:12 ` [RFC PATCH 1/2] x86emul: mark the trimmed emulator's section-internal labels maybe-unused Shuaidong Chen
2026-11-10  9:30   ` Jan Beulich
2026-11-10 13:05     ` Chen, Shuaidong
2026-11-10  7:12 ` [RFC PATCH 2/2] misra: deviate R2.6 for the labels generated by CASE_SIMD_* Shuaidong Chen
2026-11-10  9:41   ` Jan Beulich
2026-11-10 13:09     ` Chen, Shuaidong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4fbd1e45-159d-4483-989a-e2f37e182aee@amd.com \
    --to=shuaidong.chen@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=cardoe@cardoe.com \
    --cc=dmytro_prokopchuk1@epam.com \
    --cc=grygorii_strashko@epam.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=nicola.vetrini@bugseng.com \
    --cc=penny.zheng@amd.com \
    --cc=roger@xenproject.org \
    --cc=sstabellini@kernel.org \
    --cc=teddy.astie@vates.tech \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.