Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Alexander Potapenko <glider@google.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Tejun Heo <tj@kernel.org>, Dennis Zhou <dennis@kernel.org>,
	Christoph Lameter <cl@gentwo.org>,
	kasan-dev@googlegroups.com, linux-mm@kvack.org
Subject: Re: [PATCH v2 2/6] arm64: entry: Always inline helpers used by non-instrumentable paths
Date: Tue, 10 Nov 2026 21:03:31 +0800	[thread overview]
Message-ID: <avMWI5makxfDNJXD@xhacker> (raw)
In-Reply-To: <sashiko-outbox-206977@kernel.org>

On Tue, Nov 10, 2026 at 12:05:42PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Low] arm64: entry: missing __always_inline on !CONFIG_ARM64_SME stubs
>   in fpsimd.h
> --
> 
> commit ed5f3b4320afc347aa0402f3b75096047a676bff
> Author: Jisheng Zhang <jszhang@kernel.org>
> 
> arm64: entry: Always inline helpers used by non-instrumentable paths
> 
> This commit marks MTE, SME, CPU feature, and rescheduling helpers called
> from noinstr entry and exit paths as __always_inline, and updates the SME
> entry and exit helpers to use tif_test_bit(TIF_SME).
> 
> > diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h
> > index a67d5774e6728..e7c881c1c1f79 100644
> > --- a/arch/arm64/include/asm/fpsimd.h
> > +++ b/arch/arm64/include/asm/fpsimd.h
> > @@ -749,17 +749,17 @@ void sme_enable_dvmsync(void);
> >  void sme_set_active(void);
> >  void sme_clear_active(void);
> >  
> > -static inline void sme_enter_from_user_mode(void)
> > +static __always_inline void sme_enter_from_user_mode(void)
> >  {
> >  	if (alternative_has_cap_unlikely(ARM64_WORKAROUND_4193714) &&
> > -	    test_thread_flag(TIF_SME))
> > +	    tif_test_bit(TIF_SME))
> >  		sme_clear_active();
> >  }
> >  
> > -static inline void sme_exit_to_user_mode(void)
> > +static __always_inline void sme_exit_to_user_mode(void)
> >  {
> >  	if (alternative_has_cap_unlikely(ARM64_WORKAROUND_4193714) &&
> > -	    test_thread_flag(TIF_SME))
> > +	    tif_test_bit(TIF_SME))
> >  		sme_set_active();
> >  }
> 
> [Severity: Low]
> Should the !CONFIG_ARM64_SME stubs for sme_enter_from_user_mode() and
> sme_exit_to_user_mode() in the #else branch below also use
> __always_inline, matching the !CONFIG_KASAN_HW_TAGS stubs updated in
> mte.h and mte-kasan.h?

I think this is false alarm because the #else branch is null function,
any compiler will inline them even when -Os, but if maintainers wants
__always_inline as well for #else branch, kindly comment I will update
them.


  reply	other threads:[~2026-11-10 13:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09 11:44 [PATCH v2 0/6] arm64: Fix instrumentation escapes from noinstr path Jisheng Zhang
2026-11-09 11:44 ` [PATCH v2 1/6] arm64: percpu: Always inline helpers used by noinstr code Jisheng Zhang
2026-11-09 11:44 ` [PATCH v2 2/6] arm64: entry: Always inline helpers used by non-instrumentable paths Jisheng Zhang
2026-11-10 12:05   ` sashiko-bot
2026-11-10 13:03     ` Jisheng Zhang [this message]
2026-11-09 11:44 ` [PATCH v2 3/6] kasan: Always inline kasan_hw_tags_enabled() Jisheng Zhang
2026-11-09 11:44 ` [PATCH v2 4/6] arm64: stacktrace: Always inline internal stack boundary helpers Jisheng Zhang
2026-11-09 11:44 ` [PATCH v2 5/6] arm64: lib: Disable branch profiling for architecture library code Jisheng Zhang
2026-11-09 11:44 ` [PATCH v2 6/6] arm64: alternatives: Make branch and ADRP offset helpers noinst Jisheng Zhang

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=avMWI5makxfDNJXD@xhacker \
    --to=jszhang@kernel.org \
    --cc=andreyknvl@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=cl@gentwo.org \
    --cc=dennis@kernel.org \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-mm@kvack.org \
    --cc=mark.rutland@arm.com \
    --cc=ryabinin.a.a@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tj@kernel.org \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@kernel.org \
    /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