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 A9BEFC43458 for ; Fri, 3 Jul 2026 09:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f6xS1EkSYOtxEE1YDfhAwZMsct6PXU7ZY33WePRP8Tg=; b=zf0R0ZsCkFvooV 9lnLQYJdjKLWTbUMbCSUtqPBf7tewzkk4YdbaKaTyJME6pTqvbo0CsLANTLp0vedpowSHUgNMlv/u EVPRnWTCCBf6oYjnBThS3LfZLBYv0lthDWehyTOJDobrPqrJ1x11VslxDkVVxgCWAl95y5ejxwvjj 3OjTiJ8szwB7FU2J46SK8AY6FAWboXj0dIyLusKXIT7F0GFzH4kk8ap9Dzpjfy9LiQeabU4GZ1s8/ LtHiT/pA9wi8uzfZQoG60iI2FSEdOfJ0a/karW3CEZlqIJ5FruNy8JeMcwiuz9btiEZYZesOknByh xdq+jTa7XeoTajvkKoDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wfa9i-00000006Tk6-3l8A; Fri, 03 Jul 2026 09:25:54 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wfa9h-00000006Tjx-45Yi for linux-riscv@bombadil.infradead.org; Fri, 03 Jul 2026 09:25:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=MPQJV7b7kJxx5txnyZHmL5S4FKlfiNVgVgnkVZMZ+6g=; b=jbJkBVOT/shtiot9Fc2pimpU1C HwNC+VKHJMncmc41AF6pUNHHSHoEGiATR5ncPKDf0gGLbv+67XpsMWxpomqvnEWns2uuBP/NddLZt steywxZ4WKc2RcW1NM+uxAnQdAAw132ojGrke1r7Pofyl1JkngSK/ZT8m/vnNnUJ/rn4JTxBKp4i0 U/ASGh0yXX0fXF6pY9FpYaAqDi7txgXPudLUNWL3sk5/nxO8P6rEIu7ZbmelZsUVKfX0VljoEPfZm Xs/7RlQubEXJnZR7hTst9g4bBclCh3APcrjBGKulmX625kzp3ZyHOw+tSbkdVvEtqZOW0J1c9UbOk HiJJGH8Q==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wfa9Z-0000000A4v3-364Y; Fri, 03 Jul 2026 09:25:45 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 7451030035C; Fri, 03 Jul 2026 11:25:44 +0200 (CEST) Date: Fri, 3 Jul 2026 11:25:44 +0200 From: Peter Zijlstra To: Sven Schnelle Cc: Thomas Gleixner , "H. Peter Anvin" , Michal =?iso-8859-1?Q?Such=E1nek?= , Jonathan Corbet , Shuah Khan , Huacai Chen , WANG Xuerui , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Andy Lutomirski , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Andrew Donnellan , Mark Rutland , Arnd Bergmann , Jiaxun Yang , Ryan Roberts , Greg Kroah-Hartman , Mukesh Kumar Chaurasiya , Shrikanth Hegde , Zong Li , Nam Cao , Deepak Gupta , Lukas Gerlach , Rui Qi , Kees Cook , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org Subject: Re: [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR Message-ID: <20260703092544.GB651302@noisy.programming.kicks-ass.net> References: <87h5mhnjsr.ffs@fw13> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Jul 03, 2026 at 08:26:36AM +0200, Sven Schnelle wrote: > The difference between x86 and s390 is that on s390, regs->gprs[2] is > used for both the syscall number and the syscall return value. > That was a design mistake early in the begin about 25 years ago, but > it's ABI now, so it cannot be changed. > > When seccomp decides to skip a syscall, it write a return value into > regs->gprs[2]. When syscall_enter_from_user_mode_work() returns, it > returns this number. If it's negative all is good - the 'if (likely(nr < > NR_syscalls))' conditiion would just catch it and skip the syscall. You do have regs->orig_gpr2; I didn't fully track its usage, but can't you treat that as the syscall nr and always consider regs->gprs[2] as the return value? _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv