From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83010606A321 for ; Fri, 23 Oct 2026 14:24:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=25c67py9; dkim=fail reason="signature verification failed" (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QGNPKBGI 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:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=ha5gkci1YfTOM6VAdeIjSOcPXuxV89qoZ8CVISPRaQk=; b=25c67py9SQV8+FidwNaXKkbsX8 nMtR8cxDM/GXaJDAOe8UhnmKfIPKZ2e5jK/qM/ejx7Y72/oj5cj+KEFf+ECFH6sQdLDKbfOpJ1Z5F ba5taj22TpeHR2PH4sdbbqi3hJif8gENa75jVYYTTGQO7i77T2GIoepWcCAoYhYBL2Ra55P9Zk8kw Cc0KM7lg4RBNB8Wfll56B+xOAEQToNnSRqCc7eP3CUs+1bbnvb/2DcoAOcyjQW3BkSk8v/1+YbFqr 18JEZDRqI0qMwtmtqfsXPUWw2BDiXMyt/jbKNzBnirYAKcwkVwxVJdR31A6MCgPn3m+Q2zA4Clr5L /whUfDqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xKGC3-0000000GVcL-237b; Fri, 23 Oct 2026 14:24:27 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xKGC1-0000000GVbp-2zPt; Fri, 23 Oct 2026 14:24:25 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 3343E413EF; Fri, 23 Oct 2026 14:24:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6B0661F01825; Fri, 23 Oct 2026 14:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792765465; bh=5dVR3TN7s3BdKhx2Ut/LouYZioYZObIc2PPzWKi4iy0=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=QGNPKBGIM2nRqkKIph4PyfYBLDWc+lEnWMiWgVtxwooARZZ9SksPaTdnwkXyuu1hL nk1UY5lGPBZ7kPogJATkcg91O10/O55644Zn6yf5rahNDQfePsiARGjnGgHZ/RRNvM v2USrBHYe7FDy0YLLvQD6DXcJ/ItGULufyA+LwI+iOZPVLkyOrC+syuFQm9J2T/eLf 4v3jT2c7tUqv4XJJd9a/ogzIpSbdMeU3iXMmcWRG3nOZGarZFTww/6QGrIblnPKTZ1 ikA1j2sJ/lw2/ZIqvDAR0r9qjofZYtRynG/e/2di/XcOimoeGFqQqzI0vjpx4iDGhR hMbtJWz0jUwQw== From: Thomas Gleixner To: "H. Peter Anvin" , Sebastian Andrzej Siewior Cc: LKML , Peter Zijlstra , Michael Ellerman , Shrikanth Hegde , linuxppc-dev@lists.ozlabs.org, Kees Cook , Huacai Chen , loongarch@lists.linux.dev, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Sven Schnelle , linux-s390@vger.kernel.org, x86@kernel.org, Mark Rutland , Jinjie Ruan , Andy Lutomirski , Oleg Nesterov , Richard Henderson , Russell King , Catalin Marinas , Guo Ren , Geert Uytterhoeven , Thomas Bogendoerfer , Helge Deller , Yoshinori Sato , Richard Weinberger , Chris Zankel , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, linux-csky@vger.kernel.org, linux-m68k@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, Arnd Bergmann , Vineet Gupta , Will Deacon , Brian Cain , Michal Simek , Dinh Nguyen , "David S. Miller" , Andreas Larsson , linux-snps-arc@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, Michal =?utf-8?Q?Such=C3=A1nek?= , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [patch 16/18] x86/entry: Get rid of the sys_ni_syscall() indirection In-Reply-To: <871p9g1s3w.ffs@fw13> References: <20260707181957.433213175@kernel.org> <20260707190254.493733289@kernel.org> <20261022142425.3Wx-RrU5@linutronix.de> <87fqxx1r80.ffs@fw13> <87cxt11ktr.ffs@fw13> <1149A39E-BEBA-46EA-94F4-4DFFC4733EF5@zytor.com> <871p9g1s3w.ffs@fw13> Date: Fri, 23 Oct 2026 16:24:22 +0200 Message-ID: <87y0boze95.ffs@fw13> X-Archived-By: MIME-Version: 1.0 X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Fri, Oct 23 2026 at 15:09, Thomas Gleixner wrote: > On Thu, Oct 22 2026 at 17:22, H. Peter Anvin wrote: > Tired brain misread the test output: > > [RUN] Running tests under ptrace: modifying the default return > [RUN] Checking system calls with msb = 0 (0x0) > [OK] x32 syscalls 0:-64..-2 returned -ENOSYS as expected > [OK] x32 syscall 0:-1 returned MODIFIED_BY_PTRACE as expected > [OK] x64 syscalls 0:-64..-1 returned -ENOSYS as expected > > But that's because the "-1" on x32 is actually 0xFFFFFFFF while on x64 > it's 0x7FFFFFFF. > > The whole mess comes from using -1 as indicator for syscall abort which > is undistinguishable from a syscall(nr=-1). > > Bah. Let me restore this nonsense. The real question is how we ended up there. By design or as an implementation detail which got later set in stone and the selftest was written to test the implementation instead of testing against a specification. I went back in history and in 2.6.12 the behavior was for both i386 and x86_64: regs->ax = -ENOSYS; syscall_trace_enter(); if (syscall_nr < MAX) do_syscall(); .... IOW, a tracer modification of regs->ax is not overwritten when the syscall number is out of range. Between 2.6.19-rc2 and -rc3 x86_64 was changed to _always_ overwrite regs->ax when the syscall number is out of range. In the 3.8 merge window seccomp introduced the -1 == skip bogosity which got fixed up and made "consistent" in several changes afterwards. Just that it never reached a state of consistency due to the overloading. So are we stuck with this behavior or do we sit down and define what the correct behavior should be? Thanks, tglx _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv