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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 852D2E8FDD7 for ; Wed, 4 Oct 2023 07:23:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232802AbjJDHXO (ORCPT ); Wed, 4 Oct 2023 03:23:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232754AbjJDHXO (ORCPT ); Wed, 4 Oct 2023 03:23:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 611E2AB; Wed, 4 Oct 2023 00:23:10 -0700 (PDT) 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 Cc: linux-api@vger.kernel.org, linux-arch@vger.kernel.org, Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Will Deacon , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , "James E . J . Bottomley" , Helge Deller , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "David S . Miller" , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Chris Zankel , Max Filippov , Arnd Bergmann , Peter Zijlstra , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Lukas Bulwahn , Sergei Trofimovich , Andrew Morton , Rohan McLure , Andreas Schwab , "Eric W . Biederman" , Brian Gerst , Randy Dunlap , Rick Edgecombe , Mark Brown , Deepak Gupta , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-perf-users@vger.kernel.org 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> Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org 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