Re: [PATCH RFC v3 2/8] syscalls: Create unified partial table for all archs

André Almeida <[email protected]>
Newsgroups gmane.linux.kbuild.devel,gmane.linux.kernel
Message-ID <[email protected]>
Em 07/08/2026 17:40, Arnd Bergmann escreveu:
> On Fri, Aug 7, 2026, at 21:34, André 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.
>>
>> Create special ABIs in order to make the table work for different archs:
>>
>>   - `memfd_secret` for archs that implements it
> 
> This was already there, so it's not really a new addition. We could
> also avoid this entirely and just rely on the stub implementation
> from kernel/sys_ni.c for those architectures that don't need it.
> They still get the macro definition, but it should be fine to define
> that for everyone.
> 
>>   - `cln3` for archs that use the common clone3 entry
>>   - `__cln3` for archs that use their own special entry point
> 
> I guess that's one way to do it. I would probably use the full
> clone3/__clone3 name here for consistency.
> 
>> Some archs only care about the native entry point and have no compat, so
>> create a option to never generate __SYSCALL_WITH_COMPAT() and always
>> generate __SYSCALL().
> 
> I don't see the purpose of this and would prefer to not add that
> extra option if the scripts works fine without it.
> 

Some archs don't define __SYSCALL_WITH_COMPAT() (see x86_64 for 
instance), so that's why I have added this option. But I can define 
__SYSCALL_WITH_COMPAT() as SYSCALL(nr, native) for those archs.

>>   usage() {
>> -	echo >&2 "usage: $0 [--abis ABIS] [--emit-nr] [--offset OFFSET]
>> [--prefix PREFIX] INFILE OUTFILE" >&2
>> +	echo >&2 "usage: $0 [--abis ABIS] [--emit-nr] [--offset OFFSET]
>> [--prefix PREFIX] [--common-tbl] INFILE OUTFILE" >&2
> 
> This needs to be changed to include the argument of common-tbl
> 
>> diff --git a/scripts/syscalltbl.sh b/scripts/syscalltbl.sh
>> index c4b1f85c2dd6..c0fd6af2d892 100755
>> --- a/scripts/syscalltbl.sh
>> +++ b/scripts/syscalltbl.sh
>> @@ -16,18 +16,23 @@
>>   set -e
>>
>>   usage() {
>> -	echo >&2 "usage: $0 [--abis ABIS] INFILE OUTFILE" >&2
>> +	echo >&2 "usage: $0 [--abis ABIS] [--common-tbl] [--no-compat] INFILE
> 
> same here
> 
>       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.