[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a1f8a28e-84c3-dcf1-26d6-edbb37a5b750@huawei.com>
Date: Tue, 27 Jan 2026 19:02:39 +0800
From: Jinjie Ruan <ruanjinjie@...wei.com>
To: Kevin Brodsky <kevin.brodsky@....com>, Will Deacon <will@...nel.org>
CC: <catalin.marinas@....com>, <oleg@...hat.com>, <tglx@...utronix.de>,
<peterz@...radead.org>, <luto@...nel.org>, <shuah@...nel.org>,
<kees@...nel.org>, <wad@...omium.org>, <macro@...am.me.uk>,
<charlie@...osinc.com>, <akpm@...ux-foundation.org>, <ldv@...ace.io>,
<anshuman.khandual@....com>, <mark.rutland@....com>, <thuth@...hat.com>,
<song@...nel.org>, <ryan.roberts@....com>, <ada.coupriediaz@....com>,
<broonie@...nel.org>, <liqiang01@...inos.cn>, <pengcan@...inos.cn>,
<kmal@...k.li>, <dvyukov@...gle.com>, <richard.weiyang@...il.com>,
<reddybalavignesh9979@...il.com>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH v10 04/16] arm64/ptrace: Refactor
syscall_trace_enter/exit()
On 2026/1/27 17:43, Kevin Brodsky wrote:
> On 27/01/2026 04:01, Jinjie Ruan wrote:
>>> I understand that you're gradually making the arch code more similar to
>>> the core code so that we can switch over to it, but I'm struggling to
>>> understand why syscall_trace_enter() takes the 'syscall' argument.
>>>
>>> Even the core code just seems to use it as a local variable, which it
>>> overrides before it ever uses it. What am I missing?
>> Hi,
>>
>> You're absolutely right. The 'syscall' parameter is indeed treated as a
>> local variable and gets overridden before any real use. Should we
>> refactor to remove the parameter entirely in generic entry?
>
> I noticed this as well, removing it from the generic function would make
> sense. AFAICT that removal could be propagated quite far in fact:
> syscall_enter_from_user_mode_work(), syscall_enter_from_user_mode(),
> even arch implementation (do_syscall_64() on x86).
Not really, it is the default return value of
syscall_enter_from_user_mode_work() as below, so we only need to remove
the parameter in syscall_trace_enter().
static __always_inline long syscall_enter_from_user_mode_work(struct
pt_regs *regs, long syscall)
{
unsigned long work = READ_ONCE(current_thread_info()->syscall_work);
if (work & SYSCALL_WORK_ENTER)
syscall = syscall_trace_enter(regs, work);
return syscall;
}
>
> - Kevin
>
Powered by blists - more mailing lists