[PATCH] riscv: Enable interrupt during exception handling
Peter Zijlstra
peterz at infradead.org
Tue Jun 24 11:51:48 PDT 2025
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.
More information about the linux-riscv
mailing list