Re: [RFC PATCH 4/9] arm64/kprobes: Make the single-step machinery noinstr

From: Hongyan Xia

Date: Tue Aug 04 2026 - 06:37:28 EST


Hi Mark, Ada,

On 8/3/2026 12:30 PM, Hongyan Xia wrote:
> On 7/31/2026 11:38 PM, Mark Rutland wrote:
>> On Mon, Jul 27, 2026 at 12:25:39PM +0000, Hongyan Xia wrote:
> [...]
>>
>> I don't think that's sufficient. If we can instrument that code, then we
>> can have unbounded recursion, unless I'm missing something?
>>
>> I think we need to fix that code to be noinstr safe.
>>
>> Ada Cc'd was looking into making the insn code generally noinstr-safe,
>> but that's a big job. Maybe it's possible to clean up the subset that's
>> necessary for arch_simulate_insn()?
>
> That would be fantastic. Yes, I believe this is the correct way to do
> noinstr here.
>
> I'll investigate what that subset could be.

The biggest violation is the GCS handling in update_lr() and
simulate_ret(). You might want to see if they can be noinstr'ed or they
need instrumentation_{begin/end}() treatment. Others are trivial.

Actually I wonder if it's worth turning our noinstr check script into an
RFC arm64 objtool --noinstr series. We've been using it to check noinstr
changes. We don't need to merge it now, but it might be useful to just
have the series somewhere for you to apply and verify noinstr changes.

> [...]