[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c6bb7d4-59bf-4887-8a0a-03373d3d9c11@suse.com>
Date: Tue, 20 Feb 2024 16:28:23 +0100
From: Petr Pavlu <petr.pavlu@...e.com>
To: Mark Rutland <mark.rutland@....com>
Cc: masahiroy@...nel.org, nathan@...nel.org, nicolas@...sle.eu,
linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] kbuild: Use -fmin-function-alignment when available
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@...e.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.
--
Thanks,
Petr
Powered by blists - more mailing lists