Re: [PATCH v2 12/12] s390/percpu: Rework to simplify percpu_entry() and percpu_exit()

Heiko Carstens <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,org.kernel.vger.linux-s390
Message-ID <[email protected]>
On Fri, Sep 18, 2026 at 11:40:21AM +0100, Mark Rutland wrote:
> On Fri, Sep 18, 2026 at 10:48:42AM +0200, Heiko Carstens wrote:
> > +#define __PCPU_AGRK(regptr, regpcp, regoff)					\
> > +	"	agrk	" regptr "," regpcp "," regoff "\n"
> > +
> > +#define __PCPU_BEGIN(lcreg, lcoff, regpcp, regoff, regptr)			\
> > +	__PCPU_MVIY_REGS(lcreg, regpcp, regoff)					\
> > +	__PCPU_LG(regoff, lcoff)						\
> > +	__PCPU_AGRK(regptr, regpcp, regoff)
> 
> Since percpu_exit() relies on regptr being regoff + 1, maybe it's worth
> having a check here to verify that? Perhaps in __PCPU_MVIY_REGS() with
> the uniqueness check.
> 
> Hopefully that never goes wrong, but catching a violation at build time
> might save some future pain.

Yes, that makes sense. Especially considering that there was already a
previous bug which could have been caught at build time.

Thanks a lot for taking a look!
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.