Commit c64d6be1 authored by Kees Cook's avatar Kees Cook
Browse files

s390: 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
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: default avatarHeiko Carstens <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20250717232519.2984886-7-kees@kernel.org


Signed-off-by: default avatarKees Cook <kees@kernel.org>
parent 2424fe1c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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();
+1 −1
Original line number Diff line number Diff line
@@ -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();
+1 −1
Original line number Diff line number Diff line
@@ -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;