All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: 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 21:03:55 +0100	[thread overview]
Message-ID: <34ef06c8-cb13-4078-bd39-ad176edfaae7@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2504221256080.785180@ubuntu-linux-20-04-desktop>

On 22/04/2025 8:58 pm, 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 ?

That's just inline.  (It's an alternative spelling, and we discuss those
too.)

The reason it's not plain "asm inline" is because of the (deviated)
"#define inline inline __init", where an eventual "asm inline __init
(..." is a syntax error.

~Andrew


      parent reply	other threads:[~2025-04-22 20:04 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
2025-04-22 20:12             ` Stefano Stabellini
2025-04-22 20:03       ` Andrew Cooper [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=34ef06c8-cb13-4078-bd39-ad176edfaae7@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=Volodymyr_Babchuk@epam.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.