Skip to content

arch: convert everything to syscall.tbl

Arnd Bergmann linux-arch linux-arm-kernel linux-csky linux-hexagon linux-kbuild linux-kselftest linux-riscv linux-snps-arc lkml loongarch openrisc 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest17 patches 19 repliesIn review 12 of 17 applied

Patches in v1 12 of 17 applied

#Subject and filesSizeRepliesApplied
1/17syscalls: add generic scripts/syscall.tblscripts/syscall.tbl+388 -02 repliesApplied
2/17csky: drop asm/gpio.h wrapperarch/csky/include/asm/Kbuild+0 -13 repliesApplied
3/17um: don't generate asm/bpf_perf_event.harch/um/include/asm/Kbuild arch/um/include/asm/bpf_perf_event.h+3 -13 replies
4/17loongarch: avoid generating extra header filesarch/loongarch/include/asm/Kbuild+0 -160 repliesApplied
5/17kbuild: verify asm-generic header listinclude/asm-generic/Kbuild scripts/Makefile.asm-generic+1 -20 repliesApplied
6/17kbuild: add syscall table generation to scripts/Makefile.asm-headersMakefile scripts/Makefile.asm-generic scripts/Makefile.asm-headers+99 -590 repliesApplied
7/17clone3: drop __ARCH_WANT_SYS_CLONE3 macroarch/arc/include/uapi/asm/unistd.h arch/arm/include/asm/unistd.h arch/arm64/include/uapi/asm/unistd.h +21 more+13 -291 replyApplied
8/17arc: convert to generic syscall tablearch/arc/include/asm/Kbuild arch/arc/include/asm/unistd.h arch/arc/include/uapi/asm/Kbuild +4 more+30 -440 repliesApplied
9/17arm64: convert unistd_32.h to syscall.tbl formatarch/arm64/include/asm/Kbuild arch/arm64/include/asm/seccomp.h arch/arm64/include/asm/unistd.h +5 more+503 -9481 replyApplied
10/17arm64: generate 64-bit syscall.tblarch/arm64/include/asm/Kbuild arch/arm64/include/asm/seccomp.h arch/arm64/include/asm/unistd.h +6 more+17 -294 replies
11/17arm64: rework compat syscall macrosarch/arm64/include/asm/seccomp.h arch/arm64/include/asm/unistd.h arch/arm64/include/asm/vdso/compat_gettimeofday.h +2 more+21 -361 reply
12/17csky: convert to generic syscall tablearch/csky/include/asm/Kbuild arch/csky/include/asm/unistd.h arch/csky/include/uapi/asm/Kbuild +4 more+20 -132 replies
13/17hexagon: use new system call tablearch/hexagon/include/asm/Kbuild arch/hexagon/include/asm/unistd.h arch/hexagon/include/uapi/asm/Kbuild +3 more+25 -150 replies
14/17loongarch: convert to generic syscall tablearch/loongarch/include/asm/Kbuild arch/loongarch/include/asm/unistd.h arch/loongarch/include/uapi/asm/Kbuild +3 more+12 -30 repliesApplied
15/17nios2: convert to generic syscall tablearch/nios2/include/asm/Kbuild arch/nios2/include/asm/unistd.h arch/nios2/include/uapi/asm/Kbuild +4 more+26 -170 repliesApplied
16/17openrisc: convert to generic syscall tablearch/openrisc/include/asm/Kbuild arch/openrisc/include/asm/syscalls.h arch/openrisc/include/asm/unistd.h +5 more+25 -190 repliesApplied
17/17riscv: convert to generic syscall tablearch/riscv/include/asm/Kbuild arch/riscv/include/asm/syscall_table.h arch/riscv/include/asm/unistd.h +6 more+40 -440 repliesApplied

Reviews trailers per patch

6 of 17 patches have a Reviewed-by or Acked-by.

PatchGeert UytterhoevenCatalin MarinasGuo RenMasahiro Yamada
1/17
2/17A-b A-b R-b
3/17
4/17
5/17
6/17
7/17A-b
8/17
9/17A-b
10/17A-b
11/17A-b
12/17A-b
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 00/17] arch: convert everything to syscall.tbl

From: Arnd Bergmann <[email protected]>

There are eight architectures using include/uapi/asm-generic/unistd.h, which is still in an old format and not easily parsed by scripts. In addition, arm64 uses the old format for the 32-bit arm compat syscalls, despite them using the modern syscall.tbl format for the native calls.

As part of a larger cleanup, this converts all of them to use the new format with a shared file. I was planning to post this earlier, but ended up fixing up any system calls that have mismatched calling conventions between kernel and userspace first, as that seemed more important.

I originally tried adding the same arch/*/kernel/syscalls/Makefile as used on the other architectures, but ended up simplifying this in the process to use a single set of Makefile rules in scripts/Makefile.asm-headers, which in turn requires a few cleanups to arch/*/include/asm/Kbuild files.

Another prerequisite included in here is to make sys_clone3 get provided on all architectures, though it remains broken and returns -ENOSYS on hexagon, nios2, sh and sparc. To preserve the compile-time warning, I added an explicit #warning for those that are marked broken.

Once we have the new table format in place everywhere, additional improvements I have planned will be much easier, including:

- generating machine-readable syscall API descriptions for each syscall on each architecture

- type checking to ensure that the in-kernel prototype matches what userspace tools see

- unifying the last common bits of all tables so that new syscalls only need to get added in one place

- generate human-readable wrappers for native and compat syscalls on all architectures to replace the SYSCALL_DEFINEx() macros.

Arnd

Arnd Bergmann (17):
syscalls: add generic scripts/syscall.tbl
csky: drop asm/gpio.h wrapper
um: don't generate asm/bpf_perf_event.h
loongarch: avoid generating extra header files
kbuild: verify asm-generic header list
kbuild: add syscall table generation to scripts/Makefile.asm-headers
clone3: drop __ARCH_WANT_SYS_CLONE3 macro
arc: convert to generic syscall table
arm64: convert unistd_32.h to syscall.tbl format
arm64: generate 64-bit syscall.tbl
arm64: rework compat syscall macros
csky: convert to generic syscall table
hexagon: use new system call table
loongarch: convert to generic syscall table
nios2: convert to generic syscall table
openrisc: convert to generic syscall table
riscv: convert to generic syscall table

 Makefile                                      |   2 +-
 arch/alpha/include/asm/unistd.h               |   1 +
 arch/arc/include/asm/Kbuild                   |   2 +
 arch/arc/include/asm/unistd.h                 |  14 +
 arch/arc/include/uapi/asm/Kbuild              |   2 +
 arch/arc/include/uapi/asm/unistd.h            |  44 +-
 arch/arc/kernel/Makefile.syscalls             |   3 +
 arch/arc/kernel/sys.c                         |   5 +-
 arch/arm/include/asm/unistd.h                 |   1 -
 arch/arm64/include/asm/Kbuild                 |   8 +
 arch/arm64/include/asm/seccomp.h              |  13 +-
 arch/arm64/include/asm/unistd.h               |  22 +-
 arch/arm64/include/asm/unistd32.h             | 939 +-----------------
 .../include/asm/vdso/compat_gettimeofday.h    |  12 +-
 arch/arm64/include/uapi/asm/Kbuild            |   1 +
 arch/arm64/include/uapi/asm/unistd.h          |  25 +-
 arch/arm64/kernel/Makefile.syscalls           |   6 +
 arch/arm64/kernel/signal32.c                  |   2 +-
 arch/arm64/kernel/sigreturn32.S               |  18 +-
 arch/arm64/kernel/sys.c                       |   6 +-
 arch/arm64/kernel/sys32.c                     |  17 +-
 arch/arm64/kernel/syscall.c                   |   3 +-
 arch/arm64/tools/Makefile                     |   6 +-
 arch/arm64/tools/syscall_32.tbl               | 476 +++++++++
 arch/arm64/tools/syscall_64.tbl               |   1 +
 arch/csky/include/asm/Kbuild                  |   3 +-
 arch/csky/include/asm/unistd.h                |   3 +
 arch/csky/include/uapi/asm/Kbuild             |   2 +
 arch/csky/include/uapi/asm/unistd.h           |  15 +-
 arch/csky/kernel/Makefile.syscalls            |   4 +
 arch/csky/kernel/syscall_table.c              |   4 +-
 arch/hexagon/include/asm/Kbuild               |   2 +
 arch/hexagon/include/asm/unistd.h             |  10 +
 arch/hexagon/include/uapi/asm/Kbuild          |   2 +
 arch/hexagon/include/uapi/asm/unistd.h        |  13 +-
 arch/hexagon/kernel/Makefile.syscalls         |   3 +
 arch/hexagon/kernel/syscalltab.c              |   8 +-
 arch/loongarch/include/asm/Kbuild             |  17 +-
 arch/loongarch/include/asm/unistd.h           |   2 +
 arch/loongarch/include/uapi/asm/Kbuild        |   2 +
 arch/loongarch/include/uapi/asm/unistd.h      |   4 +-
 arch/loongarch/kernel/Makefile.syscalls       |   4 +
 arch/loongarch/kernel/syscall.c               |   3 +-
 arch/m68k/include/asm/unistd.h                |   1 -
 arch/microblaze/include/asm/unistd.h          |   2 +
 arch/mips/include/asm/unistd.h                |   1 -
 arch/nios2/include/asm/Kbuild                 |   2 +
 arch/nios2/include/asm/unistd.h               |  10 +
 arch/nios2/include/uapi/asm/Kbuild            |   2 +
 arch/nios2/include/uapi/asm/unistd.h          |  14 +-
 arch/nios2/kernel/Makefile.syscalls           |   3 +
 arch/nios2/kernel/syscall_table.c             |   6 +-
 arch/openrisc/include/asm/Kbuild              |   2 +
 arch/openrisc/include/asm/syscalls.h          |   4 -
 arch/openrisc/include/asm/unistd.h            |   8 +
 arch/openrisc/include/uapi/asm/Kbuild         |   2 +
 arch/openrisc/include/uapi/asm/unistd.h       |  15 +-
 arch/openrisc/kernel/Makefile.syscalls        |   3 +
 arch/openrisc/kernel/sys_call_table.c         |   9 +-
 arch/parisc/include/asm/unistd.h              |   1 -
 arch/powerpc/include/asm/unistd.h             |   1 -
 arch/riscv/include/asm/Kbuild                 |   3 +
 arch/riscv/include/asm/syscall_table.h        |   7 +
 arch/riscv/include/asm/unistd.h               |  13 +-
 arch/riscv/include/uapi/asm/Kbuild            |   2 +
 arch/riscv/include/uapi/asm/unistd.h          |  41 +-
 arch/riscv/kernel/Makefile.syscalls           |   4 +
 arch/riscv/kernel/compat_syscall_table.c      |   6 +-
 arch/riscv/kernel/syscall_table.c             |   6 +-
 arch/s390/include/asm/unistd.h                |   1 -
 arch/sh/include/asm/unistd.h                  |   2 +
 arch/sparc/include/asm/unistd.h               |   2 +
 arch/um/include/asm/Kbuild                    |   1 -
 arch/um/include/asm/bpf_perf_event.h          |   3 +
 arch/x86/include/asm/unistd.h                 |   1 -
 arch/xtensa/include/asm/unistd.h              |   1 -
 include/asm-generic/Kbuild                    |   1 -
 include/uapi/asm-generic/unistd.h             |   4 -
 kernel/fork.c                                 |   8 +-
 kernel/sys_ni.c                               |   2 -
 scripts/Makefile.asm-generic                  |  58 --
 scripts/Makefile.asm-headers                  |  98 ++
 scripts/syscall.tbl                           | 404 ++++++++
 tools/arch/arm64/include/uapi/asm/unistd.h    |   1 -
 .../arch/loongarch/include/uapi/asm/unistd.h  |   1 -
 tools/include/uapi/asm-generic/unistd.h       |   4 -
 86 files changed, 1219 insertions(+), 1271 deletions(-)
 create mode 100644 arch/arc/include/asm/unistd.h
 create mode 100644 arch/arc/kernel/Makefile.syscalls
 create mode 100644 arch/arm64/kernel/Makefile.syscalls
 create mode 100644 arch/arm64/tools/syscall_32.tbl
 create mode 120000 arch/arm64/tools/syscall_64.tbl
 create mode 100644 arch/csky/kernel/Makefile.syscalls
 create mode 100644 arch/hexagon/include/asm/unistd.h
 create mode 100644 arch/hexagon/kernel/Makefile.syscalls
 create mode 100644 arch/loongarch/kernel/Makefile.syscalls
 create mode 100644 arch/nios2/include/asm/unistd.h
 create mode 100644 arch/nios2/kernel/Makefile.syscalls
 create mode 100644 arch/openrisc/include/asm/unistd.h
 create mode 100644 arch/openrisc/kernel/Makefile.syscalls
 create mode 100644 arch/riscv/include/asm/syscall_table.h
 create mode 100644 arch/riscv/kernel/Makefile.syscalls
 create mode 100644 arch/um/include/asm/bpf_perf_event.h
 delete mode 100644 scripts/Makefile.asm-generic
 create mode 100644 scripts/Makefile.asm-headers
 create mode 100644 scripts/syscall.tbl
Signature · 36 lines
2.39.2

Cc: Masahiro Yamada <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Nicolas Schier <[email protected]>
Cc: Vineet Gupta <[email protected]>
Cc: Russell King <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Guo Ren <[email protected]>
Cc: Brian Cain <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: WANG Xuerui <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Jonas Bonn <[email protected]>
Cc: Stefan Kristiansson <[email protected]>
Cc: Stafford Horne <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Palmer Dabbelt <[email protected]>
Cc: Albert Ou <[email protected]>
Cc: Rich Felker <[email protected]>
Cc: John Paul Adrian Glaubitz <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Andreas Larsson <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]