Re: [PATCH v15 03/11] arm64/ptrace: Use syscall_get_nr() helper for syscall_trace_enter()
From: Jinjie Ruan
Date: Thu Jun 25 2026 - 04:52:30 EST
On 6/24/2026 9:42 PM, Ada Couprie Diaz wrote:
> On 11/05/2026 10:20, Jinjie Ruan wrote:
>
>> Use syscall_get_nr() to get syscall number for syscall_trace_enter().
>> This aligns arm64's internal tracing logic with the generic
>> entry framework.
>>
>> [Changes]
>> 1. Use syscall_get_nr() helper:
>> - Replace direct regs->syscallno access with
>> syscall_get_nr(current, regs).
>> - This helper is functionally equivalent to direct access on arm64.
>>
>> 2. Re-read syscall number after tracepoint:
>> - Re-fetch the syscall number after trace_sys_enter() as it may have
>> been modified by BPF or ftrace probes, matching generic entry
>> behavior.
>>
>> [Why this matters]
>> - Aligns arm64 with the generic entry interface.
>> - Makes future migration to generic entry framework.
> This is missing what it makes the future migration . Easier, possible ?
> (Same in patch 02, but I missed it !)
Hi Ada,
Yes, a word was missing: 'simpler' or 'smoother'.
Best regards,
Jinjie
>> - Properly handles syscall number modifications by tracers.
>> - Uses standard architecture-independent helpers.
>>
>> No functional changes intended.
>>
>> Cc: Mark Rutland <mark.rutland@xxxxxxx>
>> Cc: Will Deacon <will@xxxxxxxxxx>
>> Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
>> Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>
>> Reviewed-by: Yeoreum Yun <yeoreum.yun@xxxxxxx>
>> Reviewed-by: Kevin Brodsky <kevin.brodsky@xxxxxxx>
>> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
>> ---
>
> Otherwise,
>
> Reviewed-by: Ada Couprie Diaz <ada.coupriediaz@xxxxxxx>
>