arch: add split IPC system calls where needed
authorArnd Bergmann <arnd@arndb.de>
Mon, 31 Dec 2018 13:38:26 +0000 (14:38 +0100)
committerArnd Bergmann <arnd@arndb.de>
Fri, 25 Jan 2019 16:22:50 +0000 (17:22 +0100)
The IPC system call handling is highly inconsistent across architectures,
some use sys_ipc, some use separate calls, and some use both.  We also
have some architectures that require passing IPC_64 in the flags, and
others that set it implicitly.

For the addition of a y2038 safe semtimedop() system call, I chose to only
support the separate entry points, but that requires first supporting
the regular ones with their own syscall numbers.

The IPC_64 is now implied by the new semctl/shmctl/msgctl system
calls even on the architectures that require passing it with the ipc()
multiplexer.

I'm not adding the new semtimedop() or semop() on 32-bit architectures,
those will get implemented using the new semtimedop_time64() version
that gets added along with the other time64 calls.
Three 64-bit architectures (powerpc, s390 and sparc) get semtimedop().

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
arch/m68k/kernel/syscalls/syscall.tbl
arch/mips/kernel/syscalls/syscall_o32.tbl
arch/powerpc/kernel/syscalls/syscall.tbl
arch/s390/kernel/syscalls/syscall.tbl
arch/sh/kernel/syscalls/syscall.tbl
arch/sparc/kernel/syscalls/syscall.tbl
arch/x86/entry/syscalls/syscall_32.tbl
arch/x86/entry/syscalls/syscall_64.tbl
include/uapi/asm-generic/unistd.h

index 85779d6ef935318e24f1b96cbbc002cff5fa8663..5354ba02eed2228ef3aeb873f5c09a533c9eaa1d 100644 (file)
 378    common  pwritev2                        sys_pwritev2
 379    common  statx                           sys_statx
 380    common  seccomp                         sys_seccomp
+# room for arch specific calls
+393    common  semget                          sys_semget
+394    common  semctl                          sys_semctl
+395    common  shmget                          sys_shmget
+396    common  shmctl                          sys_shmctl
+397    common  shmat                           sys_shmat
+398    common  shmdt                           sys_shmdt
+399    common  msgget                          sys_msgget
+400    common  msgsnd                          sys_msgsnd
+401    common  msgrcv                          sys_msgrcv
+402    common  msgctl                          sys_msgctl
index 3d5a47b80d2b88f0af95b4c2cdc93a752b095529..fa47ea8cc6ef04fb2db00e679ce325acc4f2dee7 100644 (file)
 366    o32     statx                           sys_statx
 367    o32     rseq                            sys_rseq
 368    o32     io_pgetevents                   sys_io_pgetevents               compat_sys_io_pgetevents
+# room for arch specific calls
+393    o32     semget                          sys_semget
+394    o32     semctl                          sys_semctl                      compat_sys_semctl
+395    o32     shmget                          sys_shmget
+396    o32     shmctl                          sys_shmctl                      compat_sys_shmctl
+397    o32     shmat                           sys_shmat                       compat_sys_shmat
+398    o32     shmdt                           sys_shmdt
+399    o32     msgget                          sys_msgget
+400    o32     msgsnd                          sys_msgsnd                      compat_sys_msgsnd
+401    o32     msgrcv                          sys_msgrcv                      compat_sys_msgrcv
+402    o32     msgctl                          sys_msgctl                      compat_sys_msgctl
index db3bbb8744afb7515f6a5c9410c3fd398a811f2f..7555874ce39cde8f1dc220daf169e93edf0616dc 100644 (file)
 363    spu     switch_endian                   sys_ni_syscall
 364    common  userfaultfd                     sys_userfaultfd
 365    common  membarrier                      sys_membarrier
+# 366-377 originally left for IPC, now unused
 378    nospu   mlock2                          sys_mlock2
 379    nospu   copy_file_range                 sys_copy_file_range
 380    common  preadv2                         sys_preadv2                     compat_sys_preadv2
 386    nospu   pkey_mprotect                   sys_pkey_mprotect
 387    nospu   rseq                            sys_rseq
 388    nospu   io_pgetevents                   sys_io_pgetevents               compat_sys_io_pgetevents
+# room for arch specific syscalls
+392    64      semtimedop                      sys_semtimedop
+393    common  semget                          sys_semget
+394    common  semctl                          sys_semctl                      compat_sys_semctl
+395    common  shmget                          sys_shmget
+396    common  shmctl                          sys_shmctl                      compat_sys_shmctl
+397    common  shmat                           sys_shmat                       compat_sys_shmat
+398    common  shmdt                           sys_shmdt
+399    common  msgget                          sys_msgget
+400    common  msgsnd                          sys_msgsnd                      compat_sys_msgsnd
+401    common  msgrcv                          sys_msgrcv                      compat_sys_msgrcv
+402    common  msgctl                          sys_msgctl                      compat_sys_msgctl
index 7413fd318e2a09077ea54f922ae4b5ac9cd28e5a..0bccb01c620280cfe1f15544f889e98b34299f84 100644 (file)
 381  common    kexec_file_load         sys_kexec_file_load             sys_kexec_file_load
 382  common    io_pgetevents           sys_io_pgetevents               compat_sys_io_pgetevents
 383  common    rseq                    sys_rseq                        sys_rseq
+# room for arch specific syscalls
+392    64      semtimedop              sys_semtimedop                  -
+393  common    semget                  sys_semget                      sys_semget
+394  common    semctl                  sys_semctl                      compat_sys_semctl
+395  common    shmget                  sys_shmget                      sys_shmget
+396  common    shmctl                  sys_shmctl                      compat_sys_shmctl
+397  common    shmat                   sys_shmat                       compat_sys_shmat
+398  common    shmdt                   sys_shmdt                       sys_shmdt
+399  common    msgget                  sys_msgget                      sys_msgget
+400  common    msgsnd                  sys_msgsnd                      compat_sys_msgsnd
+401  common    msgrcv                  sys_msgrcv                      compat_sys_msgrcv
+402  common    msgctl                  sys_msgctl                      compat_sys_msgctl
index a70db013dbc7700a22e54d49e90b27ccfdd52970..6d0b84e3ef2dae79ca6c65fa8a3d0ccf139147ab 100644 (file)
 381    common  preadv2                         sys_preadv2
 382    common  pwritev2                        sys_pwritev2
 383    common  statx                           sys_statx
+# room for arch specific syscalls
+393    common  semget                          sys_semget
+394    common  semctl                          sys_semctl
+395    common  shmget                          sys_shmget
+396    common  shmctl                          sys_shmctl
+397    common  shmat                           sys_shmat
+398    common  shmdt                           sys_shmdt
+399    common  msgget                          sys_msgget
+400    common  msgsnd                          sys_msgsnd
+401    common  msgrcv                          sys_msgrcv
+402    common  msgctl                          sys_msgctl
index c8c77c05ea9787fb484e76a786d1a65c5585a1f4..8c95803024222bc9fa64a792861336e69d1fdb73 100644 (file)
 359    common  pwritev2                sys_pwritev2                    compat_sys_pwritev2
 360    common  statx                   sys_statx
 361    common  io_pgetevents           sys_io_pgetevents               compat_sys_io_pgetevents
+# room for arch specific syscalls
+392    64      semtimedop                      sys_semtimedop
+393    common  semget                  sys_semget
+394    common  semctl                  sys_semctl                      compat_sys_semctl
+395    common  shmget                  sys_shmget
+396    common  shmctl                  sys_shmctl                      compat_sys_shmctl
+397    common  shmat                   sys_shmat                       compat_sys_shmat
+398    common  shmdt                   sys_shmdt
+399    common  msgget                  sys_msgget
+400    common  msgsnd                  sys_msgsnd                      compat_sys_msgsnd
+401    common  msgrcv                  sys_msgrcv                      compat_sys_msgrcv
+402    common  msgctl                  sys_msgctl                      compat_sys_msgctl
index 3cf7b533b3d1304b44b5eefe7ab55cc09398b2c2..2be1d0eb775408baee31543470501e73488dee66 100644 (file)
 384    i386    arch_prctl              sys_arch_prctl                  __ia32_compat_sys_arch_prctl
 385    i386    io_pgetevents           sys_io_pgetevents               __ia32_compat_sys_io_pgetevents
 386    i386    rseq                    sys_rseq                        __ia32_sys_rseq
+# don't use numbers 387 through 392, add new calls at the end
+393    i386    semget                  sys_semget                      __ia32_sys_semget
+394    i386    semctl                  sys_semctl                      __ia32_compat_sys_semctl
+395    i386    shmget                  sys_shmget                      __ia32_sys_shmget
+396    i386    shmctl                  sys_shmctl                      __ia32_compat_sys_shmctl
+397    i386    shmat                   sys_shmat                       __ia32_compat_sys_shmat
+398    i386    shmdt                   sys_shmdt                       __ia32_sys_shmdt
+399    i386    msgget                  sys_msgget                      __ia32_sys_msgget
+400    i386    msgsnd                  sys_msgsnd                      __ia32_compat_sys_msgsnd
+401    i386    msgrcv                  sys_msgrcv                      __ia32_compat_sys_msgrcv
+402    i386    msgctl                  sys_msgctl                      __ia32_compat_sys_msgctl
index f0b1709a5ffb2b0901d7f2492252876d17bc25a0..9d8128ef50a9ceed743a950687175d057a889094 100644 (file)
 332    common  statx                   __x64_sys_statx
 333    common  io_pgetevents           __x64_sys_io_pgetevents
 334    common  rseq                    __x64_sys_rseq
+# don't use numbers 387 through 423, add new calls after the last
+# 'common' entry
 
 #
 # x32-specific system call numbers start at 512 to avoid cache impact
index d90127298f12d1536b7594f7cdebd324f3fe4db3..509484dbfd5d5e5a49cc232a2bb7e61bd095ce6b 100644 (file)
@@ -740,6 +740,7 @@ __SC_COMP(__NR_io_pgetevents, sys_io_pgetevents, compat_sys_io_pgetevents)
 __SYSCALL(__NR_rseq, sys_rseq)
 #define __NR_kexec_file_load 294
 __SYSCALL(__NR_kexec_file_load,     sys_kexec_file_load)
+/* 295 through 402 are unassigned to sync up with generic numbers, don't use */
 
 #undef __NR_syscalls
 #define __NR_syscalls 295