[PATCH v7 01/11] arm64/ptrace: Split report_syscall()

Kevin Brodsky kevin.brodsky at arm.com
Tue Nov 25 05:06:40 PST 2025


On 19/11/2025 10:49, Jinjie Ruan wrote:
>
> On 2025/11/19 1:09, Kevin Brodsky wrote:
>> On 17/11/2025 14:30, Jinjie Ruan wrote:
>>> The generic syscall entry code has the form:
>>>
>>> | syscall_trace_enter()
>>> | {
>>> |	ptrace_report_syscall_entry()
>>> | }
>>> |
>>> | syscall_exit_work()
>>> | {
>>> |	ptrace_report_syscall_exit()
>>> | }
>>>
>>> In preparation for moving arm64 over to the generic entry code, split
>>> report_syscall() to two separate enter and exit functions to align
>>> the structure of the arm64 code with syscall_trace_enter() and
>>> syscall_exit_work() from the generic entry code.
>>>
>>> No functional changes.
>>>
>>> Suggested-by: Mark Rutland <mark.rutland at arm.com>
>>> Signed-off-by: Jinjie Ruan <ruanjinjie at huawei.com>
>>> ---
>>>  arch/arm64/kernel/ptrace.c | 29 ++++++++++++++++++++---------
>>>  1 file changed, 20 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
>>> index 4b001121c72d..5534c175ceb7 100644
>>> --- a/arch/arm64/kernel/ptrace.c
>>> +++ b/arch/arm64/kernel/ptrace.c
>>> @@ -2317,7 +2317,7 @@ enum ptrace_syscall_dir {
>>>  	PTRACE_SYSCALL_EXIT,
>>>  };
>> This is now unused so it should be removed.
> Sure.

In fact it is not unused, not sure how I missed that... r12/x7 is set to
one of those values during ptrace_syscall_entry().

It would be a good idea to add a comment saying those values are part of
the ABI and must not be changed.

- Kevin



More information about the linux-arm-kernel mailing list