Re: [PATCH v4 12/12] alpha: Use the common syscall table

"Arnd Bergmann" <[email protected]>
Newsgroups org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Wed, Aug 12, 2026, at 05:33, André Almeida wrote:
> Remove some of the duplicated code by using the common syscall number
> 
>  quiet_cmd_syshdr = SYSHDR  $@
> -      cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr $< $@
> +      cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr \
> +		   --common-tbl $(systbl_common) --common-offset 110 \
> +		   --abis $(abis) $< $@
> 
>  quiet_cmd_systbl = SYSTBL  $@
> -      cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@
> +      cmd_systbl = $(CONFIG_SHELL) $(systbl) \
> +		   --common-tbl $(systbl_common) --common-offset 110 \
> +		   --abis $(abis) $< $@

The --common-offset agument does seem simple enough here and it
avoids processing the files separately.

> @@ -45,6 +45,7 @@
>  434	common	pidfd_open			sys_pidfd_open
>  435	clone3	clone3				sys_clone3
>  435	__clone3	clone3			__sys_clone3
> +435     alpha  	clone3                          alpha_clone3
>  436	common	close_range			sys_close_range
>  437	common	openat2				sys_openat2
>  438	common	pidfd_getfd			sys_pidfd_getfd

I think it would be nicer to change the "fork_like" macro in
arch/alpha/kernel/entry.S to use the same __sys_clone3 name
(and fork/vfork/clone) that we have on
m68k/mips/nios2/openrisc/sparc and save another special case.

Or we could do this the way that nios2 does with a redirect
in the syscall_table.c file, which does:

#define __SYSCALL(nr, call) [nr] = (call),
#define __SYSCALL_WITH_COMPAT(nr, native, compat)        __SYSCALL(nr, native)

#define sys_clone3 __sys_clone3

void *sys_call_table[__NR_syscalls] = {
        [0 ... __NR_syscalls-1] = sys_ni_syscall,
#include <asm/syscall_table_32.h>
};

This could just completely avoid having two entries for clone3.

     Arnd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.