Re: [PATCH v2 0/9] s390: Improve this_cpu operations

From: Peter Zijlstra

Date: Fri Mar 20 2026 - 07:45:52 EST


On Fri, Mar 20, 2026 at 12:39:09PM +0100, Heiko Carstens wrote:
> On Thu, Mar 19, 2026 at 02:56:12PM +0100, Peter Zijlstra wrote:
> > On Thu, Mar 19, 2026 at 01:04:54PM +0100, Heiko Carstens wrote:
> > > v2:
> > >
> > > - Add proper PERCPU_PTR cast to most patches to avoid tons of sparse
> > > warnings
> > >
> > > - Add missing __packed attribute to insn structure [Sashiko [2]]
> > >
> > > - Fix inverted if condition [Sashiko [2]]
> > >
> > > - Add missing user_mode() check [Sashiko [2]]
> > >
> > > - Move percpu_entry() call in front of irqentry_enter() call in all
> > > entry paths to avoid that potential this_cpu() operations overwrite
> > > the not-yet saved percpu code section indicator [Sashiko [2]]
> >
> > Would it make sense to add arch hooks to irqentry_{enter,exit}() ?
>
> I guess it would make sense to have some architecture hook which
> allows to run code on all entry/exit paths instead of duplicating the
> code n times.
>
> But apparently my code seems to have more bugs (e.g. I didn't consider
> kprobes which would make the instruction comparison not work). So this
> has to wait until I'm back after vacation.

My vote is to reject kprobes in these regions :-) Anyway, enjoy the time
off!