[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ca18ee32-db74-4ec7-a6e2-805ac7abdee6@ghiti.fr>
Date: Thu, 4 Sep 2025 09:59:46 +0200
From: Alexandre Ghiti <alex@...ti.fr>
To: Peter Zijlstra <peterz@...radead.org>,
Alexandre Ghiti <alexghiti@...osinc.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt
<palmer@...belt.com>, Albert Ou <aou@...s.berkeley.edu>,
Guo Ren <guoren@...nel.org>, Björn Töpel
<bjorn@...osinc.com>, Palmer Dabbelt <palmer@...osinc.com>,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH RFC] riscv: Do not handle break traps from kernel as nmi
Hi Peter,
On 9/3/25 22:28, Peter Zijlstra wrote:
> On Wed, Sep 03, 2025 at 07:54:29PM +0000, Alexandre Ghiti wrote:
>> kprobe has been broken on riscv for quite some time. There is an attempt
>> [1] to fix that which actually works. This patch works because it enables
>> ARCH_HAVE_NMI_SAFE_CMPXCHG and that makes the ring buffer allocation
>> succeed when handling a kprobe because we handle *all* kprobes in nmi
>> context. We do so because Peter advised us to treat all kernel traps as
>> nmi [2].
>>
>> But that does not seem right for kprobe handling, so instead, treat
>> break traps from kernel as non-nmi.
> You can put a kprobe inside: local_irq_disable(), no? Inside any random
> spinlock region in fact. How is the probe then not NMI like?
Yes yes, in that case that will be NMI-like, sorry this patch is coarse
grain. The ideal solution would be to re-enable the interrupts if they
were enabled at the moment of the trap. In that case, would that make
sense to you?
Thanks,
Alex
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
Powered by blists - more mailing lists