Re: [PATCH] s390/irqflags: add out-of-line definitions of arch_local_irq_*() for KMSAN
From: Heiko Carstens
Date: Thu Aug 06 2026 - 06:19:32 EST
On Thu, Aug 06, 2026 at 12:00:19PM +0200, Ilya Leoshkevich wrote:
> Inline KMSAN arch_local_irq_*() definitions run afoul of
> -Wstatic-in-inline. Move them out-of-line. Decompressor is not
> instrumented, so make sure it keeps using inline definitions.
> Make sure non-GPL modules see the out-of-line definitions.
>
> Cc: Boqun Feng <boqun@xxxxxxxxxx>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202607131219.euJHPSJ5-lkp@xxxxxxxxx/
> Suggested-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
> Fixes: 1b301f5f28ba ("s390/irqflags: do not instrument arch_local_irq_*() with KMSAN")
> Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
> ---
> arch/s390/include/asm/irqflags.h | 20 +++++++++++++-------
> arch/s390/kernel/Makefile | 1 +
> arch/s390/kernel/irqflags.c | 27 +++++++++++++++++++++++++++
> 3 files changed, 41 insertions(+), 7 deletions(-)
> create mode 100644 arch/s390/kernel/irqflags.c
Don't we have the very same problem in arch/s390/include/asm/uaccess.h
with uaccess_kmsan_or_inline too?
> -#ifdef CONFIG_KMSAN
> -#define arch_local_irq_attributes noinline notrace __no_sanitize_memory __maybe_unused
> +#if defined(CONFIG_KMSAN) && !defined(__DECOMPRESSOR)
> +extern unsigned long arch_local_save_flags(void);
> +extern unsigned long arch_local_irq_save(void);
> +extern void arch_local_irq_enable_external(void);
> +extern void arch_local_irq_enable(void);
FWIW, we go without "extern" for function prototypes.
> #else
> -#define arch_local_irq_attributes __always_inline
> +#define arch_local_save_flags __arch_local_save_flags
> +#define arch_local_irq_save __arch_local_irq_save
> +#define arch_local_irq_enable_external __arch_local_irq_enable_external
> +#define arch_local_irq_enable __arch_local_irq_enable
> #endif
For the sake of readability: could you adjust all of them with tabs?
Like e.g.:
#define arch_local_save_flags __arch_local_save_flags
#define arch_local_irq_save __arch_local_irq_save
#define arch_local_irq_enable_external __arch_local_irq_enable_external
#define arch_local_irq_enable __arch_local_irq_enable
And just to annoy you: the patch subject needs to be adjusted to:
s390/irqflags: add out-of-line definitions of arch_local_irq_*() for KMSAN
^
In the meantime we require always an upper case letter following the
component.
> +++ b/arch/s390/kernel/irqflags.c
> @@ -0,0 +1,27 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include <asm/irqflags.h>
> +#include <linux/export.h>
Please add an empty line before the first include, and also change the order
of includes - "linux" should always come before "asm".