[PATCH v15 03/11] arm64/ptrace: Use syscall_get_nr() helper for syscall_trace_enter()

Ada Couprie Diaz ada.coupriediaz at arm.com
Wed Jun 24 06:42:22 PDT 2026


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 !)
> - Properly handles syscall number modifications by tracers.
> - Uses standard architecture-independent helpers.
>
> No functional changes intended.
>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Cc: Will Deacon <will at kernel.org>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Reviewed-by: Linus Walleij <linusw at kernel.org>
> Reviewed-by: Yeoreum Yun <yeoreum.yun at arm.com>
> Reviewed-by: Kevin Brodsky <kevin.brodsky at arm.com>
> Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>
> ---

Otherwise,

Reviewed-by: Ada Couprie Diaz <ada.coupriediaz at arm.com>



More information about the linux-arm-kernel mailing list