From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Michal Orzel" <michal.orzel@amd.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] xen: Use asm inline when available for alternatives
Date: Tue, 22 Apr 2025 14:52:35 +0200 [thread overview]
Message-ID: <9990d438-6ebf-4308-89f5-ecacf04ea89b@suse.com> (raw)
In-Reply-To: <20250422113957.1289290-1-andrew.cooper3@citrix.com>
On 22.04.2025 13:39, 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>
So this is effectively a generalized version of
https://lists.xen.org/archives/html/xen-devel/2022-08/msg00712.html
with ...
> --- a/xen/Kconfig
> +++ b/xen/Kconfig
> @@ -29,6 +29,10 @@ config LD_IS_GNU
> config LD_IS_LLVM
> def_bool $(success,$(LD) --version | head -n 1 | grep -q "^LLD")
>
> +config CC_HAS_ASM_INLINE
> + # GCC >= 9, Clang >= 11
> + def_bool $(success,echo 'void foo(void) { asm inline (""); }' | $(CC) -x c - -c -o /dev/null)
... detection once again done in Kconfig (only). I don't think I had any
feedback there; I'm hence having a hard time seeing why I should now like
this any better than mine was liked.
In any event it's clearly increasingly necessary that we finally get the
detection aspect settled.
Jan
next prev parent reply other threads:[~2025-04-22 12:52 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 [this message]
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
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=9990d438-6ebf-4308-89f5-ecacf04ea89b@suse.com \
--to=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.