linux/arch
Kees Cook 39c970e153 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:25:51 +02:00
..
alpha alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support 2025-03-28 21:58:51 +01:00
arc ARC: build: Try to guess GCC variant of cross compiler 2025-01-09 13:30:05 +01:00
arm crypto: arm/aes-neonbs - work around gcc-15 warning 2025-08-15 12:05:01 +02:00
arm64 arm64: Handle KCOV __init vs inline mismatches 2025-08-28 16:25:51 +02:00
csky mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
hexagon hexagon: Fix unbalanced spinlock in die() 2025-02-21 13:49:25 +01:00
ia64 mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
loongarch LoongArch: BPF: Fix jump offset calculation in tailcall 2025-08-28 16:25:49 +02:00
m68k m68k: Don't unregister boot console needlessly 2025-08-15 12:04:57 +02:00
microblaze microblaze: Export xmb_manager functions 2024-12-14 19:53:20 +01:00
mips MIPS: mm: tlb-r4k: Uniquify TLB entries on init 2025-08-15 12:05:13 +02:00
nios2 mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
openrisc mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
parisc parisc: fix building with gcc-15 2025-06-27 11:07:29 +01:00
powerpc PCI: pnv_php: Fix surprise plug detection and recovery 2025-08-15 12:05:08 +02:00
riscv RISC-V: KVM: Don't treat SBI HFENCE calls as NOPs 2025-06-27 11:07:41 +01:00
s390 s390/pci: Do not try re-enabling load/store if device is disabled 2025-07-10 15:59:43 +02:00
sh sh: Do not use hyphen in exported variable name 2025-08-15 12:05:04 +02:00
sparc sparc/mm: disable preemption in lazy mmu mode 2025-04-25 10:43:42 +02:00
um um: rtc: Avoid shadowing err in uml_rtc_start() 2025-08-15 12:04:58 +02:00
x86 KVM: VMX: Preserve host's DEBUGCTLMSR_FREEZE_IN_SMM while running the guest 2025-08-28 16:25:50 +02:00
xtensa mm: remove kern_addr_valid() completely 2024-11-08 16:26:39 +01:00
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Kconfig Revert "mm: mmap: allow for the maximum number of bits for randomizing mmap_base by default" 2024-06-27 13:46:24 +02:00