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 AD430E7B5F4 for ; Wed, 4 Oct 2023 11:28:29 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4S0srX1jKXz3vYF for ; Wed, 4 Oct 2023 22:28:28 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2604:1380:4641:c500::1; helo=dfw.source.kernel.org; envelope-from=cmarinas@kernel.org; receiver=lists.ozlabs.org) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (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 4S0mPZ4mvZz3bw9 for ; Wed, 4 Oct 2023 18:23:14 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 573CA6144B; Wed, 4 Oct 2023 07:23:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5AA2C433C7; Wed, 4 Oct 2023 07:22:59 +0000 (UTC) Date: Wed, 4 Oct 2023 08:22:57 +0100 From: Catalin Marinas To: Sohil Mehta Subject: Re: [PATCH v2] arch: Reserve map_shadow_stack() syscall number for all architectures Message-ID: References: <20230914185804.2000497-1-sohil.mehta@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230914185804.2000497-1-sohil.mehta@intel.com> X-Mailman-Approved-At: Wed, 04 Oct 2023 22:28:01 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Ian Rogers , Rich Felker , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , Dave Hansen , linux-kernel@vger.kernel.org, "James E . J . Bottomley" , Max Filippov , Andreas Schwab , "H . Peter Anvin" , sparclinux@vger.kernel.org, Alexander Gordeev , Will Deacon , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, "Eric W . Biederman" , Arnd Bergmann , Yoshinori Sato , Helge Deller , x86@kernel.org, Russell King , Alexander Shishkin , Ingo Molnar , Geert Uytterhoeven , Lukas Bulwahn , Matt Turner , Christian Borntraeger , Sergei Trofimovich , Vasily Gorbik , Brian Gerst , Heiko Carstens , Richard Henderson , Nicholas Piggin , linux-mips@vger.kernel.org, Rohan McLure , Mark Brown , Ivan Kokshaysky , Arnaldo Carvalho de Melo , Andy Lutomirski , John Paul Adrian Glaubitz , Namhyung Kim , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Deepak Gupta , Chris Zankel , Michal Simek , Thomas Bogendoerfer , linux-parisc@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-api@vger.kernel.org, Randy Dunlap , Adrian Hunter , linux-perf-users@vger.kernel.org, Sven Schnelle , Jiri Olsa , linux-alpha@vger.kernel.org, Borislav Petkov , Andrew Morton , Rick Edgecombe , linuxppc-dev@lists.ozlabs.org, "David S . Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Sep 14, 2023 at 06:58:03PM +0000, Sohil Mehta wrote: > commit c35559f94ebc ("x86/shstk: Introduce map_shadow_stack syscall") > recently added support for map_shadow_stack() but it is limited to x86 > only for now. There is a possibility that other architectures (namely, > arm64 and RISC-V), that are implementing equivalent support for shadow > stacks, might need to add support for it. > > Independent of that, reserving arch-specific syscall numbers in the > syscall tables of all architectures is good practice and would help > avoid future conflicts. map_shadow_stack() is marked as a conditional > syscall in sys_ni.c. Adding it to the syscall tables of other > architectures is harmless and would return ENOSYS when exercised. > > Note, map_shadow_stack() was assigned #453 during the merge process > since #452 was taken by fchmodat2(). > > For Powerpc, map it to sys_ni_syscall() as is the norm for Powerpc > syscall tables. > > For Alpha, map_shadow_stack() takes up #563 as Alpha still diverges from > the common syscall numbering system in the other architectures. > > Link: https://lore.kernel.org/lkml/20230515212255.GA562920@debug.ba.rivosinc.com/ > Link: https://lore.kernel.org/lkml/b402b80b-a7c6-4ef0-b977-c0f5f582b78a@sirena.org.uk/ > > Signed-off-by: Sohil Mehta > --- > v2: > - Skip syscall table changes to tools/. They will be handled separetely by the > perf folks. > - Map Powerpc to sys_ni_syscall (Rick Edgecombe) > --- > arch/alpha/kernel/syscalls/syscall.tbl | 1 + > arch/arm/tools/syscall.tbl | 1 + > arch/arm64/include/asm/unistd.h | 2 +- > arch/arm64/include/asm/unistd32.h | 2 ++ For arm64 (compat): Acked-by: Catalin Marinas