From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02A8B25229D; Thu, 17 Jul 2025 23:25:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752794721; cv=none; b=drqsJPhNBUhM/7l3zFRwJg5suFCTkzaNDZVqa4F0fJ4FBthg4orWBnC8TwRSmvlv45pZ0rfV0pU0cz5V1F/h7qAXY+rM+HRorOOVKci2Ml5GEG4nNl7g+0VFMuz+vMKGq5VdNo4oFOvRSgVWZPfRtYC7o/tuKrpPmZUqY2O3M+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752794721; c=relaxed/simple; bh=ClXmyf5tYbBw+sj2/5CbB5OIJFvi5W3ekaTQ6nQnftI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iAXqPFY3QVyfVEn2rgAOO3A7YVrM39CH/QwrQ3Qs0IaFUOFXN4WgLXdln0GR+BOEpNBC1dAFjffIslTKk+bJKd/jHIs+5DI1fH5J6klg5/42nNKjJNykWiS/9b3vj7H5HDc7pSiJeuoY9iHOjhc+br9t1PIFAtHLzAnG3kGAsPc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rkHtSj4l; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rkHtSj4l" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71E24C116B1; Thu, 17 Jul 2025 23:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752794720; bh=ClXmyf5tYbBw+sj2/5CbB5OIJFvi5W3ekaTQ6nQnftI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rkHtSj4laX1uwxJb9+itmvRPgqj/a9zzxR6dZs4Rcw+Zv2wOFRy/Jlli8Sx5Lrc3O Mqxty6XZGkll/puwlIlPFh8MrhhtzDs0cP5iFaZYX9Yhb977fQ8919R6Ng1LwBxbXc XB1+ko2d4Fj5tbTCaZ0iGdJ88LXvmbN3xLk3FycYbr0IANV4iUfcSdApSDABHGQcu3 1xO4j6AL3ufiRwzjOs758tFgmoTRSohX9hFAnsx5uvmO4v5aHPFsYvgIxL3Xum7v0b 5PagtpHqQl2Rn4WnRM5u0ozPH67yHuAG46YTpaHeRRTtSJYlsnv5hqw9IA6Hp3QTPj jASKKjUdVM2Qg== From: Kees Cook To: Arnd Bergmann Cc: Kees Cook , Nishanth Menon , Russell King , Daniel Lezcano , Thomas Gleixner , Santosh Shilimkar , Lee Jones , Allison Randal , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, Ingo Molnar , "Gustavo A. R. Silva" , Christoph Hellwig , Andrey Konovalov , Andrey Ryabinin , Ard Biesheuvel , Masahiro Yamada , Nathan Chancellor , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kernel@vger.kernel.org, x86@kernel.org, kasan-dev@googlegroups.com, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-efi@vger.kernel.org, linux-hardening@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kselftest@vger.kernel.org, sparclinux@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH v3 05/13] arm: Handle KCOV __init vs inline mismatches Date: Thu, 17 Jul 2025 16:25:10 -0700 Message-Id: <20250717232519.2984886-5-kees@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250717231756.make.423-kees@kernel.org> References: <20250717231756.make.423-kees@kernel.org> Precedence: bulk X-Mailing-List: sparclinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3532; i=kees@kernel.org; h=from:subject; bh=ClXmyf5tYbBw+sj2/5CbB5OIJFvi5W3ekaTQ6nQnftI=; b=owGbwMvMwCVmps19z/KJym7G02pJDBmVbdHzv79/XV1xJstusdnUqKz7Z5dHlrE6aFlJyp1qZ dnzg2NTRykLgxgXg6yYIkuQnXuci8fb9nD3uYowc1iZQIYwcHEKwEReKTD8D5xT9f+GLcsH7/OS +p2zDZ+FrQrRdJgsff/Ac9fi4/Fb0xn+p9lw+6n86zbZmHZD0rOutDS+/8HNzd1tb3IiBPnKK6Y zAwA= X-Developer-Key: i=kees@kernel.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Kees Cook --- Cc: Russell King Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: Nishanth Menon Cc: Santosh Shilimkar Cc: Lee Jones Cc: Allison Randal Cc: Greg Kroah-Hartman Cc: --- include/linux/mfd/dbx500-prcmu.h | 2 +- arch/arm/mm/cache-feroceon-l2.c | 2 +- arch/arm/mm/cache-tauros2.c | 2 +- drivers/clocksource/timer-orion.c | 2 +- drivers/soc/ti/pm33xx.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index 98567623c9df..828362b7860c 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h @@ -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(); } diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c index 25dbd84a1aaf..2bfefb252ffd 100644 --- a/arch/arm/mm/cache-feroceon-l2.c +++ b/arch/arm/mm/cache-feroceon-l2.c @@ -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)); } diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c index b1e1aba602f7..bfe166ccace0 100644 --- a/arch/arm/mm/cache-tauros2.c +++ b/arch/arm/mm/cache-tauros2.c @@ -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; diff --git a/drivers/clocksource/timer-orion.c b/drivers/clocksource/timer-orion.c index 49e86cb70a7a..61f1e27fc41e 100644 --- a/drivers/clocksource/timer-orion.c +++ b/drivers/clocksource/timer-orion.c @@ -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); diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c index dfdff186c805..dc52a2197d24 100644 --- a/drivers/soc/ti/pm33xx.c +++ b/drivers/soc/ti/pm33xx.c @@ -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); -- 2.34.1