mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC 0/4] syscalls: Add a shared table for all archs
@ 2026-07-24 20:00 André Almeida
  2026-07-24 20:00 ` [PATCH RFC 1/4] syscalls: Create unified partial " André Almeida
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: André Almeida @ 2026-07-24 20:00 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
	H. Peter Anvin, Nathan Chancellor, Arnd Bergmann
  Cc: linux-kernel, linux-kbuild, kernel-dev, André Almeida

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.

In order to make things a bit easier, this patchset creates yet another common
syscall table with a subset of numbers that are already being shared among the
syscalls. I've started from syscall 442 (mount_setattr) to avoid dealing with
compat syscalls for now, but this already have the benefit of adding or rebasing
a new syscall much easier. If this work sounds reasonable I can later add more
syscalls, removing more repetitive lines from the code.

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é

---
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        | 30 -------------
 arch/x86/entry/syscalls/Makefile       | 15 ++++---
 arch/x86/entry/syscalls/syscall_32.tbl | 30 -------------
 arch/x86/entry/syscalls/syscall_64.tbl | 30 -------------
 scripts/Makefile.asm-headers           |  4 +-
 scripts/syscall.tbl                    | 30 -------------
 scripts/syscall_common.tbl             | 34 ++++++++++++++
 scripts/syscallhdr.sh                  | 81 +++++++++++++++++++++++++++++-----
 scripts/syscalltbl.sh                  | 26 ++++++++---
 9 files changed, 134 insertions(+), 146 deletions(-)
---
base-commit: af5e34a41cd607c00ef752e00331736570992354
change-id: 20260724-tonyk-syscall_table-928bbb1b26bb

Best regards,
--  
André Almeida <andrealmeid@igalia.com>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-07-25  8:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-24 20:00 [PATCH RFC 0/4] syscalls: Add a shared table for all archs André Almeida
2026-07-24 20:00 ` [PATCH RFC 1/4] syscalls: Create unified partial " André Almeida
2026-07-24 20:09   ` Arnd Bergmann
2026-07-24 20:18     ` André Almeida
2026-07-24 20:25       ` Arnd Bergmann
2026-07-24 21:22         ` H. Peter Anvin
2026-07-25  8:25           ` Arnd Bergmann
2026-07-24 20:00 ` [PATCH RFC 2/4] syscalls: Add support for x86_x32 for the common syscall table André Almeida
2026-07-24 20:16   ` Arnd Bergmann
2026-07-24 20:00 ` [PATCH RFC 3/4] x86: Use " André Almeida
2026-07-24 20:00 ` [PATCH RFC 4/4] scripts/syscall.tbl: Use the common table André Almeida

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®