Re: [RFC v3 2/2] arm64: kprobes: Allow reentering kprobes while single-stepping
From: Hongyan Xia
Date: Fri Jul 17 2026 - 23:17:59 EST
On 7/18/2026 2:02 AM, Will Deacon wrote:
> On Fri, Jul 17, 2026 at 11:31:31AM +0000, Hongyan Xia wrote:
>> On 7/17/2026 7:01 PM, Will Deacon wrote:
>>> Thanks. So perf is run synchronously from the debug exception entry path,
>>
>> Yes, exactly.
>>
>>> 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