From: Peter Zijlstra <peterz@infradead.org>
To: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: "Steven Rostedt" <rostedt@goodmis.org>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>, "Guo Ren" <guoren@kernel.org>,
"Björn Töpel" <bjorn@rivosinc.com>,
"Palmer Dabbelt" <palmer@rivosinc.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH RFC] riscv: Do not handle break traps from kernel as nmi
Date: Wed, 3 Sep 2025 22:28:03 +0200 [thread overview]
Message-ID: <20250903202803.GQ4067720@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20250903-dev-alex-break_nmi_v1-v1-1-4a3d81c29598@rivosinc.com>
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?
next prev parent reply other threads:[~2025-09-03 20:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 19:54 Alexandre Ghiti
2025-09-03 20:28 ` Peter Zijlstra [this message]
2025-09-04 7:59 ` Alexandre Ghiti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250903202803.GQ4067720@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=alex@ghiti.fr \
--cc=alexghiti@rivosinc.com \
--cc=aou@eecs.berkeley.edu \
--cc=bjorn@rivosinc.com \
--cc=guoren@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=palmer@rivosinc.com \
--cc=paul.walmsley@sifive.com \
--cc=rostedt@goodmis.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®