[PATCH v17 09/15] arm64: ptrace: Align syscall exit work semantics with generic entry

Linus Walleij linusw at kernel.org
Tue Jul 21 01:46:43 PDT 2026


On Tue, Jul 21, 2026 at 10:19 AM Jinjie Ruan <ruanjinjie at huawei.com> wrote:

> Refactor the syscall exit path to better match the generic entry
> framework. Specifically:
>
> - Introduce `_TIF_SYSCALL_EXIT_WORK` to aggregate exit-time thread
>   flags (trace, audit, tracepoint).
>
> - Rename `syscall_trace_exit()` to `arm64_syscall_exit_work()` to
>   better reflect its role.
>
> - Move `rseq_syscall()` out of `arm64_syscall_exit_work()` and into
>   `arm64_syscall_exit_to_user_mode_work()` so that it runs
>   unconditionally on all exits, consistent with generic entry.
>
> - Gate `arm64_syscall_exit_work()` behind the new flag check,
>   mirroring the generic entry exit's pattern.
>
> Gating audit on `_TIF_SYSCALL_AUDIT` is equivalent to the previous
> `audit_context()` check: the audit context and flag are statically
> allocated at fork and freed at exit, remaining stable throughout
> syscall execution.
>
> 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>
> Cc: Ada Couprie Diaz <ada.coupriediaz at arm.com>
> Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>

It does indeed align to generic entry AFAICT.
Reviewed-by: Linus Walleij <linusw at kernel.org>

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list