On Thu, Jan 4, 2018 at 9:00 AM, Christoph Hellwig <hch(a)lst.de> wrote:
> +}
> +
> +SYSCALL_DEFINE6(io_pgetevents,
> + aio_context_t, ctx_id,
> + long, min_nr,
> + long, nr,
> + struct io_event __user *, events,
> + struct timespec __user *, timeout,
> + const sigset_t __user *, sigmask)
> +{
> +COMPAT_SYSCALL_DEFINE6(io_pgetevents,
> + compat_aio_context_t, ctx_id,
> + compat_long_t, min_nr,
> + compat_long_t, nr,
> + struct io_event __user *, events,
> + struct compat_timespec __user *, timeout,
> + const compat_sigset_t __user *, sigmask)
> +{
Hmm, these two new syscall entry points turn into four when we add in
support for 64-bit time_t, as we'd have to support all combinations of 32/64
bit aio_context_t and time_t.
Would it be better to start this interface out by defining it using a 64-bit
timeout structure? The downside would be that the user space syscall
wrappers have to start out with a conversion, if we don't do it, then
the opposite conversion would have to get added later.
Arnd
The series is aimed at making input events y2038 safe.
It extends the lifetime of the realtime timestamps in the
events to year 2106.
The series is also a necessary update as glibc is set to provide
64 bit time_t support for 32 bit binaries. glibc plan is detailed
at https://sourceware.org/glibc/wiki/Y2038ProofnessDesign .
The series is a result of discussions with Arnd Bergmann and
Dmitry Torokhov at last Plumbers.
The plan is to deprecate realtime timestamps anyway as they
are not appropriate for these timestamps as noted in the patch
a80b83b7b8 by John Stultz.
The design also updates the format of the input events read/ written
to the device nodes. This breaks 32 bit interface to the input
events at compile time as preferred by the maintainer.
The userspace library changes to libevdev, libuinput and mtdev
will be posted to the respective mailing groups for review.
Changes from v5:
* Dropped patch 1, since it has already been applied
* Combined patches 2 and 3
* Addressed minor review comments
Changes from v4:
* Dropped serio hil patch
Changes from v3:
* Updated uinput to support monotonic time only
* Addressed review comments
Changes from v2:
* Updated the design to break 32 bit interfaces at compile time.
Changes from v1:
* Updated changes according to review comments.
* Posted userspace library changes that go along with the series.
Deepa Dinamani (1):
input: Deprecate real timestamps beyond year 2106
drivers/input/evdev.c | 16 ++++++++++++----
drivers/input/input-compat.c | 8 ++++----
drivers/input/input-compat.h | 3 ++-
drivers/input/misc/uinput.c | 4 ++--
include/uapi/linux/input.h | 12 +++++++++++-
5 files changed, 31 insertions(+), 12 deletions(-)
base-commit: 0c1f9d81ac360d8ad31cbfd2bdcf44de8204188e
prerequisite-patch-id: 6c903c00c9d5191619efe9f26e2600197336e6b2
--
2.14.1
The series is aimed at making input events y2038 safe.
It extends the lifetime of the realtime timestamps in the
events to year 2106.
The series is also a necessary update as glibc is set to provide
64 bit time_t support for 32 bit binaries. glibc plan is detailed
at https://sourceware.org/glibc/wiki/Y2038ProofnessDesign .
The series is a result of discussions with Arnd Bergmann and
Dmitry Torokhov at last Plumbers.
The plan is to deprecate realtime timestamps anyway as they
are not appropriate for these timestamps as noted in the patch
a80b83b7b8 by John Stultz.
The design also updates the format of the input events read/ written
to the device nodes. This breaks 32 bit interface to the input
events at compile time as preferred by the maintainer.
The userspace library changes to libevdev, libuinput and mtdev
will be posted to the respective mailing groups for review.
Changes from v4:
* Dropped serio hil patch
Changes from v3:
* Updated uinput to support monotonic time only
* Addressed review comments
Changes from v2:
* Updated the design to break 32 bit interfaces at compile time.
Changes from v1:
* Updated changes according to review comments.
* Posted userspace library changes that go along with the series.
Deepa Dinamani (3):
uinput: Use monotonic times for uinput timestamps.
input: evdev: Replace timeval with timespec64
input: Deprecate real timestamps beyond year 2106
drivers/input/evdev.c | 43 +++++++++++++++++++++++++++----------------
drivers/input/input-compat.c | 11 ++++++-----
drivers/input/input-compat.h | 3 ++-
drivers/input/misc/uinput.c | 5 ++++-
include/uapi/linux/input.h | 12 +++++++++++-
5 files changed, 50 insertions(+), 24 deletions(-)
base-commit: 0c1f9d81ac360d8ad31cbfd2bdcf44de8204188e
--
2.14.1
The series is a preparation series for individual architectures
to use 64 bit time_t syscalls in compat and 32 bit emulation modes.
This is a follow up to the series Arnd Bergmann posted:
https://sourceware.org/ml/libc-alpha/2015-05/msg00070.html [1]
Big picture is as per the lwn article:
https://lwn.net/Articles/643234/ [2]
The series is directed at converting posix clock syscalls:
clock_gettime, clock_settime, clock_getres and clock_nanosleep
to use a new data structure __kernel_timespec at syscall boundaries.
__kernel_timespec maintains 64 bit time_t across all execution modes.
vdso will be handled as part of each architecture when they enable
support for 64 bit time_t.
The compat syscalls are repurposed to provide backward compatibility
by using them as native syscalls as well for 32 bit architectures.
They will continue to use timespec at syscall boundaries.
CONFIG_64_BIT_TIME controls whether the syscalls use __kernel_timespec
or timespec at syscall boundaries.
The series does the following:
1. Enable compat syscalls on 32 bit architectures.
2. Add a new __kernel_timespec type to be used as the data structure
for all the new syscalls.
3. Add new config CONFIG_64BIT_TIME(intead of the CONFIG_COMPAT_TIME in
[1] and [2] to switch to new definition of __kernel_timespec. It is
the same as struct timespec otherwise.
4. Add new CONFIG_32BIT_TIME to conditionally compile compat syscalls.
* Changes since v1:
* Introduce CONFIG_32BIT_TIME
* Fixed zeroing out of higher order bits of tv_nsec
* Included Arnd's changes to fix up use of compat headers
I decided against using LEGACY_TIME_SYSCALLS to conditionally compile
legacy time syscalls such as sys_nanosleep because this will need to
enclose compat_sys_nanosleep as well. So, defining it as
config LEGACY_TIME_SYSCALLS
def_bool 64BIT || !64BIT_TIME
will not include compat_sys_nanosleep. We will instead need a new config to
exclusively mark legacy syscalls.
Deepa Dinamani (10):
compat: Make compat helpers independent of CONFIG_COMPAT
include: Move compat_timespec/ timeval to compat_time.h
compat: enable compat_get/put_timespec64 always
arch: introduce CONFIG_64BIT_TIME
arch: Introduce CONFIG_COMPAT_32BIT_TIME
posix-clocks: Make compat syscalls depend on CONFIG_COMPAT_32BIT_TIME
include: Add new y2038 safe __kernel_timespec
fix get_timespec64() for y2038 safe compat interfaces
change time types to new y2038 safe __kernel_* types
nanosleep: change time types to safe __kernel_* types
arch/Kconfig | 18 +++++++
arch/arm64/include/asm/compat.h | 11 ----
arch/arm64/include/asm/stat.h | 1 +
arch/arm64/kernel/hw_breakpoint.c | 1 -
arch/arm64/kernel/perf_regs.c | 2 +-
arch/arm64/kernel/process.c | 1 -
arch/mips/include/asm/compat.h | 11 ----
arch/mips/kernel/signal32.c | 2 +-
arch/parisc/include/asm/compat.h | 11 ----
arch/powerpc/include/asm/compat.h | 11 ----
arch/powerpc/kernel/asm-offsets.c | 2 +-
arch/powerpc/oprofile/backtrace.c | 2 +-
arch/s390/hypfs/hypfs_sprp.c | 1 -
arch/s390/include/asm/compat.h | 11 ----
arch/s390/include/asm/elf.h | 3 +-
arch/s390/kvm/priv.c | 1 -
arch/s390/pci/pci_clp.c | 1 -
arch/sparc/include/asm/compat.h | 11 ----
arch/tile/include/asm/compat.h | 11 ----
arch/x86/events/core.c | 2 +-
arch/x86/include/asm/compat.h | 11 ----
arch/x86/include/asm/ftrace.h | 2 +-
arch/x86/include/asm/sys_ia32.h | 2 +-
arch/x86/kernel/sys_x86_64.c | 2 +-
drivers/s390/block/dasd_ioctl.c | 1 -
drivers/s390/char/fs3270.c | 1 -
drivers/s390/char/sclp_ctl.c | 1 -
drivers/s390/char/vmcp.c | 1 -
drivers/s390/cio/chsc_sch.c | 1 -
drivers/s390/net/qeth_core_main.c | 2 +-
drivers/staging/pi433/pi433_if.c | 2 +-
include/linux/compat.h | 11 ++--
include/linux/compat_time.h | 23 +++++++++
include/linux/restart_block.h | 7 +--
include/linux/syscalls.h | 12 ++---
include/linux/time.h | 4 +-
include/linux/time64.h | 10 +++-
include/uapi/asm-generic/posix_types.h | 1 +
include/uapi/linux/time.h | 7 +++
kernel/Makefile | 2 +-
kernel/compat.c | 92 ++++++++++++++++++----------------
kernel/time/hrtimer.c | 10 ++--
kernel/time/posix-stubs.c | 12 +++--
kernel/time/posix-timers.c | 24 ++++++---
kernel/time/time.c | 10 +++-
45 files changed, 175 insertions(+), 190 deletions(-)
create mode 100644 include/linux/compat_time.h
base-commit: b0a84f19a5161418d4360cd57603e94ed489915e
--
2.14.1
Cc: acme(a)kernel.org
Cc: benh(a)kernel.crashing.org
Cc: borntraeger(a)de.ibm.com
Cc: catalin.marinas(a)arm.com
Cc: cmetcalf(a)mellanox.com
Cc: cohuck(a)redhat.com
Cc: davem(a)davemloft.net
Cc: deller(a)gmx.de
Cc: devel(a)driverdev.osuosl.org
Cc: gerald.schaefer(a)de.ibm.com
Cc: gregkh(a)linuxfoundation.org
Cc: heiko.carstens(a)de.ibm.com
Cc: hoeppner(a)linux.vnet.ibm.com
Cc: hpa(a)zytor.com
Cc: jejb(a)parisc-linux.org
Cc: jwi(a)linux.vnet.ibm.com
Cc: linux-api(a)vger.kernel.org
Cc: linux-arch(a)vger.kernel.org
Cc: linux-kernel(a)vger.kernel.org
Cc: linux-mips(a)linux-mips.org
Cc: linux-parisc(a)vger.kernel.org
Cc: linuxppc-dev(a)lists.ozlabs.org
Cc: linux-s390(a)vger.kernel.org
Cc: mark.rutland(a)arm.com
Cc: mingo(a)redhat.com
Cc: mpe(a)ellerman.id.au
Cc: oberpar(a)linux.vnet.ibm.com
Cc: oprofile-list(a)lists.sf.net
Cc: paulus(a)samba.org
Cc: peterz(a)infradead.org
Cc: ralf(a)linux-mips.org
Cc: rostedt(a)goodmis.org
Cc: rric(a)kernel.org
Cc: schwidefsky(a)de.ibm.com
Cc: sebott(a)linux.vnet.ibm.com
Cc: sparclinux(a)vger.kernel.org
Cc: sth(a)linux.vnet.ibm.com
Cc: ubraun(a)linux.vnet.ibm.com
Cc: will.deacon(a)arm.com
Cc: x86(a)kernel.org