Skip to content

Commit fd659cc

Browse files
committed
Merge tag 'y2038-syscall-cleanup' of git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground into timers/2038
Pull preparatory work for y2038 changes from Arnd Bergmann: System call unification and cleanup The system call tables have diverged a bit over the years, and a number of the recent additions never made it into all architectures, for one reason or another. This is an attempt to clean it up as far as we can without breaking compatibility, doing a number of steps: - Add system calls that have not yet been integrated into all architectures but that we definitely want there. This includes {,f}statfs64() and get{eg,eu,g,p,u,pp}id() on alpha, which have been missing traditionally. - The s390 compat syscall handling is cleaned up to be more like what we do on other architectures, while keeping the 31-bit pointer extension. This was merged as a shared branch by the s390 maintainers and is included here in order to base the other patches on top. - Add the separate ipc syscalls on all architectures that traditionally only had sys_ipc(). This version is done without support for IPC_OLD that is we have in sys_ipc. The new semtimedop_time64 syscall will only be added here, not in sys_ipc - Add syscall numbers for a couple of syscalls that we probably don't need everywhere, in particular pkey_* and rseq, for the purpose of symmetry: if it's in asm-generic/unistd.h, it makes sense to have it everywhere. I expect that any future system calls will get assigned on all platforms together, even when they appear to be specific to a single architecture. - Prepare for having the same system call numbers for any future calls. In combination with the generated tables, this hopefully makes it easier to add new calls across all architectures together. All of the above are technically separate from the y2038 work, but are done as preparation before we add the new 64-bit time_t system calls everywhere, providing a common baseline set of system calls. I expect that glibc and other libraries that want to use 64-bit time_t will require linux-5.1 kernel headers for building in the future, and at a much later point may also require linux-5.1 or a later version as the minimum kernel at runtime. Having a common baseline then allows the removal of many architecture or kernel version specific workarounds.
2 parents 74e9671 + 805089c commit fd659cc

File tree

46 files changed

+608
-1118
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+608
-1118
lines changed

arch/alpha/include/asm/unistd.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,4 @@
1919
#define __ARCH_WANT_SYS_VFORK
2020
#define __ARCH_WANT_SYS_CLONE
2121

22-
/*
23-
* Ignore legacy syscalls that we don't use.
24-
*/
25-
#define __IGNORE_alarm
26-
#define __IGNORE_creat
27-
#define __IGNORE_getegid
28-
#define __IGNORE_geteuid
29-
#define __IGNORE_getgid
30-
#define __IGNORE_getpid
31-
#define __IGNORE_getppid
32-
#define __IGNORE_getuid
33-
#define __IGNORE_pause
34-
#define __IGNORE_time
35-
#define __IGNORE_utime
36-
#define __IGNORE_umount2
37-
38-
/* Alpha doesn't have protection keys. */
39-
#define __IGNORE_pkey_mprotect
40-
#define __IGNORE_pkey_alloc
41-
#define __IGNORE_pkey_free
42-
4322
#endif /* _ALPHA_UNISTD_H */

arch/alpha/include/uapi/asm/unistd.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
#ifndef _UAPI_ALPHA_UNISTD_H
33
#define _UAPI_ALPHA_UNISTD_H
44

5+
/* These are traditionally the names linux-alpha uses for
6+
* the two otherwise generic system calls */
7+
#define __NR_umount __NR_umount2
8+
#define __NR_osf_shmat __NR_shmat
9+
10+
/* These return an extra value but can be used as aliases */
11+
#define __NR_getpid __NR_getxpid
12+
#define __NR_getuid __NR_getxuid
13+
#define __NR_getgid __NR_getxgid
14+
515
#include <asm/unistd_32.h>
616

717
#endif /* _UAPI_ALPHA_UNISTD_H */

arch/alpha/kernel/syscalls/syscall.tbl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
19 common lseek sys_lseek
3030
20 common getxpid sys_getxpid
3131
21 common osf_mount sys_osf_mount
32-
22 common umount sys_umount
32+
22 common umount2 sys_umount
3333
23 common setuid sys_setuid
3434
24 common getxuid sys_getxuid
3535
25 common exec_with_loader sys_ni_syscall
@@ -174,17 +174,17 @@
174174
187 common osf_alt_sigpending sys_ni_syscall
175175
188 common osf_alt_setsid sys_ni_syscall
176176
199 common osf_swapon sys_swapon
177-
200 common msgctl sys_msgctl
177+
200 common msgctl sys_old_msgctl
178178
201 common msgget sys_msgget
179179
202 common msgrcv sys_msgrcv
180180
203 common msgsnd sys_msgsnd
181-
204 common semctl sys_semctl
181+
204 common semctl sys_old_semctl
182182
205 common semget sys_semget
183183
206 common semop sys_semop
184184
207 common osf_utsname sys_osf_utsname
185185
208 common lchown sys_lchown
186-
209 common osf_shmat sys_shmat
187-
210 common shmctl sys_shmctl
186+
209 common shmat sys_shmat
187+
210 common shmctl sys_old_shmctl
188188
211 common shmdt sys_shmdt
189189
212 common shmget sys_shmget
190190
213 common osf_mvalid sys_ni_syscall
@@ -451,3 +451,13 @@
451451
520 common preadv2 sys_preadv2
452452
521 common pwritev2 sys_pwritev2
453453
522 common statx sys_statx
454+
523 common io_pgetevents sys_io_pgetevents
455+
524 common pkey_mprotect sys_pkey_mprotect
456+
525 common pkey_alloc sys_pkey_alloc
457+
526 common pkey_free sys_pkey_free
458+
527 common rseq sys_rseq
459+
528 common statfs64 sys_statfs64
460+
529 common fstatfs64 sys_fstatfs64
461+
530 common getegid sys_getegid
462+
531 common geteuid sys_geteuid
463+
532 common getppid sys_getppid

arch/arm/include/asm/unistd.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
* Unimplemented (or alternatively implemented) syscalls
4646
*/
4747
#define __IGNORE_fadvise64_64
48-
#define __IGNORE_migrate_pages
4948

5049
#ifdef __ARM_EABI__
5150
/*

arch/arm/tools/syscall.tbl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,15 +314,15 @@
314314
297 common recvmsg sys_recvmsg
315315
298 common semop sys_semop sys_oabi_semop
316316
299 common semget sys_semget
317-
300 common semctl sys_semctl
317+
300 common semctl sys_old_semctl
318318
301 common msgsnd sys_msgsnd
319319
302 common msgrcv sys_msgrcv
320320
303 common msgget sys_msgget
321-
304 common msgctl sys_msgctl
321+
304 common msgctl sys_old_msgctl
322322
305 common shmat sys_shmat
323323
306 common shmdt sys_shmdt
324324
307 common shmget sys_shmget
325-
308 common shmctl sys_shmctl
325+
308 common shmctl sys_old_shmctl
326326
309 common add_key sys_add_key
327327
310 common request_key sys_request_key
328328
311 common keyctl sys_keyctl
@@ -414,3 +414,5 @@
414414
397 common statx sys_statx
415415
398 common rseq sys_rseq
416416
399 common io_pgetevents sys_io_pgetevents
417+
400 common migrate_pages sys_migrate_pages
418+
401 common kexec_file_load sys_kexec_file_load

arch/arm64/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
4545
#define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)
4646

47-
#define __NR_compat_syscalls 400
47+
#define __NR_compat_syscalls 402
4848
#endif
4949

5050
#define __ARCH_WANT_SYS_CLONE

arch/arm64/include/asm/unistd32.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,23 +622,23 @@ __SYSCALL(__NR_semop, sys_semop)
622622
#define __NR_semget 299
623623
__SYSCALL(__NR_semget, sys_semget)
624624
#define __NR_semctl 300
625-
__SYSCALL(__NR_semctl, compat_sys_semctl)
625+
__SYSCALL(__NR_semctl, compat_sys_old_semctl)
626626
#define __NR_msgsnd 301
627627
__SYSCALL(__NR_msgsnd, compat_sys_msgsnd)
628628
#define __NR_msgrcv 302
629629
__SYSCALL(__NR_msgrcv, compat_sys_msgrcv)
630630
#define __NR_msgget 303
631631
__SYSCALL(__NR_msgget, sys_msgget)
632632
#define __NR_msgctl 304
633-
__SYSCALL(__NR_msgctl, compat_sys_msgctl)
633+
__SYSCALL(__NR_msgctl, compat_sys_old_msgctl)
634634
#define __NR_shmat 305
635635
__SYSCALL(__NR_shmat, compat_sys_shmat)
636636
#define __NR_shmdt 306
637637
__SYSCALL(__NR_shmdt, sys_shmdt)
638638
#define __NR_shmget 307
639639
__SYSCALL(__NR_shmget, sys_shmget)
640640
#define __NR_shmctl 308
641-
__SYSCALL(__NR_shmctl, compat_sys_shmctl)
641+
__SYSCALL(__NR_shmctl, compat_sys_old_shmctl)
642642
#define __NR_add_key 309
643643
__SYSCALL(__NR_add_key, sys_add_key)
644644
#define __NR_request_key 310
@@ -821,6 +821,10 @@ __SYSCALL(__NR_statx, sys_statx)
821821
__SYSCALL(__NR_rseq, sys_rseq)
822822
#define __NR_io_pgetevents 399
823823
__SYSCALL(__NR_io_pgetevents, compat_sys_io_pgetevents)
824+
#define __NR_migrate_pages 400
825+
__SYSCALL(__NR_migrate_pages, compat_sys_migrate_pages)
826+
#define __NR_kexec_file_load 401
827+
__SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
824828

825829
/*
826830
* Please add new compat syscalls above this comment and update

arch/ia64/include/asm/unistd.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@
1212

1313
#define NR_syscalls __NR_syscalls /* length of syscall table */
1414

15-
/*
16-
* The following defines stop scripts/checksyscalls.sh from complaining about
17-
* unimplemented system calls. Glibc provides for each of these by using
18-
* more modern equivalent system calls.
19-
*/
20-
#define __IGNORE_fork /* clone() */
21-
#define __IGNORE_time /* gettimeofday() */
22-
#define __IGNORE_alarm /* setitimer(ITIMER_REAL, ... */
23-
#define __IGNORE_pause /* rt_sigprocmask(), rt_sigsuspend() */
24-
#define __IGNORE_utime /* utimes() */
25-
#define __IGNORE_getpgrp /* getpgid() */
26-
#define __IGNORE_vfork /* clone() */
27-
#define __IGNORE_umount2 /* umount() */
28-
2915
#define __ARCH_WANT_NEW_STAT
3016
#define __ARCH_WANT_SYS_UTIME
3117

arch/ia64/include/uapi/asm/unistd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#define __NR_Linux 1024
1717

18+
#define __NR_umount __NR_umount2
19+
1820
#include <asm/unistd_64.h>
1921

2022
#endif /* _UAPI_ASM_IA64_UNISTD_H */

arch/ia64/kernel/syscalls/syscall.tbl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
17 common getpid sys_getpid
3030
18 common getppid sys_getppid
3131
19 common mount sys_mount
32-
20 common umount sys_umount
32+
20 common umount2 sys_umount
3333
21 common setuid sys_setuid
3434
22 common getuid sys_getuid
3535
23 common geteuid sys_geteuid
@@ -335,3 +335,11 @@
335335
323 common copy_file_range sys_copy_file_range
336336
324 common preadv2 sys_preadv2
337337
325 common pwritev2 sys_pwritev2
338+
326 common statx sys_statx
339+
327 common io_pgetevents sys_io_pgetevents
340+
328 common perf_event_open sys_perf_event_open
341+
329 common seccomp sys_seccomp
342+
330 common pkey_mprotect sys_pkey_mprotect
343+
331 common pkey_alloc sys_pkey_alloc
344+
332 common pkey_free sys_pkey_free
345+
333 common rseq sys_rseq

arch/m68k/kernel/syscalls/syscall.tbl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,3 +387,19 @@
387387
377 common preadv2 sys_preadv2
388388
378 common pwritev2 sys_pwritev2
389389
379 common statx sys_statx
390+
380 common seccomp sys_seccomp
391+
381 common pkey_mprotect sys_pkey_mprotect
392+
382 common pkey_alloc sys_pkey_alloc
393+
383 common pkey_free sys_pkey_free
394+
384 common rseq sys_rseq
395+
# room for arch specific calls
396+
393 common semget sys_semget
397+
394 common semctl sys_semctl
398+
395 common shmget sys_shmget
399+
396 common shmctl sys_shmctl
400+
397 common shmat sys_shmat
401+
398 common shmdt sys_shmdt
402+
399 common msgget sys_msgget
403+
400 common msgsnd sys_msgsnd
404+
401 common msgrcv sys_msgrcv
405+
402 common msgctl sys_msgctl

arch/microblaze/kernel/syscalls/syscall.tbl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,15 @@
335335
325 common semtimedop sys_semtimedop
336336
326 common timerfd_settime sys_timerfd_settime
337337
327 common timerfd_gettime sys_timerfd_gettime
338-
328 common semctl sys_semctl
338+
328 common semctl sys_old_semctl
339339
329 common semget sys_semget
340340
330 common semop sys_semop
341-
331 common msgctl sys_msgctl
341+
331 common msgctl sys_old_msgctl
342342
332 common msgget sys_msgget
343343
333 common msgrcv sys_msgrcv
344344
334 common msgsnd sys_msgsnd
345345
335 common shmat sys_shmat
346-
336 common shmctl sys_shmctl
346+
336 common shmctl sys_old_shmctl
347347
337 common shmdt sys_shmdt
348348
338 common shmget sys_shmget
349349
339 common signalfd4 sys_signalfd4

arch/mips/include/asm/unistd.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,7 @@
5454
#define __ARCH_WANT_SYS_CLONE
5555

5656
/* whitelists for checksyscalls */
57-
#define __IGNORE_select
58-
#define __IGNORE_vfork
59-
#define __IGNORE_time
60-
#define __IGNORE_uselib
6157
#define __IGNORE_fadvise64_64
62-
#define __IGNORE_getdents64
63-
#if _MIPS_SIM == _MIPS_SIM_NABI32
64-
#define __IGNORE_truncate64
65-
#define __IGNORE_ftruncate64
66-
#define __IGNORE_stat64
67-
#define __IGNORE_lstat64
68-
#define __IGNORE_fstat64
69-
#define __IGNORE_fstatat64
70-
#endif
7158

7259
#endif /* !__ASSEMBLY__ */
7360

arch/mips/kernel/syscalls/syscall_n32.tbl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
27 n32 madvise sys_madvise
3838
28 n32 shmget sys_shmget
3939
29 n32 shmat sys_shmat
40-
30 n32 shmctl compat_sys_shmctl
40+
30 n32 shmctl compat_sys_old_shmctl
4141
31 n32 dup sys_dup
4242
32 n32 dup2 sys_dup2
4343
33 n32 pause sys_pause
@@ -71,12 +71,12 @@
7171
61 n32 uname sys_newuname
7272
62 n32 semget sys_semget
7373
63 n32 semop sys_semop
74-
64 n32 semctl compat_sys_semctl
74+
64 n32 semctl compat_sys_old_semctl
7575
65 n32 shmdt sys_shmdt
7676
66 n32 msgget sys_msgget
7777
67 n32 msgsnd compat_sys_msgsnd
7878
68 n32 msgrcv compat_sys_msgrcv
79-
69 n32 msgctl compat_sys_msgctl
79+
69 n32 msgctl compat_sys_old_msgctl
8080
70 n32 fcntl compat_sys_fcntl
8181
71 n32 flock sys_flock
8282
72 n32 fsync sys_fsync

arch/mips/kernel/syscalls/syscall_n64.tbl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
27 n64 madvise sys_madvise
3838
28 n64 shmget sys_shmget
3939
29 n64 shmat sys_shmat
40-
30 n64 shmctl sys_shmctl
40+
30 n64 shmctl sys_old_shmctl
4141
31 n64 dup sys_dup
4242
32 n64 dup2 sys_dup2
4343
33 n64 pause sys_pause
@@ -71,12 +71,12 @@
7171
61 n64 uname sys_newuname
7272
62 n64 semget sys_semget
7373
63 n64 semop sys_semop
74-
64 n64 semctl sys_semctl
74+
64 n64 semctl sys_old_semctl
7575
65 n64 shmdt sys_shmdt
7676
66 n64 msgget sys_msgget
7777
67 n64 msgsnd sys_msgsnd
7878
68 n64 msgrcv sys_msgrcv
79-
69 n64 msgctl sys_msgctl
79+
69 n64 msgctl sys_old_msgctl
8080
70 n64 fcntl sys_fcntl
8181
71 n64 flock sys_flock
8282
72 n64 fsync sys_fsync

arch/mips/kernel/syscalls/syscall_o32.tbl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,3 +380,14 @@
380380
366 o32 statx sys_statx
381381
367 o32 rseq sys_rseq
382382
368 o32 io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents
383+
# room for arch specific calls
384+
393 o32 semget sys_semget
385+
394 o32 semctl sys_semctl compat_sys_semctl
386+
395 o32 shmget sys_shmget
387+
396 o32 shmctl sys_shmctl compat_sys_shmctl
388+
397 o32 shmat sys_shmat compat_sys_shmat
389+
398 o32 shmdt sys_shmdt
390+
399 o32 msgget sys_msgget
391+
400 o32 msgsnd sys_msgsnd compat_sys_msgsnd
392+
401 o32 msgrcv sys_msgrcv compat_sys_msgrcv
393+
402 o32 msgctl sys_msgctl compat_sys_msgctl

arch/parisc/include/asm/unistd.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@
1010

1111
#define SYS_ify(syscall_name) __NR_##syscall_name
1212

13-
#define __IGNORE_select /* newselect */
1413
#define __IGNORE_fadvise64 /* fadvise64_64 */
15-
#define __IGNORE_pkey_mprotect
16-
#define __IGNORE_pkey_alloc
17-
#define __IGNORE_pkey_free
1814

1915
#ifndef ASM_LINE_SEP
2016
# define ASM_LINE_SEP ;

arch/parisc/kernel/syscalls/syscall.tbl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,3 +367,7 @@
367367
348 common pwritev2 sys_pwritev2 compat_sys_pwritev2
368368
349 common statx sys_statx
369369
350 common io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents
370+
351 common pkey_mprotect sys_pkey_mprotect
371+
352 common pkey_alloc sys_pkey_alloc
372+
353 common pkey_free sys_pkey_free
373+
354 common rseq sys_rseq

arch/powerpc/kernel/syscalls/syscall.tbl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@
414414
363 spu switch_endian sys_ni_syscall
415415
364 common userfaultfd sys_userfaultfd
416416
365 common membarrier sys_membarrier
417+
# 366-377 originally left for IPC, now unused
417418
378 nospu mlock2 sys_mlock2
418419
379 nospu copy_file_range sys_copy_file_range
419420
380 common preadv2 sys_preadv2 compat_sys_preadv2
@@ -425,3 +426,15 @@
425426
386 nospu pkey_mprotect sys_pkey_mprotect
426427
387 nospu rseq sys_rseq
427428
388 nospu io_pgetevents sys_io_pgetevents compat_sys_io_pgetevents
429+
# room for arch specific syscalls
430+
392 64 semtimedop sys_semtimedop
431+
393 common semget sys_semget
432+
394 common semctl sys_semctl compat_sys_semctl
433+
395 common shmget sys_shmget
434+
396 common shmctl sys_shmctl compat_sys_shmctl
435+
397 common shmat sys_shmat compat_sys_shmat
436+
398 common shmdt sys_shmdt
437+
399 common msgget sys_msgget
438+
400 common msgsnd sys_msgsnd compat_sys_msgsnd
439+
401 common msgrcv sys_msgrcv compat_sys_msgrcv
440+
402 common msgctl sys_msgctl compat_sys_msgctl

0 commit comments

Comments
 (0)