diff options
author | Dmitry Chagin <dchagin@FreeBSD.org> | 2017-02-05 14:17:09 +0000 |
---|---|---|
committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2017-02-05 14:17:09 +0000 |
commit | 8b756d40a72e9efe40d4790d356cb8c1b53bd2dd (patch) | |
tree | 1ff2cfc0a98d2ec338f5e55ee4f6e8afc287641c /sys/amd64 | |
parent | 85dbb41686107b79d08fb989e4665064587c3287 (diff) | |
download | src-8b756d40a72e9efe40d4790d356cb8c1b53bd2dd.tar.gz src-8b756d40a72e9efe40d4790d356cb8c1b53bd2dd.zip |
Update syscall.master to 4.10-rc6. Also fix comments, a typo,
and wrong numbering for a few unimplemented syscalls.
For 32-bit Linuxulator, socketcall() syscall was historically
the entry point for the sockets API. Starting in Linux 4.3, direct
syscalls are provided for the sockets API. Enable it.
The initial version of patch was provided by trasz@ and extended by me.
Submitted by: trasz
MFC after: 2 week
Differential Revision: https://reviews.freebsd.org/D9381
Notes
Notes:
svn path=/head/; revision=313284
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/linux/linux_dummy.c | 49 | ||||
-rw-r--r-- | sys/amd64/linux/syscalls.master | 111 | ||||
-rw-r--r-- | sys/amd64/linux32/linux32_dummy.c | 37 | ||||
-rw-r--r-- | sys/amd64/linux32/syscalls.master | 124 |
4 files changed, 292 insertions, 29 deletions
diff --git a/sys/amd64/linux/linux_dummy.c b/sys/amd64/linux/linux_dummy.c index 7989b527f4d2..efe18fd5fbad 100644 --- a/sys/amd64/linux/linux_dummy.c +++ b/sys/amd64/linux/linux_dummy.c @@ -82,41 +82,86 @@ DUMMY(mq_timedreceive); DUMMY(mq_notify); DUMMY(mq_getsetattr); DUMMY(kexec_load); +/* linux 2.6.11: */ DUMMY(add_key); DUMMY(request_key); DUMMY(keyctl); +/* linux 2.6.13: */ DUMMY(ioprio_set); DUMMY(ioprio_get); DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); +/* linux 2.6.16: */ DUMMY(migrate_pages); DUMMY(unshare); +/* linux 2.6.17: */ DUMMY(splice); DUMMY(tee); DUMMY(sync_file_range); DUMMY(vmsplice); +/* linux 2.6.18: */ DUMMY(move_pages); +/* linux 2.6.22: */ DUMMY(signalfd); -DUMMY(timerfd); +DUMMY(timerfd_create); +/* linux 2.6.25: */ DUMMY(timerfd_settime); DUMMY(timerfd_gettime); +/* linux 2.6.27: */ DUMMY(signalfd4); DUMMY(inotify_init1); +/* linux 2.6.30: */ DUMMY(preadv); DUMMY(pwritev); -DUMMY(rt_tsigqueueinfo); +/* linux 2.6.31: */ +DUMMY(rt_tgsigqueueinfo); DUMMY(perf_event_open); +/* linux 2.6.38: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); +/* linux 2.6.39: */ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); +/* linux 3.0: */ DUMMY(setns); +DUMMY(getcpu); +/* linux 3.2: */ DUMMY(process_vm_readv); DUMMY(process_vm_writev); +/* linux 3.5: */ DUMMY(kcmp); +/* linux 3.8: */ DUMMY(finit_module); +DUMMY(sched_setattr); +DUMMY(sched_getattr); +/* linux 3.14: */ +DUMMY(renameat2); +/* linux 3.15: */ +DUMMY(seccomp); +DUMMY(getrandom); +DUMMY(memfd_create); +DUMMY(kexec_file_load); +/* linux 3.18: */ +DUMMY(bpf); +/* linux 3.19: */ +DUMMY(execveat); +/* linux 4.2: */ +DUMMY(userfaultfd); +/* linux 4.3: */ +DUMMY(membarrier); +/* linux 4.4: */ +DUMMY(mlock2); +/* linux 4.5: */ +DUMMY(copy_file_range); +/* linux 4.6: */ +DUMMY(preadv2); +DUMMY(pwritev2); +/* linux 4.8: */ +DUMMY(pkey_mprotect); +DUMMY(pkey_alloc); +DUMMY(pkey_free); #define DUMMY_XATTR(s) \ int \ diff --git a/sys/amd64/linux/syscalls.master b/sys/amd64/linux/syscalls.master index d4544f8ddddf..291953bf3e66 100644 --- a/sys/amd64/linux/syscalls.master +++ b/sys/amd64/linux/syscalls.master @@ -11,18 +11,20 @@ ; there is no audit event for the call at this time. For the ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. -; type one of STD, OBSOL, UNIMPL +; type one of STD, NOPROTO, UNIMPL ; name psuedo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different ; alttag name of args struct tag if different from [o]`name'"_args" ; altrtyp return type if not int (bogus - syscalls always return int) -; for UNIMPL/OBSOL, name continues with comments +; for UNIMPL, name continues with comments ; types: ; STD always included -; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only +; NOPROTO same as STD except do not create structure or +; function prototype in sys/sysproto.h. Does add a +; definition to syscall.h besides adding a sysent. #include <sys/param.h> #include <sys/sysent.h> @@ -369,7 +371,7 @@ 206 AUE_NULL UNIMPL linux_io_setup 207 AUE_NULL UNIMPL linux_io_destroy 208 AUE_NULL UNIMPL linux_io_getevents -209 AUE_NULL UNIMPL inux_io_submit +209 AUE_NULL UNIMPL linux_io_submit 210 AUE_NULL UNIMPL linux_io_cancel 211 AUE_NULL UNIMPL linux_get_thread_area 212 AUE_NULL STD { int linux_lookup_dcookie(void); } @@ -473,7 +475,7 @@ 281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout, l_sigset_t *mask); } 282 AUE_NULL STD { int linux_signalfd(void); } -283 AUE_NULL STD { int linux_timerfd(void); } +283 AUE_NULL STD { int linux_timerfd_create(void); } 284 AUE_NULL STD { int linux_eventfd(l_uint initval); } 285 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ l_loff_t offset, l_loff_t len); } @@ -481,35 +483,114 @@ 287 AUE_NULL STD { int linux_timerfd_gettime(void); } 288 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \ l_uintptr_t namelen, int flags); } +; linux 2.6.27: 289 AUE_NULL STD { int linux_signalfd4(void); } 290 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); } 291 AUE_NULL STD { int linux_epoll_create1(l_int flags); } 292 AUE_NULL STD { int linux_dup3(l_int oldfd, \ l_int newfd, l_int flags); } 293 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } -294 AUE_NULL STD { int linux_inotify_init1(void); } -295 AUE_NULL STD { int linux_preadv(void); } -296 AUE_NULL STD { int linux_pwritev(void); } -297 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } +294 AUE_NULL STD { int linux_inotify_init1(l_int flags); } +; linux 2.6.30: +295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ + struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h); } +296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ + struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h); } +; linux 2.6.31: +297 AUE_NULL STD { int linux_rt_tgsigqueueinfo(l_pid_t tgid, \ + l_pid_t tid, l_int sig, l_siginfo_t *uinfo); } 298 AUE_NULL STD { int linux_perf_event_open(void); } +; linux 2.6.33: 299 AUE_NULL STD { int linux_recvmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags, struct l_timespec *timeout); } +; linux 2.6.37: 300 AUE_NULL STD { int linux_fanotify_init(void); } 301 AUE_NULL STD { int linux_fanotify_mark(void); } +; linux 2.6.36: 302 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, l_uint resource, \ struct rlimit *new, struct rlimit *old); } +; linux 2.6.39 (glibc 2.14): 303 AUE_NULL STD { int linux_name_to_handle_at(void); } 304 AUE_NULL STD { int linux_open_by_handle_at(void); } 305 AUE_NULL STD { int linux_clock_adjtime(void); } 306 AUE_SYNC STD { int linux_syncfs(l_int fd); } +; linux 3.0 (glibc 2.14): 307 AUE_NULL STD { int linux_sendmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags); } -308 AUE_NULL STD { int linux_setns(void); } -309 AUE_NULL STD { int linux_process_vm_readv(void); } -310 AUE_NULL STD { int linux_process_vm_writev(void); } -311 AUE_NULL STD { int linux_kcmp(void); } -312 AUE_NULL STD { int linux_finit_module(void); } +308 AUE_NULL STD { int linux_setns(l_int fd, l_int nstype); } +; linux 2.6.19 (no glibc wrapper): +309 AUE_NULL STD { int linux_getcpu(l_uint *cpu, l_uint *node, \ + void *cache); } +; linux 3.2 (glibc 2.15): +310 AUE_NULL STD { int linux_process_vm_readv(l_pid_t pid, \ + const struct iovec *lvec, l_ulong liovcnt, \ + const struct iovec *rvec, l_ulong riovcnt, \ + l_ulong flags); } +311 AUE_NULL STD { int linux_process_vm_writev(l_pid_t pid, \ + const struct iovec *lvec, l_ulong liovcnt, \ + const struct iovec *rvec, l_ulong riovcnt, \ + l_ulong flags); } +; linux 3.5 (no glibc wrapper): +312 AUE_NULL STD { int linux_kcmp(l_pid_t pid1, l_pid_t pid2, \ + l_int type, l_ulong idx1, l_ulong idx); } +; linux 3.8 (no glibc wrapper): +313 AUE_NULL STD { int linux_finit_module(l_int fd, \ + const char *uargs, l_int flags); } +; linux 3.14: +314 AUE_NULL STD { int linux_sched_setattr(l_pid_t pid, \ + void *attr, l_uint flags); } +315 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \ + void *attr, l_uint size, l_uint flags); } +; linux 3.15: +316 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ + const char *oldname, l_int newfd, \ + const char *newname, unsigned int flags); } +; linux 3.17: +317 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ + const char *uargs); } +318 AUE_NULL STD { int linux_getrandom(char *buf, \ + l_size_t count, l_uint flags); } +319 AUE_NULL STD { int linux_memfd_create(const char *uname_ptr, \ + l_uint flags); } +320 AUE_NULL STD { int linux_kexec_file_load(l_int kernel_fd, \ + l_int initrd_fd, l_ulong cmdline_len, \ + const char *cmdline_ptr, l_ulong flags); } +; linux 3.18: +321 AUE_NULL STD { int linux_bpf(l_int cmd, void *attr, \ + l_uint size); } +; linux 3.19: +322 AUE_NULL STD { int linux_execveat(l_int dfd, \ + const char *filename, const char **argv, \ + const char **envp, l_int flags); } +; linux 4.2: +323 AUE_NULL STD { int linux_userfaultfd(l_int flags); } +; linux 4.3: +324 AUE_NULL STD { int linux_membarrier(l_int cmd, l_int flags); } +; linux 4.4: +325 AUE_NULL STD { int linux_mlock2(l_ulong start, l_size_t len, \ + l_int flags); } +; linux 4.5: +326 AUE_NULL STD { int linux_copy_file_range(l_int fd_in, \ + l_loff_t *off_in, l_int fd_out, \ + l_loff_t *off_out, l_size_t len, \ + l_uint flags); } +; linux 4.6: +327 AUE_NULL STD { int linux_preadv2(l_ulong fd, \ + const struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h, l_int flags); } +328 AUE_NULL STD { int linux_pwritev2(l_ulong fd, \ + const struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h, l_int flags); } +; linux 4.8: +329 AUE_NULL STD { int linux_pkey_mprotect(l_ulong start, \ + l_size_t len, l_ulong prot, l_int pkey); } +330 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \ + l_ulong init_val); } +331 AUE_NULL STD { int linux_pkey_free(l_int pkey); } + ; please, keep this line at the end. -313 AUE_NULL UNIMPL nosys +332 AUE_NULL UNIMPL nosys diff --git a/sys/amd64/linux32/linux32_dummy.c b/sys/amd64/linux32/linux32_dummy.c index 11046515d2ef..74e89a9380cd 100644 --- a/sys/amd64/linux32/linux32_dummy.c +++ b/sys/amd64/linux32/linux32_dummy.c @@ -114,18 +114,51 @@ DUMMY(inotify_init1); DUMMY(preadv); DUMMY(pwritev); /* linux 2.6.31: */ -DUMMY(rt_tsigqueueinfo); +DUMMY(rt_tgsigqueueinfo); DUMMY(perf_event_open); /* linux 2.6.33: */ DUMMY(fanotify_init); DUMMY(fanotify_mark); -/* later: */ +/* linux 2.6.39: */ DUMMY(name_to_handle_at); DUMMY(open_by_handle_at); DUMMY(clock_adjtime); +/* linux 3.0: */ DUMMY(setns); +/* linux 3.2: */ DUMMY(process_vm_readv); DUMMY(process_vm_writev); +/* linux 3.5: */ +DUMMY(kcmp); +/* linux 3.8: */ +DUMMY(finit_module); +DUMMY(sched_setattr); +DUMMY(sched_getattr); +/* linux 3.14: */ +DUMMY(renameat2); +/* linux 3.15: */ +DUMMY(seccomp); +DUMMY(getrandom); +DUMMY(memfd_create); +/* linux 3.18: */ +DUMMY(bpf); +/* linux 3.19: */ +DUMMY(execveat); +/* linux 4.2: */ +DUMMY(userfaultfd); +/* linux 4.3: */ +DUMMY(membarrier); +/* linux 4.4: */ +DUMMY(mlock2); +/* linux 4.5: */ +DUMMY(copy_file_range); +/* linux 4.6: */ +DUMMY(preadv2); +DUMMY(pwritev2); +/* linux 4.8: */ +DUMMY(pkey_mprotect); +DUMMY(pkey_alloc); +DUMMY(pkey_free); #define DUMMY_XATTR(s) \ int \ diff --git a/sys/amd64/linux32/syscalls.master b/sys/amd64/linux32/syscalls.master index 20aa3c4ec698..1c261f9803de 100644 --- a/sys/amd64/linux32/syscalls.master +++ b/sys/amd64/linux32/syscalls.master @@ -11,18 +11,20 @@ ; there is no audit event for the call at this time. For the ; case where the event exists, but we don't want auditing, the ; event should be #defined to AUE_NULL in audit_kevents.h. -; type one of STD, OBSOL, UNIMPL +; type one of STD, NOPROTO, UNIMPL ; name psuedo-prototype of syscall routine ; If one of the following alts is different, then all appear: ; altname name of system call if different ; alttag name of args struct tag if different from [o]`name'"_args" ; altrtyp return type if not int (bogus - syscalls always return int) -; for UNIMPL/OBSOL, name continues with comments +; for UNIMPL, name continues with comments ; types: ; STD always included -; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only +; NOPROTO same as STD except do not create structure or +; function prototype in sys/sysproto.h. Does add a +; definition to syscall.h besides adding a sysent. #include "opt_compat.h" #include <sys/param.h> @@ -553,10 +555,15 @@ 331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } 332 AUE_NULL STD { int linux_inotify_init1(void); } ; linux 2.6.30: -333 AUE_NULL STD { int linux_preadv(void); } -334 AUE_NULL STD { int linux_pwritev(void); } +333 AUE_NULL STD { int linux_preadv(l_ulong fd, \ + struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h); } +334 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ + struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h); } ; linux 2.6.31: -335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); } +335 AUE_NULL STD { int linux_rt_tgsigqueueinfo(l_pid_t tgid, \ + l_pid_t tid, l_int sig, l_siginfo_t *uinfo); } 336 AUE_NULL STD { int linux_perf_event_open(void); } ; linux 2.6.33: 337 AUE_NULL STD { int linux_recvmmsg(l_int s, \ @@ -569,16 +576,113 @@ l_uint resource, \ struct rlimit *new, \ struct rlimit *old); } -; later: +; linux 2.6.39: 341 AUE_NULL STD { int linux_name_to_handle_at(void); } 342 AUE_NULL STD { int linux_open_by_handle_at(void); } 343 AUE_NULL STD { int linux_clock_adjtime(void); } 344 AUE_SYNC STD { int linux_syncfs(l_int fd); } +; linux 3.0: 345 AUE_NULL STD { int linux_sendmmsg(l_int s, \ struct l_mmsghdr *msg, l_uint vlen, \ l_uint flags); } 346 AUE_NULL STD { int linux_setns(void); } -347 AUE_NULL STD { int linux_process_vm_readv(void); } -348 AUE_NULL STD { int linux_process_vm_writev(void); } +; linux 3.2 (glibc 2.15): +347 AUE_NULL STD { int linux_process_vm_readv(l_pid_t pid, \ + const struct iovec *lvec, l_ulong liovcnt, \ + const struct iovec *rvec, l_ulong riovcnt, \ + l_ulong flags); } +348 AUE_NULL STD { int linux_process_vm_writev(l_pid_t pid, \ + const struct iovec *lvec, l_ulong liovcnt, \ + const struct iovec *rvec, l_ulong riovcnt, \ + l_ulong flags); } +; linux 3.5 (no glibc wrapper): +349 AUE_NULL STD { int linux_kcmp(l_pid_t pid1, l_pid_t pid2, \ + l_int type, l_ulong idx1, l_ulong idx); } +; linux 3.8 (no glibc wrapper): +350 AUE_NULL STD { int linux_finit_module(l_int fd, \ + const char *uargs, l_int flags); } +; linux 3.14: +351 AUE_NULL STD { int linux_sched_setattr(l_pid_t pid, \ + void *attr, l_uint flags); } +352 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \ + void *attr, l_uint size, l_uint flags); } +; linux 3.15: +353 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ + const char *oldname, l_int newfd, \ + const char *newname, unsigned int flags); } +; linux 3.17: +354 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ + const char *uargs); } +355 AUE_NULL STD { int linux_getrandom(char *buf, \ + l_size_t count, l_uint flags); } +356 AUE_NULL STD { int linux_memfd_create(const char *uname_ptr, \ + l_uint flags); } +; linux 3.18: +357 AUE_NULL STD { int linux_bpf(l_int cmd, void *attr, \ + l_uint size); } +; linux 3.19: +358 AUE_NULL STD { int linux_execveat(l_int dfd, \ + const char *filename, const char **argv, \ + const char **envp, l_int flags); } +; linux 4.3: sockets now direct system calls: +359 AUE_SOCKET STD { int linux_socket(l_int domain, l_int type, \ + l_int protocol); } +360 AUE_SOCKETPAIR STD { int linux_socketpair(l_int domain, \ + l_int type, l_int protocol, l_uintptr_t rsv); } +361 AUE_BIND STD { int linux_bind(l_int s, l_uintptr_t name, \ + l_int namelen); } +362 AUE_CONNECT STD { int linux_connect(l_int s, l_uintptr_t name, \ + l_int namelen); } +363 AUE_LISTEN STD { int linux_listen(l_int s, l_int backlog); } +364 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \ + l_uintptr_t namelen, l_int flags); } +365 AUE_GETSOCKOPT STD { int linux_getsockopt(l_int s, l_int level, \ + l_int optname, l_uintptr_t optval, \ + l_uintptr_t optlen); } +366 AUE_SETSOCKOPT STD { int linux_setsockopt(l_int s, l_int level, \ + l_int optname, l_uintptr_t optval, \ + l_int optlen); } +367 AUE_GETSOCKNAME STD { int linux_getsockname(l_int s, \ + l_uintptr_t addr, l_uintptr_t namelen); } +368 AUE_GETPEERNAME STD { int linux_getpeername(l_int s, \ + l_uintptr_t addr, l_uintptr_t namelen); } +369 AUE_SENDTO STD { int linux_sendto(l_int s, l_uintptr_t msg, \ + l_int len, l_int flags, l_uintptr_t to, \ + l_int tolen); } +370 AUE_SENDMSG STD { int linux_sendmsg(l_int s, l_uintptr_t msg, \ + l_int flags); } +371 AUE_RECVFROM STD { int linux_recvfrom(l_int s, l_uintptr_t buf, \ + l_size_t len, l_int flags, l_uintptr_t from, \ + l_uintptr_t fromlen); } +372 AUE_RECVMSG STD { int linux_recvmsg(l_int s, l_uintptr_t msg, \ + l_int flags); } +373 AUE_NULL STD { int linux_shutdown(l_int s, l_int how); } +; +; linux 4.2: +374 AUE_NULL STD { int linux_userfaultfd(l_int flags); } +; linux 4.3: +375 AUE_NULL STD { int linux_membarrier(l_int cmd, l_int flags); } +; linux 4.4: +376 AUE_NULL STD { int linux_mlock2(l_ulong start, l_size_t len, \ + l_int flags); } +; linux 4.5: +377 AUE_NULL STD { int linux_copy_file_range(l_int fd_in, \ + l_loff_t *off_in, l_int fd_out, \ + l_loff_t *off_out, l_size_t len, \ + l_uint flags); } +; linux 4.6: +378 AUE_NULL STD { int linux_preadv2(l_ulong fd, \ + const struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h, l_int flags); } +379 AUE_NULL STD { int linux_pwritev2(l_ulong fd, \ + const struct iovec *vec, l_ulong vlen, \ + l_ulong pos_l, l_ulong pos_h, l_int flags); } +; linux 4.8: +380 AUE_NULL STD { int linux_pkey_mprotect(l_ulong start, \ + l_size_t len, l_ulong prot, l_int pkey); } +381 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \ + l_ulong init_val); } +382 AUE_NULL STD { int linux_pkey_free(l_int pkey); } + ; please, keep this line at the end. -349 AUE_NULL UNIMPL nosys +383 AUE_NULL UNIMPL nosys |