Re: [PATCH v6 3/6] syscall.h: introduce syscall_set_nr()

From: Maciej W. Rozycki
Date: Wed Feb 19 2025 - 14:20:42 EST


On Wed, 19 Feb 2025, Dmitry V. Levin wrote:

> > That label is called `trace_a_syscall' in arch/mips/kernel/scall64-o32.S
> > instead. To bring some order and avoid an inaccuracy here should the odd
> > one be matched to the other three?
>
> Apparently, there are two instances of syscall_trace_entry(), one
> n32_syscall_trace_entry(), one trace_a_syscall(), and each of them
> is calling syscall_trace_enter(), not to be confused with
> syscall_trace_entry():

Oh dear!

> I'd change the wording of my comment rather than try to disentangle this.
> After all, the most important here is that the new syscall number is
> loaded from regs[2] right after the syscall_trace_enter() invocation.

Right.

> Would you be OK with the following wording:
> /*
> * New syscall number has to be assigned to regs[2] because it is
> * loaded from there unconditionally after syscall_trace_enter()
> * invocation.

May I suggest "[...] after return from syscall_trace_enter() invocation."
instead? Minor reformatting might be required for better visual alignment
though.

Maciej