From: Mark Rutland <mark.rutland@arm.com>
To: Petr Pavlu <petr.pavlu@suse.com>
Cc: masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] kbuild: Use -fmin-function-alignment when available
Date: Wed, 21 Feb 2024 10:50:59 +0000 [thread overview]
Message-ID: <ZdXVk41lSMLx_Fmg@FVFF77S0Q05N> (raw)
In-Reply-To: <1c6bb7d4-59bf-4887-8a0a-03373d3d9c11@suse.com>
On Tue, Feb 20, 2024 at 04:28:23PM +0100, Petr Pavlu wrote:
> On 2/19/24 18:20, Mark Rutland wrote:
> > On Thu, Feb 15, 2024 at 04:16:42PM +0100, Petr Pavlu wrote:
> >> GCC recently added option -fmin-function-alignment, which should appear
> >> in GCC 14. Unlike -falign-functions, this option causes all functions to
> >> be aligned at the specified value, including the cold ones.
> >>
> >> Detect availability of -fmin-function-alignment and use it instead of
> >> -falign-functions when present. Introduce CC_HAS_SANE_FUNCTION_ALIGNMENT
> >> and make the workarounds for the broken function alignment conditional
> >> on this setting.
> >>
> >> Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
> >
> > I don't have a GCC 14 build to play with, but this looks sound to me.
> >
> > Petr, are you able to test an arm64 kernel with this and DYNAMIC_FTRACE
> > enabled? i.e. build that, and check that function symbols are all aligned to 8
> > bytes using objdump or similar? That way we could be pretty sure there's no
> > other latent issue in this area.
>
> I tested an arm64 kernel with DYNAMIC_FTRACE, in particular with
> DYNAMIC_FTRACE_WITH_CALL_OPS=y. That is actually the primary motivation
> for this patch. We ran in our environment into some incorrectly aligned
> functions with this option despite the kernel workarounds. They were
> reported as "Misaligned patch-site" warnings from ftrace_call_adjust().
> I don't observe them anymore with -fmin-function-alignment in my tests.
> Sorry, I should have mentioned this motivation in the commit message.
No problem; thanks for confirming!
Mark.
next prev parent reply other threads:[~2024-02-21 10:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-15 15:16 [PATCH v2] kbuild: Use -fmin-function-alignment when available Petr Pavlu
2024-02-17 0:07 ` Nathan Chancellor
2024-02-19 17:20 ` Mark Rutland
2024-02-20 15:28 ` Petr Pavlu
2024-02-21 10:50 ` Mark Rutland [this message]
2024-02-20 13:39 ` Masahiro Yamada
2024-02-21 10:38 ` Petr Pavlu
2024-02-21 10:49 ` Mark Rutland
2024-02-21 11:38 ` Masahiro Yamada
2024-02-21 12:58 ` Petr Pavlu
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=ZdXVk41lSMLx_Fmg@FVFF77S0Q05N \
--to=mark.rutland@arm.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
--cc=petr.pavlu@suse.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox