[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <e160b4df-92ce-4b9c-96ba-200f259c8216@app.fastmail.com>
Date: Tue, 26 Sep 2023 08:01:00 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Zhangjin Wu" <falcon@...ylab.org>, linux-kernel@...r.kernel.org,
linux-mips@...r.kernel.org, linux-riscv@...ts.infradead.org
Cc: "Palmer Dabbelt" <palmer@...osinc.com>,
"Paul Walmsley" <paul.walmsley@...ive.com>, paulburton@...nel.org,
"Paul E. McKenney" <paulmck@...nel.org>,
"Thomas Bogendoerfer" <tsbogend@...ha.franken.de>,
"Willy Tarreau" <w@....eu>,
Thomas Weißschuh <linux@...ssschuh.net>,
"Tim Bird" <tim.bird@...y.com>
Subject: Re: [PATCH v1 7/7] DCE/DSE: riscv: trim syscall tables
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 <falcon@...ylab.org>
> ---
> 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
Powered by blists - more mailing lists