On Tue, Mar 17, 2026 at 9:20 AM Jinjie Ruan <[email protected]> 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.
> - Properly handles syscall number modifications by tracers.
> - Uses standard architecture-independent helpers.
>
> No functional changes intended.
>
> Cc: Will Deacon <[email protected]>
> Cc: Catalin Marinas <[email protected]>
> Reviewed-by: Kevin Brodsky <[email protected]>
> Signed-off-by: Jinjie Ruan <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

Reply via email to