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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 16B58C43458 for ; Thu, 9 Jul 2026 02:55:43 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4gwfj95cXrz3byZ; Thu, 09 Jul 2026 12:55:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=113.46.200.226 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1783565741; cv=none; b=FeO9NxFh358B+IcKXKhXilP9iZ4cYAp4hCbIcsWcULwxp/Rqx59QpFNa0Ak9qeUJSYj82SUpO+LbzW79QaMRB6JeEv6OVHXgEBjOAIrWslxc7iuGcXDeoFQ1OKh6Otqyb79w4XdSrlMLvzBoh9mgyI+2kMS2U9OAuGRycEUzaezKvbZbCgoHKdUQxsBAEb4nN55iU5aCbF7eTvbj+/3HUC6cd1IHYM9uAFfepFgqpcDfnC+zI+7BUc1rBy7Lb0XKLfa0iI0RPOGraRwZ1p/GNBANR799uG2ki8GZVqIsc1mHjTewQfZxUJt03CPyhmGhOeDtEyTfTvqnRA7Jc37StA== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1783565741; c=relaxed/relaxed; bh=anxdR+vCsrXIdO5WleMXd+QVx9rE9sRRtEs8cuXxkx8=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=MvxvFWpYL8dntkeqr63SkDT+0hW0wP3ZZ3tBJ3kJE7z3XD9WBZiEShodQsk3LimtGRhVafgh5hyaLoQCodzzvfGRWopJGAcmTAGZsVPQHxJFX24s+2sQS3ku9gBPcqn1LB5UnCFSD30SWpCrPYmS1Hyf3tVRaOEWU0E1HWGM9u4D6l8nu/rvGl3CNaOG31FZLzXZzhRW8hsFY3Ztt/3G4S2R/2mkD+zGStzgk91adUeYF6rqeF+ncWYvCugwLpZuINKNhn8VwbsOMDGPImUGM/TdH383SzNtqugNlQBYA2diE0HYr0QSkyb8zh8y2FoIpgleoDGREpr1Bp8F/K3VZA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; dkim=pass (1024-bit key; unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=thFA5tBr; dkim-atps=neutral; spf=pass (client-ip=113.46.200.226; helo=canpmsgout11.his.huawei.com; envelope-from=ruanjinjie@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=thFA5tBr; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=113.46.200.226; helo=canpmsgout11.his.huawei.com; envelope-from=ruanjinjie@huawei.com; receiver=lists.ozlabs.org) Received: from canpmsgout11.his.huawei.com (canpmsgout11.his.huawei.com [113.46.200.226]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4gwfj70Kdtz3bxp for ; Thu, 09 Jul 2026 12:55:36 +1000 (AEST) 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 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list 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) 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; > } >