arch: add split IPC system calls where needed

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>
This commit is contained in:
Arnd Bergmann 2018-12-31 14:38:26 +01:00
Родитель 275f22148e
Коммит 0d6040d468
9 изменённых файлов: 84 добавлений и 0 удалений

Просмотреть файл

@ -388,3 +388,14 @@
378 common pwritev2 sys_pwritev2 378 common pwritev2 sys_pwritev2
379 common statx sys_statx 379 common statx sys_statx
380 common seccomp sys_seccomp 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

Просмотреть файл

@ -380,3 +380,14 @@
366 o32 statx sys_statx 366 o32 statx sys_statx
367 o32 rseq sys_rseq 367 o32 rseq sys_rseq
368 o32 io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 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

Просмотреть файл

@ -414,6 +414,7 @@
363 spu switch_endian sys_ni_syscall 363 spu switch_endian sys_ni_syscall
364 common userfaultfd sys_userfaultfd 364 common userfaultfd sys_userfaultfd
365 common membarrier sys_membarrier 365 common membarrier sys_membarrier
# 366-377 originally left for IPC, now unused
378 nospu mlock2 sys_mlock2 378 nospu mlock2 sys_mlock2
379 nospu copy_file_range sys_copy_file_range 379 nospu copy_file_range sys_copy_file_range
380 common preadv2 sys_preadv2 compat_sys_preadv2 380 common preadv2 sys_preadv2 compat_sys_preadv2
@ -425,3 +426,15 @@
386 nospu pkey_mprotect sys_pkey_mprotect 386 nospu pkey_mprotect sys_pkey_mprotect
387 nospu rseq sys_rseq 387 nospu rseq sys_rseq
388 nospu io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 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

Просмотреть файл

@ -391,3 +391,15 @@
381 common kexec_file_load sys_kexec_file_load sys_kexec_file_load 381 common kexec_file_load sys_kexec_file_load sys_kexec_file_load
382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 382 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents
383 common rseq sys_rseq sys_rseq 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

Просмотреть файл

@ -391,3 +391,14 @@
381 common preadv2 sys_preadv2 381 common preadv2 sys_preadv2
382 common pwritev2 sys_pwritev2 382 common pwritev2 sys_pwritev2
383 common statx sys_statx 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

Просмотреть файл

@ -407,3 +407,15 @@
359 common pwritev2 sys_pwritev2 compat_sys_pwritev2 359 common pwritev2 sys_pwritev2 compat_sys_pwritev2
360 common statx sys_statx 360 common statx sys_statx
361 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents 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

Просмотреть файл

@ -398,3 +398,14 @@
384 i386 arch_prctl sys_arch_prctl __ia32_compat_sys_arch_prctl 384 i386 arch_prctl sys_arch_prctl __ia32_compat_sys_arch_prctl
385 i386 io_pgetevents sys_io_pgetevents __ia32_compat_sys_io_pgetevents 385 i386 io_pgetevents sys_io_pgetevents __ia32_compat_sys_io_pgetevents
386 i386 rseq sys_rseq __ia32_sys_rseq 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

Просмотреть файл

@ -343,6 +343,8 @@
332 common statx __x64_sys_statx 332 common statx __x64_sys_statx
333 common io_pgetevents __x64_sys_io_pgetevents 333 common io_pgetevents __x64_sys_io_pgetevents
334 common rseq __x64_sys_rseq 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 # x32-specific system call numbers start at 512 to avoid cache impact

Просмотреть файл

@ -740,6 +740,7 @@ __SC_COMP(__NR_io_pgetevents, sys_io_pgetevents, compat_sys_io_pgetevents)
__SYSCALL(__NR_rseq, sys_rseq) __SYSCALL(__NR_rseq, sys_rseq)
#define __NR_kexec_file_load 294 #define __NR_kexec_file_load 294
__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load) __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 #undef __NR_syscalls
#define __NR_syscalls 295 #define __NR_syscalls 295