All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>,
	"Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Julien Grall" <julien@xen.org>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Michal Orzel" <michal.orzel@amd.com>
Subject: Re: [PATCH] xen: Use asm inline when available for alternatives
Date: Tue, 22 Apr 2025 22:08:53 +0200	[thread overview]
Message-ID: <60e776075c8861f825ef2589b9053792@bugseng.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2504221302120.785180@ubuntu-linux-20-04-desktop>

On 2025-04-22 22:02, Stefano Stabellini wrote:
> On Tue, 22 Apr 2025, Nicola Vetrini wrote:
>> On 2025-04-22 21:58, Stefano Stabellini wrote:
>> > On Tue, 22 Apr 2025, Andrew Cooper wrote:
>> > > On 22/04/2025 8:46 pm, Stefano Stabellini wrote:
>> > > > On Tue, 22 Apr 2025, Andrew Cooper wrote:
>> > > >> Compilers estimate the size of an asm() block for inlining purposes.
>> > > >>
>> > > >> Constructs such as ALTERNATIVE appear large due to the metadata,
>> > > depsite often
>> > > >> only being a handful of instructions.  asm inline() overrides the
>> > > estimation
>> > > >> to identify the block as being small.
>> > > >>
>> > > >> This has a substantial impact on inlining decisions, expected to be for
>> > > the
>> > > >> better given that the compiler has a more accurate picture to work
>> > > with.
>> > > >>
>> > > >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> > > > Hi Andrew,
>> > > >
>> > > > If we are going to use asm_inline, please add a note to
>> > > > docs/misra/C-language-toolchain.rst where we keep record of all the
>> > > > language extensions we use.
>> > >
>> > > It's just asm(), and that's already discussed.
>> > >
>> > > I'm not sure what else you think is warranted.
>> >
>> >
>> > If it is just asm() then there is nothing to do. We only need to
>> > document extensions to the language, nothing else. Many of them are
>> > already documented under docs/misra/C-language-toolchain.rst (see for
>> > instance asm and __asm__).
>> >
>> > I see the critical part of the patch for this question is:
>> >
>> > > +#if CONFIG_CC_HAS_ASM_INLINE
>> > > +# define asm_inline asm __inline
>> > > +#else
>> > > +# define asm_inline asm
>> > > +#endif
>> >
>> > it looks like __inline is an extension ?
>> 
>> I see. It was added to the tool configuration, but not there in the 
>> rst
>> (__inline__ as well), hence why there are no CI failures.
> 
> I see __inline__|__inline in toolchain.ecl. Nicola, would you be up for
> sending a small patch to docs/misra/C-language-toolchain.rst to add 
> them?

Yes, no problem. I'll take the occasion to see whether there are other 
gaps. Perhaps there's a clever way to ensure these files do not go out 
of sync?

-- 
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253


  reply	other threads:[~2025-04-22 20:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22 11:39 [PATCH] xen: Use asm inline when available for alternatives Andrew Cooper
2025-04-22 12:33 ` Frediano Ziglio
2025-04-22 12:52 ` Jan Beulich
2025-05-15 16:26   ` Andrew Cooper
2025-04-22 19:46 ` Stefano Stabellini
2025-04-22 19:53   ` Andrew Cooper
2025-04-22 19:58     ` Stefano Stabellini
2025-04-22 20:01       ` Nicola Vetrini
2025-04-22 20:02         ` Stefano Stabellini
2025-04-22 20:08           ` Nicola Vetrini [this message]
2025-04-22 20:12             ` Stefano Stabellini
2025-04-22 20:03       ` Andrew Cooper

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=60e776075c8861f825ef2589b9053792@bugseng.com \
    --to=nicola.vetrini@bugseng.com \
    --cc=JBeulich@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --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.