[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <ad53ec9ec7168b6ca5a55e4c6b4583baa4dd0fc6.1676594211.git.falcon@tinylab.org>
Date: Fri, 17 Feb 2023 08:49:21 +0800
From: Zhangjin Wu <falcon@...ylab.org>
To: linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-mips@...r.kernel.org
Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Palmer Dabbelt <palmer@...osinc.com>, Willy Tarreau <w@....eu>,
Paul Burton <paulburton@...nel.org>,
"Paul E . McKenney" <paulmck@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Nicholas Mc Guire <hofrat@...dl.org>,
Zhangjin Wu <falcon@...ylab.org>
Subject: [RFC PATCH 1/5] syscall: Allow configure used system calls
A new CONFIG_SYSCALLS_USED is added to configure the system calls used
in a target system (especially for the ultra small embedded systems),
the other system calls will be disabled.
If further enabling CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION, the other
ones (if also not used by kernel itself) will be removed automatically.
The used system calls should be listed one by one like this:
write exit reboot
The architecture should implement it and then select the
HAVE_SYSCALLS_USED option.
Signed-off-by: Zhangjin Wu <falcon@...ylab.org>
---
init/Kconfig | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/init/Kconfig b/init/Kconfig
index 44e90b28a30f..2c4b8b234168 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1502,6 +1502,10 @@ config BPF
bool
select CRYPTO_LIB_SHA1
+config HAVE_SYSCALLS_USED
+ bool
+ default n
+
menuconfig EXPERT
bool "Configure standard kernel features (expert users)"
# Unhide debug options, to make the on-by-default options visible
@@ -1728,6 +1732,24 @@ config MEMBARRIER
If unsure, say Y.
+config SYSCALLS_USED
+ string "Configure used syscalls (EXPERIMENTAL)" if EXPERT
+ depends on HAVE_SYSCALLS_USED
+ default ""
+ help
+ This option allows to configure the system calls used in a target
+ system, the other system calls will be disabled.
+
+ If further enabling CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION, the
+ other ones (if also not used by kernel itself) will be removed
+ automatically.
+
+ The used system calls should be listed one by one like this:
+
+ write exit reboot
+
+ If unsure, keep this empty.
+
config KALLSYMS
bool "Load all symbols for debugging/ksymoops" if EXPERT
default y
--
2.25.1
Powered by blists - more mailing lists