Re: [PATCH RFC 1/4] syscalls: Create unified partial table for all archs

"Arnd Bergmann" <[email protected]> Fri, 24 Jul 2026 22:09:14 +0200
Newsgroups org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Fri, Jul 24, 2026, at 22:00, Andr=C3=A9 Almeida wrote:
> To take advantage of the subset of syscall numbers that are guaranteed=
 to
> be shared, create a new table and adapt generation scripts to use it. =
In
> that way, every new syscall can be added to a single file.
>
> Signed-off-by: Andr=C3=A9 Almeida <[email protected]>

Thanks a lot for working on this, I had planned to do this myself
for a while but had never quite gotten around to finish it.

> +#
> +# syscall numbers shared by architectures
> +
> +442	common	mount_setattr			sys_mount_setattr
> +443	common	quotactl_fd			sys_quotactl_fd
> +444	common	landlock_create_ruleset		sys_landlock_create_ruleset
> +445	common	landlock_add_rule		sys_landlock_add_rule

It should really be anything starting at 403, not just 442 and higher.

There are some trivial differences that have crept in over time,
but we should be able to work around those.

> index 22e34cd46b9b..77934a2d0f51 100755
> --- a/scripts/syscallhdr.sh
> +++ b/scripts/syscallhdr.sh
> @@ -26,6 +26,7 @@ usage() {
>  	echo >&2 "  --emit-nr          Emit the macro of the number of=20
> syscalls (__NR_syscalls)"
>  	echo >&2 "  --offset OFFSET    The offset of syscall numbers"
>  	echo >&2 "  --prefix PREFIX    The prefix to the macro like=20
> __NR_<PREFIX><NAME>"
> +	echo >&2 "  --common-tbl       Use the common number table"
>  	exit 1

Ideally we shouldn't even need this bit either, though it may
help for the transition phase.

     Arnd