* [PATCH v2] s390/irqflags: Add out-of-line definitions of arch_local_irq_*() for KMSAN
@ 2026-08-06 19:04 Ilya Leoshkevich
2026-08-06 19:14 ` sashiko-bot
2026-08-07 12:28 ` Heiko Carstens
0 siblings, 2 replies; 3+ messages in thread
From: Ilya Leoshkevich @ 2026-08-06 19:04 UTC (permalink / raw)
To: Heiko Carstens, Vasily Gorbik, Alexander Gordeev
Cc: Alexander Potapenko, linux-s390, linux-kernel, Ilya Leoshkevich,
Boqun Feng, kernel test robot
Inline KMSAN arch_local_irq_*() definitions run afoul of
-Wstatic-in-inline. Move them out-of-line. Make sure decompressor and
non-GPL modules see the out-of-line definitions.
Cc: Boqun Feng <boqun@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202607131219.euJHPSJ5-lkp@intel.com/
Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Fixes: 1b301f5f28ba ("s390/irqflags: do not instrument arch_local_irq_*() with KMSAN")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
v1: https://lore.kernel.org/lkml/20260806101740.15764C97-hca@linux.ibm.com/
v1 -> v2: Fix style issues (Heiko).
arch/s390/include/asm/irqflags.h | 20 +++++++++++++-------
arch/s390/kernel/Makefile | 1 +
arch/s390/kernel/irqflags.c | 28 ++++++++++++++++++++++++++++
3 files changed, 42 insertions(+), 7 deletions(-)
create mode 100644 arch/s390/kernel/irqflags.c
diff --git a/arch/s390/include/asm/irqflags.h b/arch/s390/include/asm/irqflags.h
index bcab456dfb803..6eb6de6a99f2d 100644
--- a/arch/s390/include/asm/irqflags.h
+++ b/arch/s390/include/asm/irqflags.h
@@ -37,18 +37,24 @@ static __always_inline void __arch_local_irq_ssm(unsigned long flags)
asm volatile("ssm %0" : : "Q" (flags) : "memory");
}
-#ifdef CONFIG_KMSAN
-#define arch_local_irq_attributes noinline notrace __no_sanitize_memory __maybe_unused
+#if defined(CONFIG_KMSAN) && !defined(__DECOMPRESSOR)
+unsigned long arch_local_save_flags(void);
+unsigned long arch_local_irq_save(void);
+void arch_local_irq_enable_external(void);
+void arch_local_irq_enable(void);
#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
-static arch_local_irq_attributes unsigned long arch_local_save_flags(void)
+static __always_inline unsigned long __arch_local_save_flags(void)
{
return __arch_local_irq_stnsm(0xff);
}
-static arch_local_irq_attributes unsigned long arch_local_irq_save(void)
+static __always_inline unsigned long __arch_local_irq_save(void)
{
return __arch_local_irq_stnsm(0xfc);
}
@@ -58,12 +64,12 @@ static __always_inline void arch_local_irq_disable(void)
arch_local_irq_save();
}
-static arch_local_irq_attributes void arch_local_irq_enable_external(void)
+static __always_inline void __arch_local_irq_enable_external(void)
{
__arch_local_irq_stosm(0x01);
}
-static arch_local_irq_attributes void arch_local_irq_enable(void)
+static __always_inline void __arch_local_irq_enable(void)
{
__arch_local_irq_stosm(0x03);
}
diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 6c88476d79a31..14ef03cb2f72a 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -72,6 +72,7 @@ obj-$(CONFIG_STACKPROTECTOR) += stackprotector.o
obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o
obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o
obj-$(CONFIG_CERT_STORE) += cert_store.o
+obj-$(CONFIG_KMSAN) += irqflags.o
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf.o perf_cpum_sf.o
diff --git a/arch/s390/kernel/irqflags.c b/arch/s390/kernel/irqflags.c
new file mode 100644
index 0000000000000..e192f59f8918c
--- /dev/null
+++ b/arch/s390/kernel/irqflags.c
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/export.h>
+#include <asm/irqflags.h>
+
+noinstr unsigned long arch_local_save_flags(void)
+{
+ return __arch_local_save_flags();
+}
+EXPORT_SYMBOL(arch_local_save_flags);
+
+noinstr unsigned long arch_local_irq_save(void)
+{
+ return __arch_local_irq_save();
+}
+EXPORT_SYMBOL(arch_local_irq_save);
+
+noinstr void arch_local_irq_enable_external(void)
+{
+ __arch_local_irq_enable_external();
+}
+EXPORT_SYMBOL(arch_local_irq_enable_external);
+
+noinstr void arch_local_irq_enable(void)
+{
+ __arch_local_irq_enable();
+}
+EXPORT_SYMBOL(arch_local_irq_enable);
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] s390/irqflags: Add out-of-line definitions of arch_local_irq_*() for KMSAN
2026-08-06 19:04 [PATCH v2] s390/irqflags: Add out-of-line definitions of arch_local_irq_*() for KMSAN Ilya Leoshkevich
@ 2026-08-06 19:14 ` sashiko-bot
2026-08-07 12:28 ` Heiko Carstens
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-08-06 19:14 UTC (permalink / raw)
To: Ilya Leoshkevich
Cc: Heiko Carstens, Alexander Gordeev, Vasily Gorbik, linux-s390
> Inline KMSAN arch_local_irq_*() definitions run afoul of
> -Wstatic-in-inline. Move them out-of-line. Make sure decompressor and
> non-GPL modules see the out-of-line definitions.
>
> Cc: Boqun Feng <boqun@kernel.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202607131219.euJHPSJ5-lkp@intel.com/
> Suggested-by: Heiko Carstens <hca@linux.ibm.com>
> Fixes: 1b301f5f28ba ("s390/irqflags: do not instrument arch_local_irq_*() with KMSAN")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260806190500.3293578-1-iii@linux.ibm.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] s390/irqflags: Add out-of-line definitions of arch_local_irq_*() for KMSAN
2026-08-06 19:04 [PATCH v2] s390/irqflags: Add out-of-line definitions of arch_local_irq_*() for KMSAN Ilya Leoshkevich
2026-08-06 19:14 ` sashiko-bot
@ 2026-08-07 12:28 ` Heiko Carstens
1 sibling, 0 replies; 3+ messages in thread
From: Heiko Carstens @ 2026-08-07 12:28 UTC (permalink / raw)
To: Ilya Leoshkevich
Cc: Vasily Gorbik, Alexander Gordeev, Alexander Potapenko, linux-s390,
linux-kernel, Boqun Feng, kernel test robot
On Thu, Aug 06, 2026 at 09:04:45PM +0200, Ilya Leoshkevich wrote:
> Inline KMSAN arch_local_irq_*() definitions run afoul of
> -Wstatic-in-inline. Move them out-of-line. Make sure decompressor and
> non-GPL modules see the out-of-line definitions.
>
> Cc: Boqun Feng <boqun@kernel.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202607131219.euJHPSJ5-lkp@intel.com/
> Suggested-by: Heiko Carstens <hca@linux.ibm.com>
> Fixes: 1b301f5f28ba ("s390/irqflags: do not instrument arch_local_irq_*() with KMSAN")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>
> v1: https://lore.kernel.org/lkml/20260806101740.15764C97-hca@linux.ibm.com/
> v1 -> v2: Fix style issues (Heiko).
>
> arch/s390/include/asm/irqflags.h | 20 +++++++++++++-------
> arch/s390/kernel/Makefile | 1 +
> arch/s390/kernel/irqflags.c | 28 ++++++++++++++++++++++++++++
> 3 files changed, 42 insertions(+), 7 deletions(-)
> create mode 100644 arch/s390/kernel/irqflags.c
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-07 12:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-06 19:04 [PATCH v2] s390/irqflags: Add out-of-line definitions of arch_local_irq_*() for KMSAN Ilya Leoshkevich
2026-08-06 19:14 ` sashiko-bot
2026-08-07 12:28 ` Heiko Carstens
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox