Re: [PATCH v2 00/12] s390: More this_cpu_*() changes

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:31:25AM +0100, Mark Rutland wrote:
> > v2:
> > - Yet another brown paper bug: Re-add CPU migration check to last
> >   patch. Unconditionally recalculating and updating the percpu variable
> >   address and percpu offset register can corrupt previous context
> >   register state in several cases (not only the single case reported by
> >   Sashiko).
> 
> Do all of those case boil down to:
> 
> * During exception entry from context A to context B, a nested exception
>   is taken from context B to context C before percpu_entry() is called,
>   and the nested exception handler updates B's live regs using A's
>   percpu register indices.
> 
> * During exception return from context B to context A, a nested
>   exception is taken from context B to context C after percpu_entry() is
                                                         ^^^^^^^^^^^^
That should have been percpu_exit(), I guess.

>   called, and the nested exception handler updates B's live regs using
>   A's percpu register indices.
> 
> ... or was there another case that you spotted (e.g. some case where
> percpu_{entry,exit}() aren't called)?

Yes, all scenarios boil down to exactly the above.

> On arm64, I think we avoid those two cases by virtue of not taking
> nested (architectural) exceptions during those windows, and by not
> applying fixups for SDEI events (SW NMIs that can be taken during those
> windows).
> 
> If there's another case to consider, it'd be handy to know.

I'm not aware of more cases.
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.