The series aims at adding a new time header: time_types.h. This header
is what will eventually hold all the uapi time types that we plan to
leave across the interfaces after the y2038 cleanup.
The series was discussed with Arnd Bergmann.
The second patch fixes the errqueue.h header, which has a dependency on
these types.
Note that there may be a trivial merge conflict with linux-next
c70a772fda11 ("y2038: remove struct definition redirects").
Deepa Dinamani (2):
time: Add time_types.h
errqueue.h: Include time_types.h
include/uapi/linux/errqueue.h | 1 +
include/uapi/linux/time.h | 36 +----------------------------
include/uapi/linux/time_types.h | 40 +++++++++++++++++++++++++++++++++
3 files changed, 42 insertions(+), 35 deletions(-)
create mode 100644 include/uapi/linux/time_types.h
--
2.17.1
The series introduces new socket timestamps that are
y2038 safe.
The time data types used for the existing socket timestamp
options: SO_TIMESTAMP, SO_TIMESTAMPNS and SO_TIMESTAMPING
are not y2038 safe. The series introduces SO_TIMESTAMP_NEW,
SO_TIMESTAMPNS_NEW and SO_TIMESTAMPING_NEW to replace these.
These new timestamps can be used on all architectures.
The alternative considered was to extend the sys_setsockopt()
by using the flags. We did not receive any strong opinions about
either of the approaches. Hence, this was chosen, as glibc folks
preferred this.
The series does not deal with updating the internal kernel socket
calls like rxrpc to make them y2038 safe. This will be dealt
with separately.
Note that the timestamps behavior already does not match the
man page specific behavior:
SIOCGSTAMP
This ioctl should only be used if the socket option SO_TIMESTAMP
is not set on the socket. Otherwise, it returns the timestamp of
the last packet that was received while SO_TIMESTAMP was not set,
or it fails if no such packet has been received,
(i.e., ioctl(2) returns -1 with errno set to ENOENT).
The recommendation is to update the man page to remove the above statement.
The overview of the socket timestamp series is as below:
1. Delete asm specific socket.h when possible.
2. Support SO/SCM_TIMESTAMP* options only in userspace.
3. Rename current SO/SCM_TIMESTAMP* to SO/SCM_TIMESTAMP*_OLD.
3. Alter socket options so that SOCK_RCVTSTAMPNS does
not rely on SOCK_RCVTSTAMP.
4. Introduce y2038 safe types for socket timestamp.
5. Introduce new y2038 safe socket options SO/SCM_TIMESTAMP*_NEW.
6. Intorduce new y2038 safe socket timeout options.
Changes since v4:
* Fixed the typo in calling sock_get_timeout()
Changes since v3:
* Rebased onto net-next and fixups as per review comments
* Merged the socket timeout series
* Integrated Arnd's patch to simplify compat handling of timeout syscalls
Changes since v2:
* Removed extra functions to reduce diff churn as per code review
Changes since v1:
* Dropped the change to disentangle sock flags
* Renamed sock_timeval to __kernel_sock_timeval
* Updated a few comments
* Added documentation changes
Arnd Bergmann (1):
socket: move compat timeout handling into sock.c
Deepa Dinamani (11):
selftests: add missing include unistd
arch: Use asm-generic/socket.h when possible
sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD
arch: sparc: Override struct __kernel_old_timeval
socket: Use old_timeval types for socket timestamps
socket: Add struct __kernel_sock_timeval
socket: Add SO_TIMESTAMP[NS]_NEW
socket: Add SO_TIMESTAMPING_NEW
socket: Update timestamping Documentation
socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes
sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW
Documentation/networking/timestamping.txt | 43 ++++-
arch/alpha/include/uapi/asm/socket.h | 47 ++++--
arch/ia64/include/uapi/asm/Kbuild | 1 +
arch/ia64/include/uapi/asm/socket.h | 122 --------------
arch/mips/include/uapi/asm/socket.h | 47 ++++--
arch/parisc/include/uapi/asm/socket.h | 46 ++++--
arch/powerpc/include/uapi/asm/socket.h | 4 +-
arch/s390/include/uapi/asm/Kbuild | 1 +
arch/s390/include/uapi/asm/socket.h | 119 --------------
arch/sparc/include/uapi/asm/posix_types.h | 10 ++
arch/sparc/include/uapi/asm/socket.h | 49 ++++--
arch/x86/include/uapi/asm/Kbuild | 1 +
arch/x86/include/uapi/asm/socket.h | 1 -
arch/xtensa/include/asm/Kbuild | 1 +
arch/xtensa/include/uapi/asm/Kbuild | 1 +
arch/xtensa/include/uapi/asm/socket.h | 124 --------------
drivers/isdn/mISDN/socket.c | 2 +-
fs/dlm/lowcomms.c | 4 +-
include/linux/skbuff.h | 24 ++-
include/linux/socket.h | 8 +
include/net/sock.h | 1 +
include/uapi/asm-generic/socket.h | 48 ++++--
include/uapi/linux/errqueue.h | 4 +
include/uapi/linux/time.h | 7 +
net/bluetooth/hci_sock.c | 4 +-
net/compat.c | 78 +--------
net/core/scm.c | 27 ++++
net/core/sock.c | 151 +++++++++++++-----
net/ipv4/tcp.c | 61 ++++---
net/rds/af_rds.c | 10 +-
net/rds/recv.c | 18 ++-
net/rxrpc/local_object.c | 2 +-
net/smc/af_smc.c | 3 +-
net/socket.c | 50 ++++--
net/vmw_vsock/af_vsock.c | 4 +-
.../networking/timestamping/rxtimestamp.c | 1 +
36 files changed, 541 insertions(+), 583 deletions(-)
delete mode 100644 arch/ia64/include/uapi/asm/socket.h
delete mode 100644 arch/s390/include/uapi/asm/socket.h
delete mode 100644 arch/x86/include/uapi/asm/socket.h
delete mode 100644 arch/xtensa/include/uapi/asm/socket.h
--
2.17.1
Cc: ccaulfie(a)redhat.com
Cc: chris(a)zankel.net
Cc: cluster-devel(a)redhat.com
Cc: davem(a)davemloft.net
Cc: deller(a)gmx.de
Cc: dhowells(a)redhat.com
Cc: fenghua.yu(a)intel.com
Cc: isdn(a)linux-pingi.de
Cc: jejb(a)parisc-linux.org
Cc: linux-afs(a)lists.infradead.org
Cc: linux-alpha(a)vger.kernel.org
Cc: linux-arch(a)vger.kernel.org
Cc: linux-ia64(a)vger.kernel.org
Cc: linux-mips(a)linux-mips.org
Cc: linux-mips(a)vger.kernel.org
Cc: linux-parisc(a)vger.kernel.org
Cc: linuxppc-dev(a)lists.ozlabs.org
Cc: linux-rdma(a)vger.kernel.org
Cc: linux-s390(a)vger.kernel.org
Cc: linux-xtensa(a)linux-xtensa.org
Cc: netdev(a)vger.kernel.org
Cc: paulus(a)samba.org
Cc: ralf(a)linux-mips.org
Cc: rth(a)twiddle.net
Cc: schwidefsky(a)de.ibm.com
Cc: sparclinux(a)vger.kernel.org
Cc: tglx(a)linutronix.de
Cc: ubraun(a)linux.ibm.com
The following changes since commit 1c7fc5cbc33980acd13d668f1c8f0313d6ae9fd8:
Linux 5.0-rc2 (2019-01-14 10:41:12 +1200)
are available in the Git repository at:
git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground.git
tags/y2038-syscall-cleanup
for you to fetch changes up to 805089c2f77047d81f47ddc227435d606ceb180e:
syscalls: remove obsolete __IGNORE_ macros (2019-02-07 00:13:27 +0100)
----------------------------------------------------------------
arch: 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.
Signed-off-by: Arnd Bergmann <arnd(a)arndb.de>
----------------------------------------------------------------
Arnd Bergmann (22):
s390: open-code s390_personality syscall
ipc: introduce ksys_ipc()/compat_ksys_ipc() for s390
s390: use generic UID16 implementation
s390: autogenerate compat syscall wrappers
s390: remove compat_wrapper.c
ia64: add __NR_umount2 definition
ia64: add statx and io_pgetevents syscalls
ia64: assign syscall numbers for perf and seccomp
alpha: wire up io_pgetevents system call
alpha: update syscall macro definitions
ARM: add migrate_pages() system call
ARM: add kexec_file_load system call number
m68k: assign syscall number for seccomp
sh: remove duplicate unistd_32.h file
sh: add statx system call
sparc64: fix sparc_ipc type conversion
ipc: rename old-style shmctl/semctl/msgctl syscalls
arch: add split IPC system calls where needed
arch: add pkey and rseq syscall numbers everywhere
alpha: add standard statfs64/fstatfs64 syscalls
alpha: add generic get{eg,eu,g,p,u,pp}id() syscalls
syscalls: remove obsolete __IGNORE_ macros
arch/alpha/include/asm/unistd.h | 21 --
arch/alpha/include/uapi/asm/unistd.h | 10 +
arch/alpha/kernel/syscalls/syscall.tbl | 20 +-
arch/arm/include/asm/unistd.h | 1 -
arch/arm/tools/syscall.tbl | 8 +-
arch/arm64/include/asm/unistd.h | 2 +-
arch/arm64/include/asm/unistd32.h | 10 +-
arch/ia64/include/asm/unistd.h | 14 -
arch/ia64/include/uapi/asm/unistd.h | 2 +
arch/ia64/kernel/syscalls/syscall.tbl | 10 +-
arch/m68k/kernel/syscalls/syscall.tbl | 16 ++
arch/microblaze/kernel/syscalls/syscall.tbl | 6 +-
arch/mips/include/asm/unistd.h | 13 -
arch/mips/kernel/syscalls/syscall_n32.tbl | 6 +-
arch/mips/kernel/syscalls/syscall_n64.tbl | 6 +-
arch/mips/kernel/syscalls/syscall_o32.tbl | 11 +
arch/parisc/include/asm/unistd.h | 4 -
arch/parisc/kernel/syscalls/syscall.tbl | 4 +
arch/powerpc/kernel/syscalls/syscall.tbl | 13 +
arch/s390/Kconfig | 2 +
arch/s390/include/asm/syscall_wrapper.h | 135 ++++++++++
arch/s390/include/asm/unistd.h | 5 -
arch/s390/include/uapi/asm/posix_types.h | 6 +
arch/s390/kernel/Makefile | 2 +-
arch/s390/kernel/compat_linux.c | 235 +---------------
arch/s390/kernel/compat_wrapper.c | 186 -------------
arch/s390/kernel/entry.S | 4 +-
arch/s390/kernel/sys_s390.c | 16 +-
arch/s390/kernel/syscalls/syscall.tbl | 301 +++++++++++----------
arch/sh/include/uapi/asm/unistd_32.h | 403 ----------------------------
arch/sh/kernel/syscalls/syscall.tbl | 16 ++
arch/sparc/include/asm/unistd.h | 5 -
arch/sparc/kernel/sys_sparc_64.c | 2 +-
arch/sparc/kernel/syscalls/syscall.tbl | 16 ++
arch/x86/entry/syscalls/syscall_32.tbl | 11 +
arch/x86/entry/syscalls/syscall_64.tbl | 2 +
arch/xtensa/include/asm/unistd.h | 12 -
arch/xtensa/kernel/syscalls/syscall.tbl | 7 +-
include/linux/syscalls.h | 7 +
include/uapi/asm-generic/unistd.h | 1 +
ipc/msg.c | 39 ++-
ipc/sem.c | 39 ++-
ipc/shm.c | 40 ++-
ipc/syscall.c | 32 ++-
ipc/util.h | 21 +-
kernel/sys_ni.c | 4 +
46 files changed, 608 insertions(+), 1118 deletions(-)
create mode 100644 arch/s390/include/asm/syscall_wrapper.h
delete mode 100644 arch/s390/kernel/compat_wrapper.c
delete mode 100644 arch/sh/include/uapi/asm/unistd_32.h
The series introduces new socket timestamps that are
y2038 safe.
The time data types used for the existing socket timestamp
options: SO_TIMESTAMP, SO_TIMESTAMPNS and SO_TIMESTAMPING
are not y2038 safe. The series introduces SO_TIMESTAMP_NEW,
SO_TIMESTAMPNS_NEW and SO_TIMESTAMPING_NEW to replace these.
These new timestamps can be used on all architectures.
The alternative considered was to extend the sys_setsockopt()
by using the flags. We did not receive any strong opinions about
either of the approaches. Hence, this was chosen, as glibc folks
preferred this.
The series does not deal with updating the internal kernel socket
calls like rxrpc to make them y2038 safe. This will be dealt
with separately.
Note that the timestamps behavior already does not match the
man page specific behavior:
SIOCGSTAMP
This ioctl should only be used if the socket option SO_TIMESTAMP
is not set on the socket. Otherwise, it returns the timestamp of
the last packet that was received while SO_TIMESTAMP was not set,
or it fails if no such packet has been received,
(i.e., ioctl(2) returns -1 with errno set to ENOENT).
The recommendation is to update the man page to remove the above statement.
The overview of the socket timestamp series is as below:
1. Delete asm specific socket.h when possible.
2. Support SO/SCM_TIMESTAMP* options only in userspace.
3. Rename current SO/SCM_TIMESTAMP* to SO/SCM_TIMESTAMP*_OLD.
3. Alter socket options so that SOCK_RCVTSTAMPNS does
not rely on SOCK_RCVTSTAMP.
4. Introduce y2038 safe types for socket timestamp.
5. Introduce new y2038 safe socket options SO/SCM_TIMESTAMP*_NEW.
6. Intorduce new y2038 safe socket timeout options.
Changes since v3:
* Rebased onto net-next and fixups as per review comments
* Merged the socket timeout series
* Integrated Arnd's patch to simplify compat handling of timeout syscalls
Changes since v2:
* Removed extra functions to reduce diff churn as per code review
Changes since v1:
* Dropped the change to disentangle sock flags
* Renamed sock_timeval to __kernel_sock_timeval
* Updated a few comments
* Added documentation changes
Arnd Bergmann (1):
socket: move compat timeout handling into sock.c
Deepa Dinamani (11):
selftests: add missing include unistd
arch: Use asm-generic/socket.h when possible
sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD
arch: sparc: Override struct __kernel_old_timeval
socket: Use old_timeval types for socket timestamps
socket: Add struct __kernel_sock_timeval
socket: Add SO_TIMESTAMP[NS]_NEW
socket: Add SO_TIMESTAMPING_NEW
socket: Update timestamping Documentation
socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes
sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW
Documentation/networking/timestamping.txt | 43 ++++-
arch/alpha/include/uapi/asm/socket.h | 47 ++++--
arch/ia64/include/uapi/asm/Kbuild | 1 +
arch/ia64/include/uapi/asm/socket.h | 122 --------------
arch/mips/include/uapi/asm/socket.h | 47 ++++--
arch/parisc/include/uapi/asm/socket.h | 46 ++++--
arch/powerpc/include/uapi/asm/socket.h | 4 +-
arch/s390/include/uapi/asm/Kbuild | 1 +
arch/s390/include/uapi/asm/socket.h | 119 --------------
arch/sparc/include/uapi/asm/posix_types.h | 10 ++
arch/sparc/include/uapi/asm/socket.h | 49 ++++--
arch/x86/include/uapi/asm/Kbuild | 1 +
arch/x86/include/uapi/asm/socket.h | 1 -
arch/xtensa/include/asm/Kbuild | 1 +
arch/xtensa/include/uapi/asm/Kbuild | 1 +
arch/xtensa/include/uapi/asm/socket.h | 124 --------------
drivers/isdn/mISDN/socket.c | 2 +-
fs/dlm/lowcomms.c | 4 +-
include/linux/skbuff.h | 24 ++-
include/linux/socket.h | 8 +
include/net/sock.h | 1 +
include/uapi/asm-generic/socket.h | 48 ++++--
include/uapi/linux/errqueue.h | 4 +
include/uapi/linux/time.h | 7 +
net/bluetooth/hci_sock.c | 4 +-
net/compat.c | 78 +--------
net/core/scm.c | 27 ++++
net/core/sock.c | 151 +++++++++++++-----
net/ipv4/tcp.c | 61 ++++---
net/rds/af_rds.c | 10 +-
net/rds/recv.c | 18 ++-
net/rxrpc/local_object.c | 2 +-
net/smc/af_smc.c | 3 +-
net/socket.c | 50 ++++--
net/vmw_vsock/af_vsock.c | 4 +-
.../networking/timestamping/rxtimestamp.c | 1 +
36 files changed, 541 insertions(+), 583 deletions(-)
delete mode 100644 arch/ia64/include/uapi/asm/socket.h
delete mode 100644 arch/s390/include/uapi/asm/socket.h
delete mode 100644 arch/x86/include/uapi/asm/socket.h
delete mode 100644 arch/xtensa/include/uapi/asm/socket.h
--
2.17.1
Hi,
I was going through your website & I figured it'd be worth leaving a note.
We can help you with a fresh content and redesign your website according to
your requirement, promote your business online which would not only make you
rank high on search engines on relevant keywords, but we will also help you
uplift your brand in the market and get huge traffic with good number of
Inbound Leads to boost your product sales and services you provide.
Would you be open to seeing briefer info/quote for what I would like to
accomplish?
Please email us back to get more info.
Thanks & Regards,
Pearl Dawson
Santa Clara, CA
Senior Marketing Consultant
If you are not the right person, feel free to forward this email to the
right person in your organization.
To opt out, please reply with Leave Out in the Subject Line.
This is a minor update of the patches I posted last week, I
would like to add this into linux-next now, but would still do
changes if there are concerns about the contents. The first
version did not see a lot of replies, which could mean that
either everyone is happy with it, or that it was largely ignored.
See also the article at https://lwn.net/Articles/776435/.
Changes since v1:
- posting as a combined series for simplicity
- dropped one mips patch that was merged as a 5.0 fix
- reworked s390 compat syscall handling (posted separately)
and rebased on top of that series
- minor fixes for arm64 and powerpc
- added alpha statfs64 interfaces
- added alpha get{eg,eu,g,p,u,pp}id()
Arnd
----
v1 description for 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.
- 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.
- 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.
Most of the contents of this series are unrelated to the actual
y2038 work, but for the moment, that second series is based on
this one. If there are any concerns about changes here, I
can drop or rewrite any individual patch in this series.
My plan is to merge any patches in this series that are found
to be good together with the y2038 patches for linux-5.1, so
please review and provide Acks for merging through my tree,
or pick them up for 5.0 if they seem urgent enough.
v1 description for y2038 patches:
This series finally gets us to the point of having system calls with
64-bit time_t on all architectures, after a long time of incremental
preparation patches.
There was actually one conversion that I missed during the summer,
i.e. Deepa's timex series, which I now updated based the 5.0-rc1 changes
and review comments.
I hope that the actual conversion should be uncontroversial by now,
even if some of the patches are rather large.
The one area that may need a little discussion is for the system call
numbers assigned in the final patch: Can we get consensus on whether
the idea of using the same numbers on all architectures, as well as my
choice of numbers makes sense here?
So far, I have done a lot of build testing across most architectures,
which has found a number of bugs. I have also done an LTP run on arm32
with existing user space, but not on the other architectures. I did LTP
tests with a modified musl libc[2] last summer on an older version of
this series to make sure that the new 64-bit time_t interfaces work.
The version there will need updates for testing with this new kernel
patch series; I plan to do that next.
For testing, the series plus the preparatory patches is available at
[3]. Once there is a general agreement on this series and I have done
more tests for the new system calls, I plan to add this to linux-next
through my asm-generic tree or Thomas' timers tree.
Please review and test!
Arnd
[1] https://lore.kernel.org/lkml/20190110162435.309262-1-arnd@arndb.de/T/
[2] https://git.linaro.org/people/arnd/musl-y2038.git/
[3] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git y2038-5.0-rc1
Arnd Bergmann (26):
ia64: add __NR_umount2 definition
ia64: add statx and io_pgetevents syscalls
ia64: assign syscall numbers for perf and seccomp
alpha: wire up io_pgetevents system call
alpha: update syscall macro definitions
ARM: add migrate_pages() system call
ARM: add kexec_file_load system call number
m68k: assign syscall number for seccomp
sh: remove duplicate unistd_32.h file
sh: add statx system call
sparc64: fix sparc_ipc type conversion
ipc: rename old-style shmctl/semctl/msgctl syscalls
arch: add split IPC system calls where needed
arch: add pkey and rseq syscall numbers everywhere
alpha: add standard statfs64/fstatfs64 syscalls
alpha: add generic get{eg,eu,g,p,u,pp}id() syscalls
syscalls: remove obsolete __IGNORE_ macros
time: make adjtime compat handling available for 32 bit
time: fix sys_timer_settime prototype
sparc64: add custom adjtimex/clock_adjtime functions
x86/x32: use time64 versions of sigtimedwait and recvmmsg
y2038: syscalls: rename y2038 compat syscalls
y2038: use time32 syscall names on 32-bit
y2038: remove struct definition redirects
y2038: rename old time and utime syscalls
y2038: add 64-bit time_t syscalls to all 32-bit architectures
Deepa Dinamani (3):
time: Add struct __kernel_timex
timex: use __kernel_timex internally
timex: change syscalls to use struct __kernel_timex
arch/Kconfig | 2 +-
arch/alpha/include/asm/unistd.h | 21 -
arch/alpha/include/uapi/asm/unistd.h | 10 +
arch/alpha/kernel/osf_sys.c | 5 +-
arch/alpha/kernel/syscalls/syscall.tbl | 22 +-
arch/arm/include/asm/unistd.h | 5 +-
arch/arm/kernel/sys_oabi-compat.c | 8 +-
arch/arm/tools/syscall.tbl | 85 +++--
arch/arm64/include/asm/unistd.h | 2 +-
arch/arm64/include/asm/unistd32.h | 99 +++--
arch/ia64/include/asm/unistd.h | 14 -
arch/ia64/include/uapi/asm/unistd.h | 2 +
arch/ia64/kernel/syscalls/syscall.tbl | 11 +-
arch/m68k/include/asm/unistd.h | 4 +-
arch/m68k/kernel/syscalls/syscall.tbl | 88 +++--
arch/microblaze/include/asm/unistd.h | 4 +-
arch/microblaze/kernel/syscalls/syscall.tbl | 83 ++--
arch/mips/include/asm/unistd.h | 20 +-
arch/mips/kernel/syscalls/syscall_n32.tbl | 77 ++--
arch/mips/kernel/syscalls/syscall_n64.tbl | 7 +-
arch/mips/kernel/syscalls/syscall_o32.tbl | 85 +++--
arch/parisc/include/asm/unistd.h | 15 +-
arch/parisc/kernel/syscalls/syscall.tbl | 109 ++++--
arch/powerpc/include/asm/unistd.h | 8 +-
arch/powerpc/kernel/syscalls/syscall.tbl | 134 +++++--
arch/s390/include/asm/unistd.h | 7 +-
arch/s390/kernel/syscalls/syscall.tbl | 87 +++--
arch/sh/include/asm/unistd.h | 4 +-
arch/sh/include/uapi/asm/unistd_32.h | 403 --------------------
arch/sh/kernel/syscalls/syscall.tbl | 88 +++--
arch/sparc/include/asm/unistd.h | 13 +-
arch/sparc/kernel/sys_sparc_64.c | 61 ++-
arch/sparc/kernel/syscalls/syscall.tbl | 116 ++++--
arch/x86/entry/syscalls/syscall_32.tbl | 85 +++--
arch/x86/entry/syscalls/syscall_64.tbl | 4 +-
arch/x86/include/asm/unistd.h | 8 +-
arch/xtensa/include/asm/unistd.h | 14 +-
arch/xtensa/kernel/syscalls/syscall.tbl | 78 ++--
drivers/ptp/ptp_clock.c | 2 +-
fs/aio.c | 10 +-
fs/select.c | 4 +-
fs/timerfd.c | 4 +-
fs/utimes.c | 10 +-
include/linux/compat.h | 104 +----
include/linux/posix-clock.h | 2 +-
include/linux/syscalls.h | 68 +++-
include/linux/time32.h | 32 +-
include/linux/time64.h | 8 -
include/linux/timex.h | 4 +-
include/uapi/asm-generic/unistd.h | 103 +++--
include/uapi/linux/time.h | 4 -
include/uapi/linux/timex.h | 39 ++
ipc/mqueue.c | 16 +-
ipc/msg.c | 39 +-
ipc/sem.c | 41 +-
ipc/shm.c | 40 +-
ipc/syscall.c | 12 +-
ipc/util.h | 21 +-
kernel/compat.c | 64 ----
kernel/futex.c | 2 +-
kernel/sched/core.c | 5 +-
kernel/signal.c | 2 +-
kernel/sys_ni.c | 21 +-
kernel/time/hrtimer.c | 2 +-
kernel/time/ntp.c | 18 +-
kernel/time/ntp_internal.h | 2 +-
kernel/time/posix-clock.c | 2 +-
kernel/time/posix-stubs.c | 25 +-
kernel/time/posix-timers.c | 72 ++--
kernel/time/posix-timers.h | 2 +-
kernel/time/time.c | 92 ++++-
kernel/time/timekeeping.c | 4 +-
net/compat.c | 2 +-
scripts/checksyscalls.sh | 40 ++
74 files changed, 1544 insertions(+), 1262 deletions(-)
delete mode 100644 arch/sh/include/uapi/asm/unistd_32.h
--
2.20.0
Cc: mattst88(a)gmail.com
Cc: linux(a)armlinux.org.uk
Cc: catalin.marinas(a)arm.com
Cc: will.deacon(a)arm.com
Cc: tony.luck(a)intel.com
Cc: fenghua.yu(a)intel.com
Cc: geert(a)linux-m68k.org
Cc: monstr(a)monstr.eu
Cc: paul.burton(a)mips.com
Cc: deller(a)gmx.de
Cc: benh(a)kernel.crashing.org
Cc: mpe(a)ellerman.id.au
Cc: schwidefsky(a)de.ibm.com
Cc: heiko.carstens(a)de.ibm.com
Cc: dalias(a)libc.org
Cc: davem(a)davemloft.net
Cc: luto(a)kernel.org
Cc: tglx(a)linutronix.de
Cc: mingo(a)redhat.com
Cc: hpa(a)zytor.com
Cc: x86(a)kernel.org
Cc: jcmvbkbc(a)gmail.com
Cc: arnd(a)arndb.de
Cc: akpm(a)linux-foundation.org
Cc: deepa.kernel(a)gmail.com
Cc: ebiederm(a)xmission.com
Cc: firoz.khan(a)linaro.org
Cc: linux-kernel(a)vger.kernel.org
Cc: linux-alpha(a)vger.kernel.org
Cc: linux-arm-kernel(a)lists.infradead.org
Cc: linux-ia64(a)vger.kernel.org
Cc: linux-m68k(a)lists.linux-m68k.org
Cc: linux-mips(a)vger.kernel.org
Cc: linux-parisc(a)vger.kernel.org
Cc: linuxppc-dev(a)lists.ozlabs.org
Cc: linux-s390(a)vger.kernel.org
Cc: linux-sh(a)vger.kernel.org
Cc: sparclinux(a)vger.kernel.org
Cc: netdev(a)vger.kernel.org
Cc: linux-fsdevel(a)vger.kernel.org
Cc: linux-api(a)vger.kernel.org
Cc: linux-arch(a)vger.kernel.org
This will be an automated scripts to provide easy support
for add/modify/delete the system call entry by add in
respective *.tbl file.
System call table generation support for asm-generic is
provide for arm64 architecture which will use the common
scripts resides in scripts directory and use syscall.tbl
syscall_arm32.tbl files as inputs. This implementation
will replace asm-generic/unistd.h.
This patch depends on:
https://lore.kernel.org/lkml/1546439331-18646-1-git-send-email-firoz.khan@l…https://lore.kernel.org/lkml/1546520681-24453-1-git-send-email-firoz.khan@l…
Firoz Khan (3):
arm64: add system call table generation files
arm64: assign __NR_*_Linux_syscalls generated by the scripts
arm64: generate uapi and kapi headers
arch/arm64/Makefile | 3 +
arch/arm64/include/asm/Kbuild | 2 +
arch/arm64/include/asm/unistd.h | 10 +-
arch/arm64/include/asm/unistd32.h | 826 ---------------------------
arch/arm64/include/uapi/asm/Kbuild | 4 +
arch/arm64/include/uapi/asm/unistd.h | 13 +-
arch/arm64/kernel/sys.c | 8 +-
arch/arm64/kernel/sys32.c | 8 +-
arch/arm64/kernel/syscall.c | 4 +-
arch/arm64/kernel/syscalls/Makefile | 70 +++
arch/arm64/kernel/syscalls/syscall_arm32.tbl | 434 ++++++++++++++
lib/compat_audit.c | 2 +-
12 files changed, 540 insertions(+), 844 deletions(-)
delete mode 100644 arch/arm64/include/asm/unistd32.h
create mode 100644 arch/arm64/kernel/syscalls/Makefile
create mode 100644 arch/arm64/kernel/syscalls/syscall_arm32.tbl
--
1.9.1
Hi Heiko and Martin,
As promised, I gave this a go and changed the SYSCALL_DEFINEx()
infrastructure to always include the wrappers for doing the
31-bit argument conversion on s390 compat mode.
This does three main things:
- The UID16 rework saved a lot of duplicated code, and would
probably make sense by itself, but is also required as
we can no longer call sys_*() functions directly after the
last step.
- Removing the compat_wrapper.c file is of course the main
goal here, in order to remove the need to maintain the
compat_wrapper.c file when new system calls get added.
Unfortunately, this requires adding some complexity in
syscall_wrapper.h, and trades a small reduction in source
code lines for a small increase in binary size for
unused wrappers.
- As an added benefit, the use of syscall_wrapper.h now makes
it easy to change the syscall wrappers so they no longer
see all user space register contents, similar to changes
done in commits fa697140f9a2 ("syscalls/x86: Use 'struct pt_regs'
based syscall calling convention for 64-bit syscalls") and
4378a7d4be30 ("arm64: implement syscall wrappers").
I leave the actual implementation of this for you, if you
want to do it later.
I did not test the changes at runtime, but I looked at the
generated object code, which seems fine here and includes
the same conversions as before.
Arnd
Arnd Bergmann (5):
s390: open-code s390_personality syscall
ipc: introduce ksys_ipc()/compat_ksys_ipc() for s390
s390: use generic UID16 implementation
s390: autogenerate compat syscall wrappers
s390: remove compat_wrapper.c
arch/s390/Kconfig | 2 +
arch/s390/include/asm/syscall_wrapper.h | 136 +++++++++++
arch/s390/include/uapi/asm/posix_types.h | 6 +
arch/s390/kernel/Makefile | 2 +-
arch/s390/kernel/compat_linux.c | 235 +------------------
arch/s390/kernel/compat_wrapper.c | 186 ---------------
arch/s390/kernel/entry.S | 4 +-
arch/s390/kernel/sys_s390.c | 14 +-
arch/s390/kernel/syscalls/syscall.tbl | 286 +++++++++++------------
include/linux/syscalls.h | 4 +
ipc/syscall.c | 20 +-
11 files changed, 322 insertions(+), 573 deletions(-)
create mode 100644 arch/s390/include/asm/syscall_wrapper.h
delete mode 100644 arch/s390/kernel/compat_wrapper.c
--
2.20.0
I recently discussed with Rich about the work needed to get 64-bit time_t
support into musl. One of the first steps he identified was to find out which
interfaces we would want to abstract or wrap for a new ABI given that we
have to make a binary incompatible interface anyway.
I have found all the data structures that are provided by both the kernel
headers and the musl headers now, and annotated what I think we the
path forward could be. I already provided the same list on IRC, but
here is a (slightly updated) copy for everyone else.
The takeaway is that we probably need to add new definitions for
flock64, statfs, stat, termios, {msg,sem,shm}{buf,info,id_ds}, ipc_perm,
rlimit, rusage, sched_param, time_t, timeval, timespec, itimerval,
itimerspec, and timex, and then wrap all kernel interfaces that
use those.
The same list can also be helpful when we try to clean up the kernel
header files -- my idea was that we may want to prefix each struct
tag with __kernel_ as we do for typedefs, and then have a kernel
header that redefines them like
#ifdef __WANT_KERNEL_STRUCTS
#define __kernel_flock flock
#endif
struct __kernel_flock {
...
};
Arnd
/* sparc and mips are incompatible, keep wrapping flock64 */
include/uapi/asm-generic/fcntl.h:struct flock {
arch/mips/include/uapi/asm/fcntl.h:struct flock {
/* pt_regs and sigcontext are arch specific, cannot abstract */
arch/*/include/uapi/asm/ptrace.h:struct pt_regs {
arch/*/include/uapi/asm/ptrace.h:struct user_regs_struct {
arch/arm64/include/uapi/asm/sigcontext.h:struct _aarch64_ctx {
arch/arm64/include/uapi/asm/sigcontext.h:struct esr_context {
arch/arm64/include/uapi/asm/sigcontext.h:struct extra_context {
arch/arm64/include/uapi/asm/sigcontext.h:struct sve_context {
arch/*/include/uapi/asm/sigcontext.h:struct sigcontext {
/* arch specific, has wrapper */
arch/*/include/uapi/asm/signal.h:struct sigaction {
include/uapi/asm-generic/signal.h:struct sigaction {
/* arch specific, maybe add wrapper? */
arch/*/include/uapi/asm/signal.h:typedef struct sigaltstack {
include/uapi/asm-generic/signal.h:typedef struct sigaltstack {
/* arch specific, need to look closer for incompatibilities */
include/uapi/asm-generic/siginfo.h:typedef struct sigevent {
/* arch specific, should add wrapper */
arch/*/include/uapi/asm/statfs.h:struct statfs {
include/uapi/asm-generic/statfs.h:struct statfs {
/* arch specific, wrap statx instead */
arch/*/include/uapi/asm/stat.h:struct stat {
include/uapi/asm-generic/stat.h:struct stat {
include/uapi/linux/stat.h:struct statx {
include/uapi/linux/stat.h:struct statx_timestamp {
/* arch specific, should wrap termios2 where possible,
* need to check what musl does now */
arch/*/include/uapi/asm/termbits.h:struct termios {
include/uapi/asm-generic/termbits.h:struct termios {
/* IPC: wrap them all */
include/uapi/linux/mqueue.h:struct mq_attr {
include/uapi/linux/msg.h:struct msgbuf {
include/uapi/linux/msg.h:struct msginfo {
include/uapi/linux/msg.h:struct msqid_ds {
include/uapi/linux/sem.h:struct sembuf {
include/uapi/linux/sem.h:struct semid_ds {
include/uapi/linux/sem.h:struct seminfo {
include/uapi/linux/shm.h:struct shmid_ds {
include/uapi/linux/shm.h:struct shm_info {
include/uapi/linux/shm.h:struct shminfo {
/* rlimit/rlimit64: keep using only rlimit64 */
include/uapi/linux/resource.h:struct rlimit {
include/uapi/linux/resource.h:struct rlimit64 {
/* rusuage: need to wrap: getrusage, wait4 */
include/uapi/linux/resource.h:struct rusage {
/* wrapped already, replace with a more extensible one */
include/uapi/linux/sched/types.h:struct sched_param {
/* prctl(PR_SET_MM); broken in kernel compat mode?
* could be wrapped if necessary */
include/uapi/linux/prctl.h:struct prctl_mm_map {
/* inconsistent amount of padding, maybe wrap */
include/uapi/linux/sysinfo.h:struct sysinfo {
/* time64: need to use 64-bit versions of time_t */
include/uapi/linux/time.h:timespec {
include/uapi/linux/time.h:struct itimerspec {
/* need to wrap */
include/uapi/linux/utime.h:struct utimbuf {
include/uapi/linux/time.h:timeval {
include/uapi/linux/time.h:struct itimerval {
/* no need to change */
include/uapi/linux/time.h:struct timezone {
/* probably need to wrap (depending on kernel decision) */
include/uapi/linux/timex.h:struct timex {
/* incompatible on x32 */
include/uapi/linux/times.h:struct tms {
include/uapi/linux/uio.h:struct iovec {
/* tape driver ioctls, musl copy is incompatible
* on mips64, sparc64 */
include/uapi/linux/mtio.h:struct mtget {
include/uapi/linux/mtio.h:struct mtop {
include/uapi/linux/mtio.h:struct mtpos {
/* compatible, no need to wrap */
include/uapi/asm-generic/fcntl.h:struct f_owner_ex {
include/uapi/asm-generic/poll.h:struct pollfd {
include/uapi/asm-generic/termios.h:struct winsize {
include/uapi/linux/acct.h:struct acct_v3
include/uapi/linux/eventpoll.h:struct epoll_event {
include/uapi/linux/fanotify.h:struct fanotify_event_metadata {
include/uapi/linux/fanotify.h:struct fanotify_response {
include/uapi/linux/signalfd.h:struct signalfd_siginfo {
/* fixed wire format */
include/uapi/linux/udp.h:struct udphdr {
include/uapi/linux/icmp.h:struct icmphdr {
include/uapi/linux/if_arp.h:struct arphdr {
include/uapi/linux/tcp.h:struct tcphdr {
include/uapi/linux/if_ether.h:struct ethhdr {
include/uapi/linux/ip.h:struct iphdr {
/* other network stuff, fixed format */
include/uapi/linux/icmpv6.h:struct icmp6_filter {
include/uapi/linux/if_arp.h:struct arpreq {
include/uapi/linux/if_arp.h:struct arpreq_old {
include/uapi/linux/if.h:struct ifconf {
include/uapi/linux/if.h:struct ifmap {
include/uapi/linux/if.h:struct ifreq {
include/uapi/linux/if_packet.h:struct packet_mreq {
include/uapi/linux/if_packet.h:struct sockaddr_ll {
include/uapi/linux/in6.h:struct in6_addr {
include/uapi/linux/in6.h:struct ipv6_mreq {
include/uapi/linux/in6.h:struct sockaddr_in6 {
include/uapi/linux/in.h:struct group_filter {
include/uapi/linux/in.h:struct group_req {
include/uapi/linux/in.h:struct group_source_req {
include/uapi/linux/in.h:struct in_addr {
include/uapi/linux/in.h:struct in_pktinfo {
include/uapi/linux/in.h:struct ip_mreq {
include/uapi/linux/in.h:struct ip_mreqn {
include/uapi/linux/in.h:struct ip_mreq_source {
include/uapi/linux/in.h:struct ip_msfilter {
include/uapi/linux/in.h:struct sockaddr_in {
include/uapi/linux/inotify.h:struct inotify_event {
include/uapi/linux/ipc.h:struct ipc_perm
include/uapi/linux/ipv6.h:struct in6_pktinfo {
include/uapi/linux/ipv6.h:struct ip6_mtuinfo {
include/uapi/linux/ipv6_route.h:struct in6_rtmsg {
include/uapi/linux/route.h:struct rtentry {
include/uapi/linux/tcp.h:struct tcp_diag_md5sig {
include/uapi/linux/tcp.h:struct tcp_info {
include/uapi/linux/tcp.h:struct tcp_md5sig {
include/uapi/linux/tcp.h:struct tcp_repair_window {
include/uapi/linux/un.h:struct sockaddr_un {
/* shared typedefs: all in ELF format; can't change */
arch/*/include/uapi/asm/elf.h:typedef ... elf_fpregset_t;
arch/*/include/uapi/asm/elf.h:typedef ... elf_greg_t;
arch/*/include/uapi/asm/elf.h:typedef elf_greg_t elf_gregset_t[ELF_NGREG];
arch/sparc/include/uapi/asm/uctx.h:} mcontext_t;
arch/sparc/include/uapi/asm/uctx.h:typedef struct ucontext ucontext_t;
include/uapi/linux/elf.h:typedef struct elf32_hdr Elf32_Ehdr;
include/uapi/linux/elf.h:typedef struct elf64_hdr Elf64_Ehdr;
include/uapi/linux/elf.h:typedef struct {...} Elf32_Shdr;
include/uapi/linux/elf.h:typedef struct {...} Elf64_Shdr;
include/uapi/linux/elf.h:typedef struct {...} Elf32_Chdr;
include/uapi/linux/elf.h:typedef struct {...} Elf64_Chdr;
include/uapi/linux/elf.h:typedef struct {...} Elf32_Nhdr;
include/uapi/linux/elf.h:typedef struct {...} Elf64_Nhdr;
include/uapi/linux/elf.h:typedef ...
include/uapi/linux/elfcore.h:typedef elf_gregset_t gregset_t;
include/uapi/linux/elfcore.h: elf_gregset_t pr_reg; /* GP registers */
include/uapi/linux/elfcore.h:typedef elf_greg_t greg_t;
include/uapi/linux/elfcore.h:typedef elf_gregset_t gregset_t;
include/uapi/linux/elfcore.h:typedef elf_fpregset_t fpregset_t;
include/uapi/linux/elfcore.h:struct elf_prpsinfo
include/uapi/linux/elfcore.h:struct elf_prstatus
include/uapi/linux/elfcore.h:struct elf_siginfo
/* sg.h missing from exported kernel headers, can't change */
include/scsi/sg.h:typedef struct sg_iovec sg_iovec_t;
include/scsi/sg.h:typedef struct sg_io_hdr sg_io_hdr_t;
include/scsi/sg.h-struct sg_scsi_id {
include/scsi/sg.h:typedef struct sg_req_info sg_req_info_t;
include/scsi/sg.h:typedef struct sg_io_hdr Sg_io_hdr;
include/scsi/sg.h:typedef struct sg_io_vec Sg_io_vec;
include/scsi/sg.h:typedef struct sg_scsi_id Sg_scsi_id;
include/scsi/sg.h:typedef struct sg_req_info Sg_req_info;
include/scsi/sg.h-struct sg_header {
/* 32-bit on alpha, used in ustat (not provided by musl) */
include/uapi/asm-generic/posix_types.h:typedef __kernel_ulong_t __kernel_ino_t;
/* 64-bit on mips64, used in mtio (should fix?) and ustat */
include/uapi/asm-generic/posix_types.h:typedef int __kernel_daddr_t;
/* 16 bit on older architectures but only used in IPC interfaces,
which will get wrapped anyway */
include/uapi/asm-generic/posix_types.h:typedef unsigned int __kernel_mode_t;
include/uapi/asm-generic/posix_types.h:typedef int
__kernel_ipc_pid_t;
include/uapi/asm-generic/posix_types.h:typedef unsigned int __kernel_uid_t;
include/uapi/asm-generic/posix_types.h:typedef unsigned int __kernel_gid_t;