]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm: Handle KCOV __init vs inline mismatches
authorKees Cook <kees@kernel.org>
Thu, 17 Jul 2025 23:25:10 +0000 (16:25 -0700)
committerKees Cook <kees@kernel.org>
Tue, 22 Jul 2025 04:43:39 +0000 (21:43 -0700)
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>
arch/arm/mm/cache-feroceon-l2.c
arch/arm/mm/cache-tauros2.c
drivers/clocksource/timer-orion.c
drivers/soc/ti/pm33xx.c
include/linux/mfd/dbx500-prcmu.h

index 25dbd84a1aafa879c264acec59df9b0d262a1792..2bfefb252ffdd296d9ce30cd6a12b7db9caa53b3 100644 (file)
@@ -295,7 +295,7 @@ static inline u32 read_extra_features(void)
        return u;
 }
 
-static inline void write_extra_features(u32 u)
+static inline void __init write_extra_features(u32 u)
 {
        __asm__("mcr p15, 1, %0, c15, c1, 0" : : "r" (u));
 }
index b1e1aba602f7f9963f2983a9eb91a51178e97f4a..bfe166ccace057f86c0eccb6aeb22b30f1c48708 100644 (file)
@@ -177,7 +177,7 @@ static inline void __init write_actlr(u32 actlr)
        __asm__("mcr p15, 0, %0, c1, c0, 1\n" : : "r" (actlr));
 }
 
-static void enable_extra_feature(unsigned int features)
+static void __init enable_extra_feature(unsigned int features)
 {
        u32 u;
 
index 49e86cb70a7a8ea06b17104032321da7a270149f..61f1e27fc41e740d7f45f231dca3779cc04bb6b9 100644 (file)
@@ -43,7 +43,7 @@ static struct delay_timer orion_delay_timer = {
        .read_current_timer = orion_read_timer,
 };
 
-static void orion_delay_timer_init(unsigned long rate)
+static void __init orion_delay_timer_init(unsigned long rate)
 {
        orion_delay_timer.freq = rate;
        register_current_timer_delay(&orion_delay_timer);
index dfdff186c805c4437e5523ca87912bfe6bba1cd9..dc52a2197d249a4a0bbd8d7adc4d3e85a0a8dc86 100644 (file)
@@ -145,7 +145,7 @@ static int am33xx_do_sram_idle(u32 wfi_flags)
        return pm_ops->cpu_suspend(am33xx_do_wfi_sram, wfi_flags);
 }
 
-static int __init am43xx_map_gic(void)
+static int am43xx_map_gic(void)
 {
        gic_dist_base = ioremap(AM43XX_GIC_DIST_BASE, SZ_4K);
 
index 98567623c9df63373dbce924e28b343452dc67a9..828362b7860c6c4a6ca060f5ad4d8024944d8c9d 100644 (file)
@@ -213,7 +213,7 @@ struct prcmu_fw_version {
 
 #if defined(CONFIG_UX500_SOC_DB8500)
 
-static inline void prcmu_early_init(void)
+static inline void __init prcmu_early_init(void)
 {
        db8500_prcmu_early_init();
 }