[PATCH] arm64: ftrace: forbid CALL_OPS with CC_OPTIMIZE_FOR_SIZE
Catalin Marinas
catalin.marinas at arm.com
Tue Feb 28 05:54:42 PST 2023
On Mon, 27 Feb 2023 11:58:19 +0000, Mark Rutland wrote:
> Florian reports that when building with CONFIG_CC_OPTIMIZE_FOR_SIZE=y,
> he sees "Misaligned patch-site" warnings at boot, e.g.
>
> | Misaligned patch-site bcm2836_arm_irqchip_handle_irq+0x0/0x88
> | WARNING: CPU: 0 PID: 0 at arch/arm64/kernel/ftrace.c:120 ftrace_call_adjust+0x4c/0x70
>
> This is because GCC will silently ignore `-falign-functions=N` when
> passed `-Os`, resulting in functions not being aligned as we expect.
> This is a known issue, and to account for this we modified the kernel to
> avoid `-Os` generally. Unfortunately we forgot to account for
> CONFIG_CC_OPTIMIZE_FOR_SIZE.
>
> [...]
Applied to arm64 (for-next/core), thanks!
[1/1] arm64: ftrace: forbid CALL_OPS with CC_OPTIMIZE_FOR_SIZE
https://git.kernel.org/arm64/c/b3f11af9b2ce
--
Catalin
More information about the linux-arm-kernel
mailing list