From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD7E9C44503 for ; Thu, 9 Jul 2026 02:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=anxdR+vCsrXIdO5WleMXd+QVx9rE9sRRtEs8cuXxkx8=; b=3t6f0Hw1lJOhbuYAj+bXEHxA3J +Nwg9pzBDJOfSSOB7MWwRVWG7FTw7JMgjyGeBU8lPHUE6yDSvQh6uyomFLXhVEJpLVcqLD5Y2maLH c6o4qqceKt3kKMEG8i0W3Yxvl8xMB0JY74JANWbVob7Fv3cJ1qdlQJf/TQNlmTQdWdN+SP4KlivNT 8Pd5cllICVHTePlUg8DyMbo1KCnbbpDUQxfsmy935NI1yamj1VvYtR1V9/TSuepSE3giMygXmTZ9/ D5r8dfzyfR1cctTxxTKjKm5earUX6Qj2RFHmIcFEGqNPzea76XbuxeqZ9mg/8g/KiUew6VUYAaLeP IkyjknVg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1whevS-00000000sAY-3HQv; Thu, 09 Jul 2026 02:55:46 +0000 Received: from canpmsgout11.his.huawei.com ([113.46.200.226]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1whevL-00000000s9F-2t7H; Thu, 09 Jul 2026 02:55:42 +0000 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 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-Originating-IP: [10.67.109.254] X-ClientProxiedBy: kwepems500002.china.huawei.com (7.221.188.17) To dggpemf500011.china.huawei.com (7.185.36.131) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260708_195540_830152_C92F2086 X-CRM114-Status: GOOD ( 13.52 ) X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org 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; > } >