linux/arch
Kees Cook f8d55c912e arm64: Handle KCOV __init vs inline mismatches
[ Upstream commit 65c430906e ]

GCC appears to have kind of fragile inlining heuristics, in the
sense that it can change whether or not it inlines something based on
optimizations. It looks like the kcov instrumentation being added (or in
this case, removed) from a function changes the optimization results,
and some functions marked "inline" are _not_ inlined. In that case,
we end up with __init code calling a function not marked __init, and we
get the build warnings I'm trying to eliminate in the coming patch that
adds __no_sanitize_coverage to __init functions:

WARNING: modpost: vmlinux: section mismatch in reference: acpi_get_enable_method+0x1c (section: .text.unlikely) -> acpi_psci_present (section: .init.text)

This problem is somewhat fragile (though using either __always_inline
or __init will deterministically solve it), but we've tripped over
this before with GCC and the solution has usually been to just use
__always_inline and move on.

For arm64 this requires forcing one ACPI function to be inlined with
__always_inline.

Link: https://lore.kernel.org/r/20250724055029.3623499-1-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-08-28 16:24:16 +02:00
..
alpha sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
arc sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
arm ARM: dts: imx6ul-kontron-bl-common: Fix RTS polarity for RS485 interface 2025-08-28 16:24:06 +02:00
arm64 arm64: Handle KCOV __init vs inline mismatches 2025-08-28 16:24:16 +02:00
csky sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
h8300 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
hexagon sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
ia64 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
m68k m68k: Don't unregister boot console needlessly 2025-08-28 16:24:08 +02:00
microblaze sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
mips MIPS: mm: tlb-r4k: Uniquify TLB entries on init 2025-08-28 16:24:14 +02:00
nds32 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
nios2 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
openrisc sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
parisc sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
powerpc PCI: pnv_php: Fix surprise plug detection and recovery 2025-08-28 16:24:12 +02:00
riscv sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
s390 sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
sh sh: Do not use hyphen in exported variable name 2025-08-28 16:24:11 +02:00
sparc sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
um um: rtc: Avoid shadowing err in uml_rtc_start() 2025-08-28 16:24:08 +02:00
x86 x86/bugs: Fix use of possibly uninit value in amd_check_tsa_microcode() 2025-08-28 16:24:05 +02:00
xtensa sched: Add wrapper for get_wchan() to keep task blocked 2025-08-28 16:24:03 +02:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig cpu: Re-enable CPU mitigations by default for !X86 architectures 2024-05-02 16:24:48 +02:00