Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1829373rdh; Tue, 26 Sep 2023 05:04:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH9itE9jz25AwVniSwvQ1EBLbYQXnvdY2FmZCDl0hF2FADsXJrRdEzWWfo4vP5Mg6cKQkR7 X-Received: by 2002:a17:902:db06:b0:1c0:cbaf:6954 with SMTP id m6-20020a170902db0600b001c0cbaf6954mr3887754plx.25.1695729892272; Tue, 26 Sep 2023 05:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695729892; cv=none; d=google.com; s=arc-20160816; b=WDrxWvE2SSqiRgDT79KfUj9nKrMqiiZvN1i9EzQAqYEE34s+FdHEg2OyZzATlEDQco svr4/i+immNDCw6zdYDwVUS/W/ZcZRm+Z/c2SJmJSbKi4m81Q4odWHE6uRabnSgxyhPG Tp1zp6lvInvm9sTOWRKNHMIlNqGm07aln1WtM3xnPUWsx8Yqu1O0gIHPW/Zk/zfRFIed 6D0BU7o94Yt9kDC08djJE0hQBOvJfq+YXJRr3dH/uULGt9cKvRCkNNpn+2NRY0UTtDCa Imz5K88KUGWdkW7vg+0tM6m27ShljvvTiP+sYIDApTfqMb7goGeLPVqyYec/lrcTIulp 6H5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=w/4ipUt4YaYJVMn90dIRLMV9blP8uDxHBm7ZB3nucyE=; fh=XcrYWQqgFO9lMX5UPhjKG6RtZGi+qRh5R0fNAjjR6H8=; b=zhsq14ljD4UFFifc0EkxUyVJssYK6AIcpgu6kV+S1oVwPG4WCvNOOTIQ4bzURkJCVB PAOKh1WD2ylhXkT6CfL8yNNSlLS9Q2iXzHSR+19BmFyVG1iILQZ3N5sdF33cT2uISObS xjpfPdbZ4lRNgC9jJJHHVN5SWmUE7D7E97pV/HuLWiCP9mwqhCphYqnen3pg7pxaWL0y KQbCJSgL3vlGivnfzLNFhxRfBtRlMyAVuy926JvVP4uIVIT3yvenH5UqIrtMKTl13Vwr PHU/gHPzXDnoU4gctVSDwGdc224fmUyjDkKVWF73V+cweCaOMwhX9zjZzxSNDU+Dqii5 n2zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=S02BKYOI; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=kZ2VJNxI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s11-20020a170902ea0b00b001c36705bce1si13245876plg.474.2023.09.26.05.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 05:04:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm1 header.b=S02BKYOI; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=kZ2VJNxI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BC89880408CB; Mon, 25 Sep 2023 23:01:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233401AbjIZGBe (ORCPT + 99 others); Tue, 26 Sep 2023 02:01:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbjIZGBc (ORCPT ); Tue, 26 Sep 2023 02:01:32 -0400 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2871D6; Mon, 25 Sep 2023 23:01:25 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 7298832009A9; Tue, 26 Sep 2023 02:01:24 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 26 Sep 2023 02:01:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1695708084; x=1695794484; bh=w/ 4ipUt4YaYJVMn90dIRLMV9blP8uDxHBm7ZB3nucyE=; b=S02BKYOI6Rh5Iumm/y Iubc3e3DDnrQMuYwumMWaqDk/+s0aZVKTRWF/5pRHhLF3zjsWN/nH1Tck9WcOQ+B XQN7n+Ni6oeu8pW5Itv4Hw3PKhsGjuAlLlvqe/SqdRqK1kbv1wnUHd3Qr3hsHKQW gH/hN9kW9NKIKhoLlFpBODiiS/mu0NA8rYhuuC/4FwXktdjdOdDgEE/pFyZH7l6s Ec9N4yzST+CS13M6pfhwdOun751FShA2sobg/q2JFx9pITQjlfdOAnzceRIUS7m6 SoJCjDtVwss+b1i6xRyOhE4ofbtObhBFLIbg+hsWnzCXUSMhVBEPolG53QH7d2lR 0Gzg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1695708084; x=1695794484; bh=w/4ipUt4YaYJV Mn90dIRLMV9blP8uDxHBm7ZB3nucyE=; b=kZ2VJNxITGz5/swa9vulf6xSIyV+6 Xc/eVnsJjNXSR2pwgMYABr0E7P+HpQN+pVb80NX4lFSKvD4Or6y9Lz0ts36lDt1Y ZE5D60TVKkgyCmkLkmzB5WBQ4BdEl+ZEievW+zJi2/2Srnd2GM+aMijO7vB4Wx2Y KVExowlqj2wnIZHjFbzLRj2hBTs0xrnJPhSieZVWpjVU3EDG2ezPSGKons4BvpgB 98rBprrLuYb3PUo7IhLAFd7uaNwpQXst28sySTMg6hv9oVdjz8b0tPnqjZ8HnWGk mHQrkv9LgwPFgiEYtkXMhHhz/pyeYYxjGVR9obj+Drwt1lxgBH9Erkn8Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudelhedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedt keetffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 5E4D0B60089; Tue, 26 Sep 2023 02:01:23 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-957-ga1ccdb4cff-fm-20230919.001-ga1ccdb4c MIME-Version: 1.0 Message-Id: In-Reply-To: References: Date: Tue, 26 Sep 2023 08:01:00 +0200 From: "Arnd Bergmann" To: "Zhangjin Wu" , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org Cc: "Palmer Dabbelt" , "Paul Walmsley" , paulburton@kernel.org, "Paul E. McKenney" , "Thomas Bogendoerfer" , "Willy Tarreau" , =?UTF-8?Q?Thomas_Wei=C3=9Fschuh?= , "Tim Bird" Subject: Re: [PATCH v1 7/7] DCE/DSE: riscv: trim syscall tables Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 23:01:31 -0700 (PDT) On Tue, Sep 26, 2023, at 00:43, Zhangjin Wu wrote: > When the maximum nr of the used syscalls is smaller than __NR_syscalls > (original syscalls total). It is able to update __NR_syscalls to > (maximum nr + 1) and further trim the '>= (maximum nr + 1)' part of the > syscall tables: > > For example: > > sys_call_table [143] = { > [0 ... 143 - 1] = sys_ni_syscall, > [64] = sys_write, > [93] = sys_exit, > [142] = sys_reboot, > } > > The >= 143 part of the syscall tables can be trimmed. > > At the same time, the syscall >= 143 from user space must be ignored > from do_trap_ecall_u() of traps.c. > > Signed-off-by: Zhangjin Wu > --- > arch/riscv/include/asm/unistd.h | 2 ++ > arch/riscv/kernel/Makefile | 2 ++ > arch/riscv/kernel/syscalls/Makefile | 22 +++++++++++++++++++ > .../kernel/syscalls/compat_syscall_table.c | 4 ++-- > arch/riscv/kernel/syscalls/syscall_table.c | 4 ++-- > 5 files changed, 30 insertions(+), 4 deletions(-) This bit feels like you are overoptimizing for a corner case: there is not much to be gained in terms of memory savings, but you add complexity in an area that I feel should be made common between architectures. I hope to get back to working on consolidating both the syscall.tbl input files and the build infrastructure for them across architectures, and you make that harder here, so I'd prefer you to drop this part, at least until the code is shared across all architectures. Arnd