From: "André Almeida" <andrealmeid@igalia.com>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Nathan Chancellor <nathan@kernel.org>,
Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
kernel-dev@igalia.com, "André Almeida" <andrealmeid@igalia.com>
Subject: [PATCH RFC v2 0/4] syscalls: Add a shared table for all archs
Date: Mon, 27 Jul 2026 23:47:01 -0300 [thread overview]
Message-ID: <20260727-tonyk-syscall_table-v2-0-95d4f1ee471f@igalia.com> (raw)
While implementing a new syscall, we need to wire up it's number to the arch
table. Since syscall number 403, all architectures are on sync regarding the
number (except alpha), which make things a lot easier but more repetitive as
well. Have a look at commit b36d4b6aa88 ("arch: hookup listns() system call"),
with 15 lines of mostly:
+470 common listns sys_listns
There's already a "common" table shared with a bunch of archs at
`scripts/syscall.tbl`, but due to historical reasons some archs will never be
able to move to this table and share all the numbers.
The generic table starts from 403 (clock_gettime64), the first common syscall.
The scripts are adapted to x86 specifics, like not generating the compat entry
point for x86_64 and placing x86_x32 things in the proper order. x32 is likely
to be dropped from Linux soon but for the moment I left the support there. If
this sounds good, next revision I can add the docs bits too.
I've tested this with x86 and arm64, by comparing the syscalls_*.h and
unistd_*.h files generated before and after this patchset and they are
identical.
Thanks!
André
Changes in v2:
- Managed to move to the real first common syscall: 403 (clock_gettime64)
- Added -no-compat option to be used with x86_64
- v1: https://patch.msgid.link/20260724-tonyk-syscall_table-v1-0-9c53188423da@igalia.com
---
André Almeida (4):
syscalls: Create unified partial table for all archs
syscalls: Add support for x86_x32 for the common syscall table
x86: Use common syscall table
scripts/syscall.tbl: Use the common table
arch/arm64/tools/syscall_32.tbl | 68 ----------------------------
arch/x86/entry/syscalls/Makefile | 16 ++++---
arch/x86/entry/syscalls/syscall_32.tbl | 68 ----------------------------
arch/x86/entry/syscalls/syscall_64.tbl | 48 --------------------
scripts/Makefile.asm-headers | 4 +-
scripts/syscall.tbl | 68 ----------------------------
scripts/syscall_common.tbl | 72 +++++++++++++++++++++++++++++
scripts/syscallhdr.sh | 83 ++++++++++++++++++++++++++++------
scripts/syscalltbl.sh | 35 +++++++++++---
9 files changed, 181 insertions(+), 281 deletions(-)
---
base-commit: af5e34a41cd607c00ef752e00331736570992354
change-id: 20260724-tonyk-syscall_table-928bbb1b26bb
Best regards,
--
André Almeida <andrealmeid@igalia.com>
next reply other threads:[~2026-07-28 2:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 2:47 André Almeida [this message]
2026-07-28 2:47 ` [PATCH RFC v2 1/4] syscalls: Create unified partial " André Almeida
2026-07-28 6:47 ` Arnd Bergmann
2026-07-28 2:47 ` [PATCH RFC v2 2/4] syscalls: Add support for x86_x32 for the common syscall table André Almeida
2026-07-28 2:47 ` [PATCH RFC v2 3/4] x86: Use " André Almeida
2026-07-28 2:47 ` [PATCH RFC v2 4/4] scripts/syscall.tbl: Use the common table André Almeida
2026-07-28 8:30 ` [PATCH RFC v2 0/4] syscalls: Add a shared table for all archs Arnd Bergmann
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=20260727-tonyk-syscall_table-v2-0-95d4f1ee471f@igalia.com \
--to=andrealmeid@igalia.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kernel-dev@igalia.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=tglx@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®