From: sashiko-bot@kernel.org
To: "André Almeida" <andrealmeid@igalia.com>
Cc: "Christian Borntraeger" <borntraeger@linux.ibm.vom>,
"Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
linux-s390@vger.kernel.org
Subject: Re: [PATCH v5 03/13] scripts/syscall.tbl: Use the common table
Date: Wed, 12 Aug 2026 17:53:54 +0000 [thread overview]
Message-ID: <20260812175354.EFD271F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812-tonyk-syscall_table-v5-3-3d383927c609@igalia.com>
Thank you for your contribution! Sashiko AI review found 5 potential issue(s) to consider:
- [High] POSIX shell syntax violation (`bashism`) causes build failure.
- [High] Sequential table processing breaks strict monotonicity check, preventing architectures from adding new local syscalls.
- [High] Sequential table processing silently truncates `__NR_syscalls`.
- [Medium] Tooling Breakage: `tools/perf` fails to parse common syscalls for generic architectures.
- [Medium] Missing Make dependency for `syscall_common.tbl` breaks incremental builds.
--
--- Patch [3]: [PATCH v5 03/13] scripts/syscall.tbl: Use the common table ---
commit e407e18fccaf1e26e59809a57f9bedc05e1b414e
Author: André Almeida <andrealmeid@igalia.com>
scripts/syscall.tbl: Use the common table
This commit removes duplicated code by moving common syscall numbers out of
arch/arm64/tools/syscall_32.tbl and scripts/syscall.tbl to a shared common
table.
> diff --git a/scripts/Makefile.asm-headers b/scripts/Makefile.asm-headers
> index 8a4856e741803..681713f240cc1 100644
> --- a/scripts/Makefile.asm-headers
> +++ b/scripts/Makefile.asm-headers
> @@ -15,9 +15,10 @@ all:
>
> src := $(srctree)/$(subst /generated,,$(obj))
>
> -syscall_abis_32 += common,32
> -syscall_abis_64 += common,64
> +syscall_abis_32 += clone3,common,32
> +syscall_abis_64 += clone3,common,64
> syscalltbl := $(srctree)/scripts/syscall.tbl
> +syscalltbl_common := $(srctree)/scripts/syscall_common.tbl
[Severity: Medium]
Since syscalltbl_common is introduced here and passed to the generator scripts,
should it also be added to the Make prerequisites?
Currently, targets like unistd_%.h only depend on $(syscalltbl) and $(syshdr):
$(obj)/unistd_%.h: $(syscalltbl) $(syshdr) FORCE
$(call if_changed,syshdr)
Without adding $(syscalltbl_common) to these dependencies, Kbuild won't trigger
a rebuild of the headers when the common table changes, which can break
incremental builds.
> syshdr-args := --emit-nr
>
> # let architectures override $(syscall_abis_%) and $(syscalltbl)
[ ... ]
> @@ -58,14 +59,14 @@ quiet_cmd_remove = REMOVE $(unwanted)
> cmd_remove = rm -f $(unwanted)
>
> quiet_cmd_syshdr = SYSHDR $@
> - cmd_syshdr = $(CONFIG_SHELL) $(syshdr) \
> + cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --common-tbl $(syscalltbl_common) \
[Severity: High]
Does calling syscallhdr.sh here break on systems where $(CONFIG_SHELL) is dash
(like Debian/Ubuntu)?
scripts/syscallhdr.sh uses a #!/bin/sh shebang but contains bash-specific
process substitution:
done < <(grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$input")
On POSIX-compliant shells, this causes a syntax error ('redirection
unexpected') and aborts the kernel build.
Additionally, does passing --common-tbl silently truncate __NR_syscalls?
When syscallhdr.sh processes the local table first, the global "max" variable
tracks the highest local syscall. But when it processes the common table
afterward, it unconditionally overwrites it:
max=$nr
If an architecture has a local syscall higher than the common table's highest
syscall, max gets incorrectly capped. This results in an incorrect
__NR_syscalls value.
> $(if $(syshdr-args-$*),$(syshdr-args-$*),$(syshdr-args)) \
> $(if $(syscall_compat),--prefix "compat$*_") \
> --abis $(subst $(space),$(comma),$(strip $(syscall_abis_$*))) \
> $< $@
>
> quiet_cmd_systbl = SYSTBL $@
> - cmd_systbl = $(CONFIG_SHELL) $(systbl) \
> + cmd_systbl = $(CONFIG_SHELL) $(systbl) --common-tbl $(syscalltbl_common) \
[Severity: High]
Similar to the syshdr script, syscalltbl.sh also contains a bashism:
done < <(grep -E "^[0-9]+[[:space:]]+$abis" "$input")
Will this sequential processing also break strict monotonicity checks for
architectures adding new local syscalls?
syscalltbl.sh uses a global "nxt" variable to ensure numerical sorting.
If an architecture adds a local syscall > 403 (e.g., 472), "nxt" advances
to 473. When it then processes the common table starting at 403, the check:
if [ $nxt -gt $nr ]; then
echo "error: $input: syscall table is not sorted..."
will trigger (473 > 403) and abort the build.
> $(if $(systbl-args-$*),$(systbl-args-$*),$(systbl-args)) \
> --abis $(subst $(space),$(comma),$(strip $(syscall_abis_$*))) \
> $< $@
[ ... ]
> diff --git a/scripts/syscall.tbl b/scripts/syscall.tbl
> index 7a42b32b65776..ee828d03094ed 100644
> --- a/scripts/syscall.tbl
> +++ b/scripts/syscall.tbl
> @@ -344,71 +344,3 @@
> 293 common rseq sys_rseq
> 294 common kexec_file_load sys_kexec_file_load
> # 295 through 402 are unassigned to sync up with generic numbers don't use
> -403 32 clock_gettime64 sys_clock_gettime
[Severity: Medium]
Does removing syscalls 403 through 471 from this file break perf trace?
The perf tooling parses this file directly to generate syscall name mappings:
tools/perf/trace/beauty/syscalltbl.sh:
build_tables "$tools_dir/scripts/syscall.tbl" "$outfile"
Since tools/perf/trace/beauty/syscalltbl.sh isn't updated to parse the new
syscall_common.tbl, perf trace will lose name resolution for syscalls >= 403
on architectures using the generic table.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812-tonyk-syscall_table-v5-0-3d383927c609@igalia.com?part=3
next prev parent reply other threads:[~2026-08-12 17:53 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 17:38 [PATCH v5 00/13] syscalls: Add a shared table for all archs André Almeida
2026-08-12 17:38 ` [PATCH v5 01/13] syscalls: Make --abis parsing more robust André Almeida
2026-08-12 17:50 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 02/13] syscalls: Create unified partial table for all archs André Almeida
2026-08-12 17:49 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 03/13] scripts/syscall.tbl: Use the common table André Almeida
2026-08-12 17:53 ` sashiko-bot [this message]
2026-08-12 17:38 ` [PATCH v5 04/13] arm: Use the common syscall table André Almeida
2026-08-12 18:10 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 05/13] s390: " André Almeida
2026-08-12 17:50 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 06/13] sparc: " André Almeida
2026-08-12 17:48 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 07/13] mips: Remove duplicated syscallnr.sh André Almeida
2026-08-12 17:48 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 08/13] mips: Get rid of custom mips ABIs for syscall tables André Almeida
2026-08-12 17:49 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 09/13] mips: Use the common syscall table André Almeida
2026-08-12 17:53 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 10/13] syscalls: Add an option for offsetting the common table André Almeida
2026-08-12 17:56 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 11/13] alpha: Define entry point for set_mempolicy_home_node syscall André Almeida
2026-08-12 17:57 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 12/13] alpha: Remove alpha_ prefix from custom syscall entries André Almeida
2026-08-12 17:58 ` sashiko-bot
2026-08-12 17:38 ` [PATCH v5 13/13] alpha: Use the common syscall table André Almeida
2026-08-12 18:01 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260812175354.EFD271F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=andrealmeid@igalia.com \
--cc=borntraeger@linux.ibm.vom \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.