Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm: Handle KCOV __init vs inline mismatches

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
arm this exposed several places where __init annotations were missing
but ended up being "accidentally correct". Fix these cases and force
several functions to be inline with __always_inline.

Acked-by: Nishanth Menon <nm@ti.com>
Acked-by: Lee Jones <lee@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20250717232519.2984886-5-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>

Kees Cook 2424fe1c d01daf9d

+5 -5
+1 -1
arch/arm/mm/cache-feroceon-l2.c
··· 295 295 return u; 296 296 } 297 297 298 - static inline void write_extra_features(u32 u) 298 + static inline void __init write_extra_features(u32 u) 299 299 { 300 300 __asm__("mcr p15, 1, %0, c15, c1, 0" : : "r" (u)); 301 301 }
+1 -1
arch/arm/mm/cache-tauros2.c
··· 177 177 __asm__("mcr p15, 0, %0, c1, c0, 1\n" : : "r" (actlr)); 178 178 } 179 179 180 - static void enable_extra_feature(unsigned int features) 180 + static void __init enable_extra_feature(unsigned int features) 181 181 { 182 182 u32 u; 183 183
+1 -1
drivers/clocksource/timer-orion.c
··· 43 43 .read_current_timer = orion_read_timer, 44 44 }; 45 45 46 - static void orion_delay_timer_init(unsigned long rate) 46 + static void __init orion_delay_timer_init(unsigned long rate) 47 47 { 48 48 orion_delay_timer.freq = rate; 49 49 register_current_timer_delay(&orion_delay_timer);
+1 -1
drivers/soc/ti/pm33xx.c
··· 145 145 return pm_ops->cpu_suspend(am33xx_do_wfi_sram, wfi_flags); 146 146 } 147 147 148 - static int __init am43xx_map_gic(void) 148 + static int am43xx_map_gic(void) 149 149 { 150 150 gic_dist_base = ioremap(AM43XX_GIC_DIST_BASE, SZ_4K); 151 151
+1 -1
include/linux/mfd/dbx500-prcmu.h
··· 213 213 214 214 #if defined(CONFIG_UX500_SOC_DB8500) 215 215 216 - static inline void prcmu_early_init(void) 216 + static inline void __init prcmu_early_init(void) 217 217 { 218 218 db8500_prcmu_early_init(); 219 219 }