Re: [PATCH v15 03/11] arm64/ptrace: Use syscall_get_nr() helper for syscall_trace_enter()
From: Ada Couprie Diaz
Date: Wed Jun 24 2026 - 09:43:45 EST
On 11/05/2026 10:20, Jinjie Ruan wrote:
Use syscall_get_nr() to get syscall number for syscall_trace_enter().This is missing what it makes the future migration . Easier, possible ?
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.
(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@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>