From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout11.his.huawei.com (canpmsgout11.his.huawei.com [113.46.200.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 193AC3630BC; Thu, 9 Jul 2026 02:55:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.226 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783565738; cv=none; b=pWEazDbItwR5nPHL0u+Vo5fN+woeSd1sXs0evNroSSS3Aci1GSDNN+mAdQezef0EWCPDZ/dzdRrtOqAfdLpL1mdTH6VkNbjv6GufAcbSq7QdBjxMu4QTQJHHhYlHrrwiOaEPr9ubPEgbNDnTZ87MhrQfcRFwCbwS4ylbo8UV4FU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783565738; c=relaxed/simple; bh=6z6shxm0VomiVB/0CDqlEOacVIgWdbaKb5EXpCfIKCY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=Snz7wTCxIiXR33HN28shVJ4U/VhjVAbKN3tp0Fhx57opb98LQYSObxm4A7o3jj1af6M7dG5Rx8JA0Lr2z6j97/aBjdKwKXUz8qkAK3gSNqYaczZSVv6+4Dt9qqbk8L4Aoyikay/KVrcdY3mniqPwjKcGG5QItIIhefNzfm6uqlg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=thFA5tBr; arc=none smtp.client-ip=113.46.200.226 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="thFA5tBr" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=anxdR+vCsrXIdO5WleMXd+QVx9rE9sRRtEs8cuXxkx8=; b=thFA5tBrS52775v/1sgEOCDpqo9UJ007PspB8urA6kVaevJyEOvuQkvWzdOaLWq6Xx/1eMn5Z A/b2IWRpV/0Piw4SCuwzsg3g+vdgdjnGu2VRpcttACWjYP9fu2kSuIM/Q3ignQ5N4UJmT6yKcYm V+2fe4p1lhxwJaTzWBRn7Ik= Received: from mail.maildlp.com (unknown [172.19.163.127]) by canpmsgout11.his.huawei.com (SkyGuard) with ESMTPS id 4gwfVH24kdzKm60; Thu, 9 Jul 2026 10:46:15 +0800 (CST) Received: from dggpemf500011.china.huawei.com (unknown [7.185.36.131]) by mail.maildlp.com (Postfix) with ESMTPS id 43B58402AB; Thu, 9 Jul 2026 10:55:32 +0800 (CST) Received: from [10.67.109.254] (10.67.109.254) by dggpemf500011.china.huawei.com (7.185.36.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Thu, 9 Jul 2026 10:55:28 +0800 Message-ID: <710049c4-8568-48c9-b378-0cb64c8ee68d@huawei.com> Date: Thu, 9 Jul 2026 10:55:27 +0800 Precedence: bulk X-Mailing-List: linux-alpha@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [patch 10/18] entry: Use syscall number instead of rereading it To: Thomas Gleixner , LKML CC: Peter Zijlstra , Michael Ellerman , Shrikanth Hegde , , Kees Cook , Huacai Chen , , Paul Walmsley , Palmer Dabbelt , , Sven Schnelle , , , Mark Rutland , Andy Lutomirski , Oleg Nesterov , Richard Henderson , Russell King , Catalin Marinas , Guo Ren , Geert Uytterhoeven , Thomas Bogendoerfer , Helge Deller , Yoshinori Sato , Richard Weinberger , Chris Zankel , , , , , , , , , Arnd Bergmann , Vineet Gupta , Will Deacon , Brian Cain , Michal Simek , Dinh Nguyen , "David S. Miller" , Andreas Larsson , , , , , , =?UTF-8?Q?Michal_Such=C3=A1nek?= , Jonathan Corbet , References: <20260707181957.433213175@kernel.org> <20260707190254.181086755@kernel.org> From: Jinjie Ruan In-Reply-To: <20260707190254.181086755@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems500002.china.huawei.com (7.221.188.17) To dggpemf500011.china.huawei.com (7.185.36.131) On 7/8/2026 3:06 AM, Thomas Gleixner wrote: > rseq_syscall_enter_work() is invoked before the syscall number can be > modified. So there is no point in rereading it from pt_regs. > > Signed-off-by: Thomas Gleixner > --- > include/linux/entry-common.h | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > --- a/include/linux/entry-common.h > +++ b/include/linux/entry-common.h > @@ -70,9 +70,10 @@ static inline void syscall_enter_audit(s > } > } > > -static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsigned long work) > +static __always_inline long syscall_trace_enter(struct pt_regs *regs, unsigned long work, > + long syscall) > { > - long syscall, ret = 0; > + long ret = 0; > > /* > * Handle Syscall User Dispatch. This must comes first, since > @@ -90,7 +91,7 @@ static __always_inline long syscall_trac > * through hrtimer_interrupt(). > */ > if (work & SYSCALL_WORK_SYSCALL_RSEQ_SLICE) > - rseq_syscall_enter_work(syscall_get_nr(current, regs)); > + rseq_syscall_enter_work(syscall); > > /* Handle ptrace */ > if (work & (SYSCALL_WORK_SYSCALL_TRACE | SYSCALL_WORK_SYSCALL_EMU)) { > @@ -145,7 +146,7 @@ static __always_inline long syscall_ente > unsigned long work = READ_ONCE(current_thread_info()->syscall_work); > > if (work & SYSCALL_WORK_ENTER) > - syscall = syscall_trace_enter(regs, work); > + syscall = syscall_trace_enter(regs, work, syscall); Reviewed-by: Jinjie Ruan > > return syscall; > } >