Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp970483rdb; Sat, 7 Oct 2023 06:36:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFr505ynE14dbhmCE3fXFD8sMT28pVvJW9A+WkX+DRC7ExZwyvqyIry7gQZ5Te0eWn+yQhb X-Received: by 2002:a05:6a20:3d90:b0:15e:10e:12f3 with SMTP id s16-20020a056a203d9000b0015e010e12f3mr12755689pzi.0.1696685784255; Sat, 07 Oct 2023 06:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696685784; cv=none; d=google.com; s=arc-20160816; b=WPRHgV+rvJR57I6yQH6EbyVmHren8sdWoojPI6mgKdxDihAOE3+SJ1YxUBmtkggIBW 35mtL0IySCgdWdtt1kUwpK4l1Hq5FJkC3bealWjl/7xSbbLmP5FZ1Gn5lFGSeJJEkp2Q D+InwOqPwvL51VtfhmbsrdgkkS/zKgE9cfJC+ma9yg/37AJ1Ok7Veqq6AtCwdUiYPl4L 3pl7+ugOEvkIttORo5iGNsqCe45CcHGylYZQzkcEvu2hUxkJcnZUshSbTGsDfNQRsOsq 8SNCghtbIbgF0AdDnvSJl6zZrO0T9LkpbKkIKjRobiCCGAfe2MlFw/lN97Rw8409H0RU 3Xgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=ZMRk34yjCJMlIjBxvBdVwQtHMmixvNNdWMGgI/ltPRw=; fh=x8PWLvxdcUoplnIYfy3QIRNQqpH6wW84TeJufCy6Cfs=; b=WkJNbBUzVIwufNKIFHYIbpJ0EzThHiKBHX6KUxlrD/JPDWMMBnmoJMYjtY5oJNEgU8 t2i/dJ1pmjqUi/TmVPFtJxRH5K+gsib9AAHPNZVhFKoLT7pzKxi92x7ATsGdTcidmGMI flAn5jLQ4uZyMRtz8o55FfgyXqI8PD+G9TJr1aQHL8TFp4SRkrP/ynPzvqYagrrQzH4B FBR20h6pRj4/GkGVarwYJvRxFWlVG8a847lhdK+JS3NwDzooxXp1uX/wErAsZbsq6nnk V9isvL22DSYAmd2UDzU2xUHM3y/gUZmJBGJ1HiYsi2wXSeNO0Ik8zGf1EzgCLO1P+6sk kgmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id c20-20020a637254000000b005898e5f41f8si3493483pgn.53.2023.10.07.06.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 06:36:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 3BC38803B3BB; Sat, 7 Oct 2023 06:36:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343887AbjJGNgG (ORCPT + 99 others); Sat, 7 Oct 2023 09:36:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343627AbjJGNgF (ORCPT ); Sat, 7 Oct 2023 09:36:05 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EB62BA; Sat, 7 Oct 2023 06:36:03 -0700 (PDT) X-QQ-mid: bizesmtp86t1696685746tumf87vq Received: from linux-lab-host.localdomain ( [116.30.131.235]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 07 Oct 2023 21:35:45 +0800 (CST) X-QQ-SSF: 01200000000000E0Y000000A0000000 X-QQ-FEAT: 3M0okmaRx3jgGcczq7ckLHewl2tbA5gqgi51LqUGP7as6L5o4OHQBGbMr+O0K Ev5u1YtIpPxQGtJlVHeYgCFGWuSyU4pupUt3i9h5i6zVcsE9kmXpl7AbGbnnLBOxIZeJQPL +Uf+RAHoyB1WFXVIuEQ+hM+OUqylNxlzXA9MGEgfMEhjuEEyP835Kv4abK53J0LUbGOnySj JxxpaCy54pY0AHvDEJ/5ycR62jiLW/n5w+rhGGqYxuoJG8GNAJr8OBXEIj6XKza1Sw4w5Nj 27F3twjB0oVAqiVQJOYZP6DupfkRZWP2HbTzQPMtM/u15Tu153r5elnFLt4UgaJcgJmVG0Z mQlI8VDelUKWCRAEg97X1DbevJXNLRuEWG8ACCAxcpwN6vtCWNF6jsT4uDBoQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6264558970741984576 From: Zhangjin Wu To: arnd@arndb.de Cc: falcon@tinylab.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, tim.bird@sony.com, tanyuan@tinylab.org Subject: Re: [PATCH v1 7/7] DCE/DSE: riscv: trim syscall tables Date: Sat, 7 Oct 2023 21:35:44 +0800 Message-Id: <20231007133544.6580-1-falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Sat, 07 Oct 2023 06:36:22 -0700 (PDT) Hi, Arnd > 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. > Agree, let's drop it. Thanks, Zhangjin > Arnd