Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2432523rdb; Wed, 4 Oct 2023 00:23:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7LVmuvWFr8h1nNhhGrLALOIwTslIl2wEawbfdVY/bI4K61Z6Hb8gUmd1D33medjzWSDb0 X-Received: by 2002:a17:902:eb44:b0:1c3:ed30:cdf4 with SMTP id i4-20020a170902eb4400b001c3ed30cdf4mr1621527pli.4.1696404205035; Wed, 04 Oct 2023 00:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696404205; cv=none; d=google.com; s=arc-20160816; b=y2EUBmIRh2lvea49AFWKjmusUGDF4t/sgnvFiNrrAJlhObS6bJIH2fYquHtA1UeSFx 8kC2KJqLB9GbBw4DXdZC+X/6EWbud6l2pIS3Wqu8orpT35FU/8z1H9hLizf7MslgJ6Tj 6JL0frr9fAB/8xsNjL2Kv/iv3et7r4ZRDHlW6tLzfedmXqOjGNWY5kU9umr33loTikFE gPwSRzUjqZK9ZqAeIQk7XZLKFfpRe9Gsojr0XndwpAUa8K9bsfrzu16JUBWJwjeWQlDr 8k1TZneXG4HzpFlDNrzMn0FDXVRc/uA56i7M/AWzuCwF2cAmlAjsrJJgQFQ04Q0Uttw+ 9KFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JvwrcDS6FuGz6NC7SEkVg1jp9G2HLxwXnJ3fl7T4vD4=; fh=tnvDZG8oMEm2/yBw4fX70YHVhnwPvX1qxCv2O0AtQPY=; b=kaUASyYwbBPgXUEAjOwdRBbnyL6sPgpzJY9TI5nLN9iP42rnD3XBS3zGk6U2R0dtcX xpsoYjvXpZTVxQSZ9dZ4TkV3OkPfDwkqAbTDq2rlksvFuL823OOv/OCK5jD5ZOOG/AY0 XjZiGIVxQCl5w8J9wAZ5ibl/SZIqspCtENJlDx3wqYl1bNl2MdM59WbL7CAkL3XMwd/a mz6vO29pQVxgcSy8OdzkxCtl7fSzLNaaWsPSqJ2S8snEaR0cL4+Yg1DlVgoZ57ggJwJB HGEsicg/gBOtYRX5oiIXC8dsYisEYBuyvVLmG8g1qOajVOSeg0NjUWrLXa0BrA84g+f+ JVvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id u13-20020a170902e80d00b001c56bd3f787si3321650plg.103.2023.10.04.00.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 00:23:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BFE1F81DC60D; Wed, 4 Oct 2023 00:23:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241502AbjJDHXP (ORCPT + 99 others); Wed, 4 Oct 2023 03:23:15 -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> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 04 Oct 2023 00:23:22 -0700 (PDT) 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