linux-loongson/arch/s390/hypfs/hypfs_diag.h
Kees Cook c64d6be1a6 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 <hca@linux.ibm.com>
Link: https://lore.kernel.org/r/20250717232519.2984886-7-kees@kernel.org
Signed-off-by: Kees Cook <kees@kernel.org>
2025-07-21 21:44:01 -07:00

36 lines
814 B
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Hypervisor filesystem for Linux on s390. Diag 204 and 224
* implementation.
*
* Copyright IBM Corp. 2006, 2008
* Author(s): Michael Holzheu <holzheu@de.ibm.com>
*/
#ifndef _S390_HYPFS_DIAG_H_
#define _S390_HYPFS_DIAG_H_
#include <asm/diag.h>
enum diag204_format diag204_get_info_type(void);
void *diag204_get_buffer(enum diag204_format fmt, int *pages);
int diag204_store(void *buf, int pages);
int __hypfs_diag_fs_init(void);
void __hypfs_diag_fs_exit(void);
static __always_inline int hypfs_diag_fs_init(void)
{
if (IS_ENABLED(CONFIG_S390_HYPFS_FS))
return __hypfs_diag_fs_init();
return 0;
}
static inline void hypfs_diag_fs_exit(void)
{
if (IS_ENABLED(CONFIG_S390_HYPFS_FS))
__hypfs_diag_fs_exit();
}
#endif /* _S390_HYPFS_DIAG_H_ */