Thread (15 messages) 15 messages, 4 authors, 4d ago

Re: [RFC v3 2/2] arm64: kprobes: Allow reentering kprobes while single-stepping

From: Hongyan Xia <hidden>
Date: 2026-07-18 03:18:18
Also in: linux-arm-kernel, lkml

On 7/18/2026 2:02 AM, Will Deacon wrote:
On Fri, Jul 17, 2026 at 11:31:31AM +0000, Hongyan Xia wrote:
quoted
On 7/17/2026 7:01 PM, Will Deacon wrote:
quoted
Thanks. So perf is run synchronously from the debug exception entry path,
Yes, exactly.
quoted
rather than because of a second exception taking place. Got it. But then
it sounds like we should really make the debug exception handling path (at
least, the part that runs for handling the kprobe step) noinstr to avoid
getting into this state to begin with. Is that practical?
Not sure about making the whole path noinstr (@Masami might have a
better opinion on this than me). Personally I don't mind either
disallowing it or making it correct.

But it might be a good idea not to diverge too much between ISAs. This
patch is pretty much mirroring what the x86 side handles this situation.
Ok, so how about this. I'll take these fixes for now, but let's try to
make these paths noinstr in the future? That's a much bigger job, but I
do worry that we're going to otherwise end up adding special logic every
time we run into an unexpected re-entrant case.
Sure, thanks. In our case, surely if someone wants to trace certain 
events like preempt_on/off (which is what we are doing with perf), 
events outside debug exceptions should be enough. He or she might not be 
so keen on events inside debug exceptions, and noinstr shouldn't hurt.

We will give it a thought and see if we can come up with some RFCs later.
Will
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help