[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250624185148.GA1490279@noisy.programming.kicks-ass.net>
Date: Tue, 24 Jun 2025 20:51:48 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Nam Cao <namcao@...utronix.de>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Cl??ment L??ger <cleger@...osinc.com>,
"Maciej W. Rozycki" <macro@...am.me.uk>,
Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>, aou@...s.berkeley.edu,
Alexandre Ghiti <alex@...ti.fr>, clrkwllms@...nel.org,
rostedt@...dmis.org, linux-rt-devel@...ts.linux.dev,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] riscv: Enable interrupt during exception handling
On Tue, Jun 24, 2025 at 05:33:14PM +0200, Nam Cao wrote:
> On Tue, Jun 24, 2025 at 04:34:58PM +0200, Peter Zijlstra wrote:
> > On Tue, Jun 24, 2025 at 04:23:50PM +0200, Sebastian Andrzej Siewior wrote:
> > > On 2025-06-24 16:18:01 [+0200], Peter Zijlstra wrote:
> > > > I'm confused, sending signals is for exception from userspace. That has
> > > > nothing to do with exceptions from kernelspace being NMI like.
> > >
> > > Yes. See the original submission
> > > https://lore.kernel.org/linux-riscv/20250620114346.1740512-1-namcao@linutronix.de/
> >
> > I'm still confused, that code is trying to enable IRQs in the
> > from-kernel part. That's insane.
> >
> > Can some Risc-V person explain why a from-kernel exception would ever
> > result in a signal?!?!
>
> Exceptions from kernel do not raise signals. Enabling irqs there is not
> necessary, I can remove that part.
>
> But for my curiousity, do you mind elaborating why it is insane to enable
> irqs in from-kernel exception handling?
>
> For "NMI-like" exceptions, (I think) I get it, the context would be messed
> up. But what about the others, e.g. kernel page faults?
The non-NMI exceptions like page-fault are okay. In fact, we hard rely
on it when kernel space accesses user-space data in a preemptible
context, it is expected to handle the fault.
My concern was about the NMI like ones -- enabling IRQs for those is
quite mad.
Powered by blists - more mailing lists