Re: [PATCH RFC v2 0/4] syscalls: Add a shared table for all archs

"Arnd Bergmann" <[email protected]> Tue, 28 Jul 2026 10:30:52 +0200
Newsgroups org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue, Jul 28, 2026, at 04:47, Andr=C3=A9 Almeida wrote:
> The generic table starts from 403 (clock_gettime64), the first common =
syscall.
> The scripts are adapted to x86 specifics, like not generating the comp=
at entry
> point for x86_64 and placing x86_x32 things in the proper order. x32 i=
s likely
> to be dropped from Linux soon but for the moment I left the support th=
ere. If
> this sounds good, next revision I can add the docs bits too.

It may be easier to skip x32/x86-64 for the moment and focus on
the architectures that we know need small changes (mips, powerpc,
alpha).

The patch at
https://lore.kernel.org/all/[email protected]/
still hasn't been picked up yet. If your series is done before
we actually remove x32, we may still need to add a temporary
workaround for it, but it would be easier to avoid that altogether
by waiting a bit.

> 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.

I've had another look at what I tried previously, here is the list of
things we have to figure out to do this properly across all
architectures:

- separate offsets for base and common table on alpha. Maybe we can
  just process the two tables separately here and combine the
  output files afterwards?
- special __sys_clone3 entry points on alpha, m68k, mips, parisc and
  sparc.
- combine mips n32/n64 tables into a single file with regular
  use of compat entries for n32, in order to handle compat entry
  for the common calls (epoll_pwait2, pselect_time64, ppoll_time64,
  io_pgetevents_time64, recvmmsg_time64, rt_sigtimedwait_time64)
- come up with a solution for nospu syscalls on powerpc (clone3,
  set_mempolicy_home_node, rseq_slice_yield). Possibly dropping support
  for spu syscalls entirely, making all common syscalls implicitly
  nospu, incorporating this in the common table, or handling this
  in the syscall implementation where necessary.
  note that newlib still supports spu syscalls, but only lists
  numbers up to __NR_sync_file_range2 (#308). gcc-10 and higher
  no longer support SPU at all.

       Arnd