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

From: Linus Walleij

Date: Tue Jul 21 2026 - 04:52:40 EST


On Tue, Jul 21, 2026 at 10:19 AM Jinjie Ruan <ruanjinjie@xxxxxxxxxx> 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@xxxxxxx>
> Cc: Will Deacon <will@xxxxxxxxxx>
> Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
> Cc: Ada Couprie Diaz <ada.coupriediaz@xxxxxxx>
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>

It does indeed align to generic entry AFAICT.
Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij