]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390: Handle KCOV __init vs inline mismatches
authorKees Cook <kees@kernel.org>
Thu, 17 Jul 2025 23:25:12 +0000 (16:25 -0700)
committerKees Cook <kees@kernel.org>
Tue, 22 Jul 2025 04:44:01 +0000 (21:44 -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
s390 this exposed a place where the __init annotation was missing but
ended up being "accidentally correct". Fix this cases and force a couple
functions to be inline with __always_inline.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20250717232519.2984886-7-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
arch/s390/hypfs/hypfs.h
arch/s390/hypfs/hypfs_diag.h
arch/s390/mm/init.c

index 83ebf54cca6b0f8f0748f67af385484e296dcac6..4dc2e068e0ff56b05cc8f19054ee09f99af5d4e7 100644 (file)
@@ -48,7 +48,7 @@ void hypfs_sprp_exit(void);
 
 int __hypfs_fs_init(void);
 
-static inline int hypfs_fs_init(void)
+static __always_inline int hypfs_fs_init(void)
 {
        if (IS_ENABLED(CONFIG_S390_HYPFS_FS))
                return __hypfs_fs_init();
index 7090eff27fefaf057bf6c8b4324e52eef6fa1f5d..b5218135b8fea79b0f52590a66333b27443de2aa 100644 (file)
@@ -19,7 +19,7 @@ int diag204_store(void *buf, int pages);
 int __hypfs_diag_fs_init(void);
 void __hypfs_diag_fs_exit(void);
 
-static inline int hypfs_diag_fs_init(void)
+static __always_inline int hypfs_diag_fs_init(void)
 {
        if (IS_ENABLED(CONFIG_S390_HYPFS_FS))
                return __hypfs_diag_fs_init();
index 074bf4fb4ce2a7a738fe844fbabaeaea96b8aff6..e4953453d254840a8b56e7267f32a172e5e1d2e7 100644 (file)
@@ -142,7 +142,7 @@ bool force_dma_unencrypted(struct device *dev)
 }
 
 /* protected virtualization */
-static void pv_init(void)
+static void __init pv_init(void)
 {
        if (!is_prot_virt_guest())
                return;