All of 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 1/4] arm64: percpu: Always inline helpers used by noinstr code
Date: Mon, 9 Nov 2026 12:39:25 +0800	[thread overview]
Message-ID: <avFOfUZFBqTzrT4X@xhacker> (raw)
In-Reply-To: <sashiko-outbox-203633@kernel.org>

On Sun, Nov 08, 2026 at 07:43:56AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [Low] arm64: percpu: __PERCPU_OP_CASE() and sibling helpers not marked
>   __always_inline
> --
> 
> commit 3a2df0916b5200b227df21487897e171275b29f4
> Author: Jisheng Zhang <jszhang@kernel.org>
> 
> arm64: percpu: Always inline helpers used by noinstr code
> 
> This commit marks __hyp_my_cpu_offset(), __kern_my_cpu_offset(), and
> __percpu_read_##sz() as __always_inline so they are not emitted out of line
> when called from non-instrumentable code.
> 
> > diff --git a/arch/arm64/include/asm/percpu.h b/arch/arm64/include/asm/percpu.h
> > index 3cc316091d665..7c344de5052d5 100644
> > --- a/arch/arm64/include/asm/percpu.h
> > +++ b/arch/arm64/include/asm/percpu.h
> 
> [ ... ]
> 
> > @@ -129,7 +129,7 @@ static inline unsigned long __kern_my_cpu_offset(void)
> >  #endif
> >  
> >  #define PERCPU_RW_OPS(w, sfx, sz)						\
> > -static inline unsigned long __percpu_read_##sz(void __percpu *pcp)		\
> > +static __always_inline unsigned long __percpu_read_##sz(void __percpu *pcp)		\
> >  {										\
> >  	u16 *gprs = &current_thread_info()->pcpu_gprs;				\
> >  	unsigned long off;							\
> 
> [Severity: Low]
> Should __PERCPU_OP_CASE() and the remaining __percpu_* helpers in this header
> (__percpu_write_##sz(), __PERCPU_RET_OP_CASE(), PERCPU_XCHG_OP(),
> PERCPU_CMPXCHG_OP(), and __percpu_cmpxchg_128()) also be marked
> __always_inline?
> 
> The noinstr function lockdep_hardirqs_on() calls
> __debug_atomic_inc(redundant_hardirqs_on), which under CONFIG_DEBUG_LOCKDEP=y
> expands to this_cpu_inc(lockdep_stats.redundant_hardirqs_on) ->
> __percpu_add_case_64().  Because __PERCPU_OP_CASE() still uses plain static
> inline and is also called from instrumentable lockdep functions, builds with
> CONFIG_CC_OPTIMIZE_FOR_SIZE=y can emit __percpu_add_case_64() out of line in
> .text and call it from .noinstr.text before RCU and lockdep state are ready
> for instrumentation.

Good catch! I will address this in v2. Before that, I will wait
for a while to collect review comments.

Thanks
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20261107071339.17467-1-jszhang@kernel.org?part=1


  reply	other threads:[~2026-11-09  4:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07  7:13 [PATCH 0/4] arm64: Fix instrumentation escapes from noinstr path Jisheng Zhang
2026-11-07  7:13 ` [PATCH 1/4] arm64: percpu: Always inline helpers used by noinstr code Jisheng Zhang
2026-11-08  7:43   ` sashiko-bot
2026-11-09  4:39     ` Jisheng Zhang [this message]
2026-11-07  7:13 ` [PATCH 2/4] arm64: entry: Always inline helpers used by non-instrumentable paths Jisheng Zhang
2026-11-08  7:43   ` sashiko-bot
2026-11-07  7:13 ` [PATCH 3/4] arm64: stacktrace: Always inline internal stack boundary helpers Jisheng Zhang
2026-11-07  7:13 ` [PATCH 4/4] arm64: alternatives: Make branch and ADRP offset helpers noinst Jisheng Zhang
2026-11-08  7:43   ` sashiko-bot
2026-11-09 11:58     ` 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=avFOfUZFBqTzrT4X@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.