From: sashiko-bot@kernel.org
To: "Ilya Leoshkevich" <iii@linux.ibm.com>
Cc: "Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>,
linux-s390@vger.kernel.org
Subject: Re: [PATCH] s390/irqflags: add out-of-line definitions of arch_local_irq_*() for KMSAN
Date: Thu, 06 Aug 2026 10:19:30 +0000 [thread overview]
Message-ID: <20260806101931.53AC31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260806100038.3163298-1-iii@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing KMSAN attributes on the `extern` declarations of `arch_local_save_flags` and `arch_local_irq_save` will cause spurious use-of-uninitialized-value reports.
--
--- Patch [1]: [PATCH] s390/irqflags: add out-of-line definitions of arch_local_irq_*() for KMSAN ---
commit 75ac5ab83800e65155075aeee91b3fd23aa6274d
Author: Ilya Leoshkevich <iii@linux.ibm.com>
s390/irqflags: add out-of-line definitions of arch_local_irq_*() for KMSAN
This commit moves KMSAN arch_local_irq_*() definitions out-of-line to avoid
warnings about static functions in inline functions. Uninstrumented
decompressor code keeps the inline definitions, while non-GPL modules see
the out-of-line versions.
Closes: https://lore.kernel.org/oe-kbuild-all/202607131219.euJHPSJ5-lkp@intel.com/
> diff --git a/arch/s390/include/asm/irqflags.h b/arch/s390/include/asm/irqflags.h
> index bcab456dfb803..44d158f7831e6 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)
> +extern unsigned long arch_local_save_flags(void);
> +extern unsigned long arch_local_irq_save(void);
[Severity: High]
Since these extern declarations lack KMSAN attributes, will instrumented
callers expect a populated return value shadow in __msan_retval_tls?
When arch_local_save_flags() and arch_local_irq_save() are called from
instrumented code, the caller reads __msan_retval_tls. However, because the
corresponding definitions are marked noinstr:
arch/s390/kernel/irqflags.c:
noinstr unsigned long arch_local_save_flags(void)
{
return __arch_local_save_flags();
}
instrumentation is skipped, and __msan_retval_tls is never populated before
returning to the caller.
Could this result in spurious use-of-uninitialized-value reports on every
IRQ state check or lock operation (like spin_lock_irqsave) when the kernel
is built with CONFIG_KMSAN?
> +extern void arch_local_irq_enable_external(void);
> +extern 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
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260806100038.3163298-1-iii@linux.ibm.com?part=1
next prev parent reply other threads:[~2026-08-06 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 10:00 [PATCH] s390/irqflags: add out-of-line definitions of arch_local_irq_*() for KMSAN Ilya Leoshkevich
2026-08-06 10:17 ` Heiko Carstens
2026-08-06 18:41 ` Ilya Leoshkevich
2026-08-06 10:19 ` sashiko-bot [this message]
2026-08-06 18:38 ` Ilya Leoshkevich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260806101931.53AC31F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).