Thread (10 messages) 10 messages, 4 authors, 2025-07-22

Re: [PATCH v3 04/13] x86: Handle KCOV __init vs inline mismatches

From: Mike Rapoport <rppt@kernel.org>
Date: 2025-07-18 08:36:53
Also in: kvm, kvmarm, linux-acpi, linux-doc, linux-efi, linux-hardening, linux-kbuild, linux-kselftest, linux-mm, linux-riscv, linux-s390, linux-security-module, lkml, llvm, platform-driver-x86, sparclinux

Hi Kees,

On Thu, Jul 17, 2025 at 04:25:09PM -0700, Kees Cook wrote:
When KCOV is enabled all functions get instrumented, unless the
__no_sanitize_coverage attribute is used. To prepare for
__no_sanitize_coverage being applied to __init functions, we have to
handle differences in how GCC's inline optimizations get resolved. For
x86 this means forcing several functions to be inline with
__always_inline.

Signed-off-by: Kees Cook <kees@kernel.org>
...
quoted hunk ↗ jump to hunk
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index bb19a2534224..b96746376e17 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -463,7 +463,7 @@ static inline void *memblock_alloc_raw(phys_addr_t size,
 					  NUMA_NO_NODE);
 }
 
-static inline void *memblock_alloc_from(phys_addr_t size,
+static __always_inline void *memblock_alloc_from(phys_addr_t size,
 						phys_addr_t align,
 						phys_addr_t min_addr)
I'm curious why from all memblock_alloc* wrappers this is the only one that
needs to be __always_inline?

-- 
Sincerely yours,
Mike.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help