Re: [RFC PATCH 06/13] arm64: percpu: Add infrastructure for preemptible this_cpu_*() ops

Mark Rutland <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.ports.arm.kernel
Message-ID <anHntggSHNK28VYu@J2N7QTR9R3>
On Tue, Jul 28, 2026 at 06:49:12PM +0200, Peter Zijlstra wrote:
> On Tue, Jul 28, 2026 at 04:53:52PM +0100, Mark Rutland wrote:
> 
> > > > +#define ____PCPU_GPRS_BEGIN(gprs, pcp, off, addr)			\
> > > > +	__DEFINE_ASM_GPR_NUMS						\
> > > > +	__DEFINE_ASM_GPR_ALIASES					\
> > > > +	"	mov w" off ", #" __VAL_PCPU_GPRS(pcp, off, addr) "\n"	\
> > > > +	"	strh	w" off ", " gprs "\n"				\
> > > > +	__KERN_ASM_CPU_OFFSET(off) "\n"
> > > 
> > > Can this macro also generate a readable comment for those few of us
> > > building the .i file ?
> > 
> > Do you mean for __VAL_PCPU_GPRS, or ____PCPU_GPRS_BEGIN() ?
> 
> I was thinking BEGIN, but whatever is easiest, the __VAL thing is only
> ever used in BEGIN anyway.
> 
> > I can happily add comments for either (and the corresponding ENDs).
> 
> Not sure the comment makes sense for end, that's simply storing 0 and
> seems clear enough.

FWIW, for v2 I've added the following to ____PCPU_GPRS_BEGIN():

	"// ____PCPU_GPRS_BEGIN(" gprs ", " pcp ", " off ", " addr")\n"

... which should make that easy to spot, and surfaces the exact
registers used.

Mark.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.