Skip to content

Commit c64d6be

Browse files
committed
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: Heiko Carstens <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
1 parent 2424fe1 commit c64d6be

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

arch/s390/hypfs/hypfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void hypfs_sprp_exit(void);
4848

4949
int __hypfs_fs_init(void);
5050

51-
static inline int hypfs_fs_init(void)
51+
static __always_inline int hypfs_fs_init(void)
5252
{
5353
if (IS_ENABLED(CONFIG_S390_HYPFS_FS))
5454
return __hypfs_fs_init();

arch/s390/hypfs/hypfs_diag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int diag204_store(void *buf, int pages);
1919
int __hypfs_diag_fs_init(void);
2020
void __hypfs_diag_fs_exit(void);
2121

22-
static inline int hypfs_diag_fs_init(void)
22+
static __always_inline int hypfs_diag_fs_init(void)
2323
{
2424
if (IS_ENABLED(CONFIG_S390_HYPFS_FS))
2525
return __hypfs_diag_fs_init();

arch/s390/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ bool force_dma_unencrypted(struct device *dev)
142142
}
143143

144144
/* protected virtualization */
145-
static void pv_init(void)
145+
static void __init pv_init(void)
146146
{
147147
if (!is_prot_virt_guest())
148148
return;

0 commit comments

Comments
 (0)