Re: [PATCH 2/2] arch: add pidfd and io_uring syscalls everywhere

From: Arnd Bergmann
Date: Sun Mar 31 2019 - 12:28:50 EST


On Sun, Mar 31, 2019 at 5:47 PM Michael Ellerman <mpe@xxxxxxxxxxxxxx> wrote:
>
> Arnd Bergmann <arnd@xxxxxxxx> writes:
> > Add the io_uring and pidfd_send_signal system calls to all architectures.
> >
> > These system calls are designed to handle both native and compat tasks,
> > so all entries are the same across architectures, only arm-compat and
> > the generic tale still use an old format.
> >
> > Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> > ---
> > arch/alpha/kernel/syscalls/syscall.tbl | 4 ++++
> > arch/arm/tools/syscall.tbl | 4 ++++
> > arch/arm64/include/asm/unistd.h | 2 +-
> > arch/arm64/include/asm/unistd32.h | 8 ++++++++
> > arch/ia64/kernel/syscalls/syscall.tbl | 4 ++++
> > arch/m68k/kernel/syscalls/syscall.tbl | 4 ++++
> > arch/microblaze/kernel/syscalls/syscall.tbl | 4 ++++
> > arch/mips/kernel/syscalls/syscall_n32.tbl | 4 ++++
> > arch/mips/kernel/syscalls/syscall_n64.tbl | 4 ++++
> > arch/mips/kernel/syscalls/syscall_o32.tbl | 4 ++++
> > arch/parisc/kernel/syscalls/syscall.tbl | 4 ++++
> > arch/powerpc/kernel/syscalls/syscall.tbl | 4 ++++
>
> Have you done any testing?
>
> I'd rather not wire up syscalls that have never been tested at all on
> powerpc.

No, I have not. I did review the system calls carefully and added the first
patch to fix the bug on x86 compat mode before adding the same bug
on the other compat architectures though ;-)

Generally, my feeling is that adding system calls is not fundamentally
different from adding other ABIs, and we should really do it at
the same time across all architectures, rather than waiting for each
maintainer to get around to reviewing and testing the new calls
first. This is not a problem on powerpc, but a lot of other architectures
are less active, which is how we have always ended up with
different sets of system calls across architectures.

The problem here is that this makes it harder for the C library to
know when a system call is guaranteed to be available. glibc
still needs a feature test for newly added syscalls to see if they
are working (they might be backported to an older kernel, or
disabled), but whenever the minimum kernel version is increased,
it makes sense to drop those checks and assume non-optional
system calls will work if they were part of that minimum version.

In the future, I'd hope that any new system calls get added
right away on all architectures when they land (it was a bit
tricky this time, because I still did a bunch of reworks that
conflicted with the new calls). Bugs will happen of course, but
I think adding them sooner makes it more likely to catch those
bugs early on so we have a chance to fix them properly,
and need fewer arch specific workarounds (ideally none)
for system calls.

Arnd