All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-10 22:42 ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz
  Cc: linux-kernel, arnd, y2038, acme, benh, borntraeger,
	catalin.marinas, cmetcalf, cohuck, davem, deller, devel,
	gerald.schaefer, gregkh, heiko.carstens, hoeppner, hpa, jejb,
	jwi, linux-api, linux-arch, linux-mips, linux-parisc,
	linuxppc-dev, linux-s390, mark.rutland, mingo, mpe, oberpar,
	oprofile-list, paulus, peterz, ralf

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

Big picture is as per the lwn article:
https://lwn.net/Articles/643234/

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 unconditionally.
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.

Arnd Bergmann (1):
  y2038: introduce CONFIG_64BIT_TIME

Deepa Dinamani (8):
  include: Move compat_timespec/ timeval to compat_time.h
  compat: Make compat helpers independent of CONFIG_COMPAT
  compat: enable compat_get/put_timespec64 always
  posix-clocks: Enable compat syscalls always
  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                           | 11 ++++
 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                 |  7 ++-
 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                  |  7 +--
 kernel/time/posix-stubs.c              | 12 ++---
 kernel/time/posix-timers.c             | 20 ++++----
 kernel/time/time.c                     | 10 +++-
 45 files changed, 152 insertions(+), 195 deletions(-)
 create mode 100644 include/linux/compat_time.h


base-commit: d9e0e63d9a6f88440eb201e1491fcf730272c706
-- 
2.11.0

Cc: acme@kernel.org
Cc: benh@kernel.crashing.org
Cc: borntraeger@de.ibm.com
Cc: catalin.marinas@arm.com
Cc: cmetcalf@mellanox.com
Cc: cohuck@redhat.com
Cc: davem@davemloft.net
Cc: deller@gmx.de
Cc: devel@driverdev.osuosl.org
Cc: gerald.schaefer@de.ibm.com
Cc: gregkh@linuxfoundation.org
Cc: heiko.carstens@de.ibm.com
Cc: hoeppner@linux.vnet.ibm.com
Cc: hpa@zytor.com
Cc: jejb@parisc-linux.org
Cc: jwi@linux.vnet.ibm.com
Cc: linux-api@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Cc: mark.rutland@arm.com
Cc: mingo@redhat.com
Cc: mpe@ellerman.id.au
Cc: oberpar@linux.vnet.ibm.com
Cc: oprofile-list@lists.sf.net
Cc: paulus@samba.org
Cc: peterz@infradead.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: rric@kernel.org
Cc: schwidefsky@de.ibm.com
Cc: sebott@linux.vnet.ibm.com
Cc: sparclinux@vger.kernel.org
Cc: sth@linux.vnet.ibm.com
Cc: ubraun@linux.vnet.ibm.com
Cc: will.deacon@arm.com
Cc: x86@kernel.org

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-10 22:42 ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz
  Cc: linux-kernel, arnd, y2038, acme, benh, borntraeger,
	catalin.marinas, cmetcalf, cohuck, davem, deller, devel,
	gerald.schaefer, gregkh, heiko.carstens, hoeppner, hpa, jejb,
	jwi, linux-api, linux-arch, linux-mips, linux-parisc,
	linuxppc-dev, linux-s390, mark.rutland, mingo, mpe, oberpar,
	oprofile-list, paulus, peterz, ralf, rostedt, rric, schwidefsky,
	sebott, sparclinux, sth, ubraun, will.deacon, x86

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

Big picture is as per the lwn article:
https://lwn.net/Articles/643234/

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 unconditionally.
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.

Arnd Bergmann (1):
  y2038: introduce CONFIG_64BIT_TIME

Deepa Dinamani (8):
  include: Move compat_timespec/ timeval to compat_time.h
  compat: Make compat helpers independent of CONFIG_COMPAT
  compat: enable compat_get/put_timespec64 always
  posix-clocks: Enable compat syscalls always
  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                           | 11 ++++
 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                 |  7 ++-
 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                  |  7 +--
 kernel/time/posix-stubs.c              | 12 ++---
 kernel/time/posix-timers.c             | 20 ++++----
 kernel/time/time.c                     | 10 +++-
 45 files changed, 152 insertions(+), 195 deletions(-)
 create mode 100644 include/linux/compat_time.h


base-commit: d9e0e63d9a6f88440eb201e1491fcf730272c706
-- 
2.11.0

Cc: acme@kernel.org
Cc: benh@kernel.crashing.org
Cc: borntraeger@de.ibm.com
Cc: catalin.marinas@arm.com
Cc: cmetcalf@mellanox.com
Cc: cohuck@redhat.com
Cc: davem@davemloft.net
Cc: deller@gmx.de
Cc: devel@driverdev.osuosl.org
Cc: gerald.schaefer@de.ibm.com
Cc: gregkh@linuxfoundation.org
Cc: heiko.carstens@de.ibm.com
Cc: hoeppner@linux.vnet.ibm.com
Cc: hpa@zytor.com
Cc: jejb@parisc-linux.org
Cc: jwi@linux.vnet.ibm.com
Cc: linux-api@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Cc: mark.rutland@arm.com
Cc: mingo@redhat.com
Cc: mpe@ellerman.id.au
Cc: oberpar@linux.vnet.ibm.com
Cc: oprofile-list@lists.sf.net
Cc: paulus@samba.org
Cc: peterz@infradead.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: rric@kernel.org
Cc: schwidefsky@de.ibm.com
Cc: sebott@linux.vnet.ibm.com
Cc: sparclinux@vger.kernel.org
Cc: sth@linux.vnet.ibm.com
Cc: ubraun@linux.vnet.ibm.com
Cc: will.deacon@arm.com
Cc: x86@kernel.org

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-10 22:42 ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz
  Cc: linux-kernel, arnd, y2038, acme, benh, borntraeger,
	catalin.marinas, cmetcalf, cohuck, davem, deller, devel,
	gerald.schaefer, gregkh, heiko.carstens, hoeppner, hpa, jejb,
	jwi, linux-api, linux-arch, linux-mips, linux-parisc,
	linuxppc-dev, linux-s390, mark.rutland, mingo, mpe, oberpar,
	oprofile-list, paulus, peterz, ralf

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

Big picture is as per the lwn article:
https://lwn.net/Articles/643234/

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 unconditionally.
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.

Arnd Bergmann (1):
  y2038: introduce CONFIG_64BIT_TIME

Deepa Dinamani (8):
  include: Move compat_timespec/ timeval to compat_time.h
  compat: Make compat helpers independent of CONFIG_COMPAT
  compat: enable compat_get/put_timespec64 always
  posix-clocks: Enable compat syscalls always
  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                           | 11 ++++
 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                 |  7 ++-
 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                  |  7 +--
 kernel/time/posix-stubs.c              | 12 ++---
 kernel/time/posix-timers.c             | 20 ++++----
 kernel/time/time.c                     | 10 +++-
 45 files changed, 152 insertions(+), 195 deletions(-)
 create mode 100644 include/linux/compat_time.h


base-commit: d9e0e63d9a6f88440eb201e1491fcf730272c706
-- 
2.11.0

Cc: acme@kernel.org
Cc: benh@kernel.crashing.org
Cc: borntraeger@de.ibm.com
Cc: catalin.marinas@arm.com
Cc: cmetcalf@mellanox.com
Cc: cohuck@redhat.com
Cc: davem@davemloft.net
Cc: deller@gmx.de
Cc: devel@driverdev.osuosl.org
Cc: gerald.schaefer@de.ibm.com
Cc: gregkh@linuxfoundation.org
Cc: heiko.carstens@de.ibm.com
Cc: hoeppner@linux.vnet.ibm.com
Cc: hpa@zytor.com
Cc: jejb@parisc-linux.org
Cc: jwi@linux.vnet.ibm.com
Cc: linux-api@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Cc: mark.rutland@arm.com
Cc: mingo@redhat.com
Cc: mpe@ellerman.id.au
Cc: oberpar@linux.vnet.ibm.com
Cc: oprofile-list@lists.sf.net
Cc: paulus@samba.org
Cc: peterz@infradead.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: rric@kernel.org
Cc: schwidefsky@de.ibm.com
Cc: sebott@linux.vnet.ibm.com
Cc: sparclinux@vger.kernel.org
Cc: sth@linux.vnet.ibm.com
Cc: ubraun@linux.vnet.ibm.com
Cc: will.deacon@arm.com
Cc: x86@kernel.org

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-10 22:42 ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz
  Cc: linux-kernel, arnd, y2038, acme, benh, borntraeger,
	catalin.marinas, cmetcalf, cohuck, davem, deller, devel,
	gerald.schaefer, gregkh, heiko.carstens, hoeppner, hpa, jejb,
	jwi, linux-api, linux-arch, linux-mips, linux-parisc,
	linuxppc-dev, linux-s390, mark.rutland, mingo, mpe, oberpar,
	oprofile-list, paulus, peterz, ralf

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

Big picture is as per the lwn article:
https://lwn.net/Articles/643234/

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 unconditionally.
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.

Arnd Bergmann (1):
  y2038: introduce CONFIG_64BIT_TIME

Deepa Dinamani (8):
  include: Move compat_timespec/ timeval to compat_time.h
  compat: Make compat helpers independent of CONFIG_COMPAT
  compat: enable compat_get/put_timespec64 always
  posix-clocks: Enable compat syscalls always
  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                           | 11 ++++
 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                 |  7 ++-
 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                  |  7 +--
 kernel/time/posix-stubs.c              | 12 ++---
 kernel/time/posix-timers.c             | 20 ++++----
 kernel/time/time.c                     | 10 +++-
 45 files changed, 152 insertions(+), 195 deletions(-)
 create mode 100644 include/linux/compat_time.h


base-commit: d9e0e63d9a6f88440eb201e1491fcf730272c706
-- 
2.11.0

Cc: acme@kernel.org
Cc: benh@kernel.crashing.org
Cc: borntraeger@de.ibm.com
Cc: catalin.marinas@arm.com
Cc: cmetcalf@mellanox.com
Cc: cohuck@redhat.com
Cc: davem@davemloft.net
Cc: deller@gmx.de
Cc: devel@driverdev.osuosl.org
Cc: gerald.schaefer@de.ibm.com
Cc: gregkh@linuxfoundation.org
Cc: heiko.carstens@de.ibm.com
Cc: hoeppner@linux.vnet.ibm.com
Cc: hpa@zytor.com
Cc: jejb@parisc-linux.org
Cc: jwi@linux.vnet.ibm.com
Cc: linux-api@vger.kernel.org
Cc: linux-arch@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Cc: mark.rutland@arm.com
Cc: mingo@redhat.com
Cc: mpe@ellerman.id.au
Cc: oberpar@linux.vnet.ibm.com
Cc: oprofile-list@lists.sf.net
Cc: paulus@samba.org
Cc: peterz@infradead.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: rric@kernel.org
Cc: schwidefsky@de.ibm.com
Cc: sebott@linux.vnet.ibm.com
Cc: sparclinux@vger.kernel.org
Cc: sth@linux.vnet.ibm.com
Cc: ubraun@linux.vnet.ibm.com
Cc: will.deacon@arm.com
Cc: x86@kernel.org

^ permalink raw reply	[flat|nested] 68+ messages in thread

* [PATCH 1/9] include: Move compat_timespec/ timeval to compat_time.h
  2017-11-10 22:42 ` Deepa Dinamani
  (?)
@ 2017-11-10 22:42   ` Deepa Dinamani
  -1 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz
  Cc: mark.rutland, linux-mips, peterz, benh, heiko.carstens, paulus,
	hpa, sparclinux, devel, linux-s390, y2038, mpe, deller, x86,
	sebott, jejb, will.deacon, borntraeger, mingo, oprofile-list,
	catalin.marinas, rric, cmetcalf, arnd, oberpar, acme, jwi,
	rostedt, ubraun, gerald.schaefer, linux-parisc, gregkh, cohuck,
	linux-kernel, ralf, hoeppner, sth, schwidefsky

All the current architecture specific defines for these
are the same. Refactor these common defines to a common
header file.

The new common linux/compat_time.h is also useful as it
will eventually be used to hold all the defines that
are needed for compat time types that support non y2038
safe types. New architectures need not have to define these
new types as they will only use new y2038 safe syscalls.
This file can be deleted after y2038 when we stop supporting
non y2038 safe syscalls.

The patch also requires an operation similar to:

git grep "asm/compat\.h" | cut -d ":" -f 1 |  xargs -n 1 sed -i -e "s%asm/compat.h%linux/compat.h%g"

Cc: acme@kernel.org
Cc: benh@kernel.crashing.org
Cc: borntraeger@de.ibm.com
Cc: catalin.marinas@arm.com
Cc: cmetcalf@mellanox.com
Cc: cohuck@redhat.com
Cc: davem@davemloft.net
Cc: deller@gmx.de
Cc: devel@driverdev.osuosl.org
Cc: gerald.schaefer@de.ibm.com
Cc: gregkh@linuxfoundation.org
Cc: heiko.carstens@de.ibm.com
Cc: hoeppner@linux.vnet.ibm.com
Cc: hpa@zytor.com
Cc: jejb@parisc-linux.org
Cc: jwi@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Cc: mark.rutland@arm.com
Cc: mingo@redhat.com
Cc: mpe@ellerman.id.au
Cc: oberpar@linux.vnet.ibm.com
Cc: oprofile-list@lists.sf.net
Cc: paulus@samba.org
Cc: peterz@infradead.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: rric@kernel.org
Cc: schwidefsky@de.ibm.com
Cc: sebott@linux.vnet.ibm.com
Cc: sparclinux@vger.kernel.org
Cc: sth@linux.vnet.ibm.com
Cc: ubraun@linux.vnet.ibm.com
Cc: will.deacon@arm.com
Cc: x86@kernel.org
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 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            |  1 +
 include/linux/compat_time.h       | 19 +++++++++++++++++++
 32 files changed, 32 insertions(+), 110 deletions(-)
 create mode 100644 include/linux/compat_time.h

diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index e39d487bf724..d4f9c9ee3b15 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -34,7 +34,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -66,16 +65,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 #ifdef __AARCH64EB__
 	short		st_dev;
diff --git a/arch/arm64/include/asm/stat.h b/arch/arm64/include/asm/stat.h
index 15e35598ac40..eab738019707 100644
--- a/arch/arm64/include/asm/stat.h
+++ b/arch/arm64/include/asm/stat.h
@@ -20,6 +20,7 @@
 
 #ifdef CONFIG_COMPAT
 
+#include <linux/compat_time.h>
 #include <asm/compat.h>
 
 /*
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
index 749f81779420..bfa2b78cf0e3 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -29,7 +29,6 @@
 #include <linux/ptrace.h>
 #include <linux/smp.h>
 
-#include <asm/compat.h>
 #include <asm/current.h>
 #include <asm/debug-monitors.h>
 #include <asm/hw_breakpoint.h>
diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
index 1d091d048d04..929fc369d0be 100644
--- a/arch/arm64/kernel/perf_regs.c
+++ b/arch/arm64/kernel/perf_regs.c
@@ -5,7 +5,7 @@
 #include <linux/bug.h>
 #include <linux/sched/task_stack.h>
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/perf_regs.h>
 #include <asm/ptrace.h>
 
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index b2adcce7bc18..1acb3097d35b 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -52,7 +52,6 @@
 #include <linux/thread_info.h>
 
 #include <asm/alternative.h>
-#include <asm/compat.h>
 #include <asm/cacheflush.h>
 #include <asm/exec.h>
 #include <asm/fpsimd.h>
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h
index 8e2b5b556488..ebbf3f04f82b 100644
--- a/arch/mips/include/asm/compat.h
+++ b/arch/mips/include/asm/compat.h
@@ -14,7 +14,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_suseconds_t;
 
@@ -46,16 +45,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	s32		st_pad1[3];
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index cf5c7c05e5a3..a6b04c70a8cb 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -14,7 +14,7 @@
 #include <linux/signal.h>
 #include <linux/syscalls.h>
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/compat-signal.h>
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h
index 07f48827afda..ea453c356bf9 100644
--- a/arch/parisc/include/asm/compat.h
+++ b/arch/parisc/include/asm/compat.h
@@ -13,7 +13,6 @@
 
 typedef u32	compat_size_t;
 typedef s32	compat_ssize_t;
-typedef s32	compat_time_t;
 typedef s32	compat_clock_t;
 typedef s32	compat_pid_t;
 typedef u32	__compat_uid_t;
@@ -40,16 +39,6 @@ typedef u32	compat_ulong_t;
 typedef u64	compat_u64;
 typedef u32	compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t		tv_sec;
-	s32			tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t		tv_sec;
-	s32			tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t		st_dev;	/* dev_t is 32 bits on parisc */
 	compat_ino_t		st_ino;	/* 32 bits */
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index a035b1e5dfa7..d48892bcd38f 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -17,7 +17,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u32		__compat_uid_t;
@@ -45,16 +44,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	compat_ino_t	st_ino;
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 4ce0e8eccbcf..7698bd054181 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -42,7 +42,7 @@
 #include <asm/paca.h>
 #include <asm/lppaca.h>
 #include <asm/cache.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/mmu.h>
 #include <asm/hvcall.h>
 #include <asm/xics.h>
diff --git a/arch/powerpc/oprofile/backtrace.c b/arch/powerpc/oprofile/backtrace.c
index ecc66d5f02c9..11ff763c03ad 100644
--- a/arch/powerpc/oprofile/backtrace.c
+++ b/arch/powerpc/oprofile/backtrace.c
@@ -11,7 +11,7 @@
 #include <linux/sched.h>
 #include <asm/processor.h>
 #include <linux/uaccess.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/oprofile_impl.h>
 
 #define STACK_SP(STACK)		*(STACK)
diff --git a/arch/s390/hypfs/hypfs_sprp.c b/arch/s390/hypfs/hypfs_sprp.c
index ae0ed8dd5f1b..5d85a039391c 100644
--- a/arch/s390/hypfs/hypfs_sprp.c
+++ b/arch/s390/hypfs/hypfs_sprp.c
@@ -13,7 +13,6 @@
 #include <linux/string.h>
 #include <linux/types.h>
 #include <linux/uaccess.h>
-#include <asm/compat.h>
 #include <asm/diag.h>
 #include <asm/sclp.h>
 #include "hypfs.h"
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index 1b60eb3676d5..32a77b6d9a59 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -53,7 +53,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -97,16 +96,6 @@ typedef struct {
 	u32 gprs_high[NUM_GPRS];
 } s390_compat_regs_high;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	u16		__pad1;
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index 9a3cb3983c01..78f75384f891 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -126,7 +126,7 @@
  */
 
 #include <asm/ptrace.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/syscall.h>
 #include <asm/user.h>
 
@@ -136,7 +136,6 @@ typedef s390_regs elf_gregset_t;
 typedef s390_fp_regs compat_elf_fpregset_t;
 typedef s390_compat_regs compat_elf_gregset_t;
 
-#include <linux/compat.h>
 #include <linux/sched/mm.h>	/* for task_struct */
 #include <asm/mmu_context.h>
 
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index c954ac49eee4..07eebba4bd37 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -29,7 +29,6 @@
 #include <asm/gmap.h>
 #include <asm/io.h>
 #include <asm/ptrace.h>
-#include <asm/compat.h>
 #include <asm/sclp.h>
 #include "gaccess.h"
 #include "kvm-s390.h"
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index 93cd0f1ca12b..19b2d2a9b43d 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -19,7 +19,6 @@
 #include <linux/uaccess.h>
 #include <asm/pci_debug.h>
 #include <asm/pci_clp.h>
-#include <asm/compat.h>
 #include <asm/clp.h>
 #include <uapi/asm/clp.h>
 
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index 977c3f280ba1..7348f111d169 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -11,7 +11,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -39,16 +38,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	compat_ino_t	st_ino;
diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h
index c14e36f008c8..c3a326c9ae75 100644
--- a/arch/tile/include/asm/compat.h
+++ b/arch/tile/include/asm/compat.h
@@ -29,7 +29,6 @@ typedef u32		compat_ulong_t;
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
 typedef s32		compat_off_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef u32		compat_ino_t;
 typedef u32		compat_caddr_t;
@@ -59,16 +58,6 @@ typedef unsigned long compat_elf_greg_t;
 #define COMPAT_ELF_NGREG (sizeof(struct pt_regs) / sizeof(compat_elf_greg_t))
 typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 #define compat_stat stat
 #define compat_statfs statfs
 
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index 140d33288e78..6b8961912781 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -2391,7 +2391,7 @@ static unsigned long get_segment_base(unsigned int segment)
 
 #ifdef CONFIG_IA32_EMULATION
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 
 static inline int
 perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *entry)
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index a600a6cda9ec..5d8e0fc204db 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -17,7 +17,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -46,16 +45,6 @@ typedef u32		compat_u32;
 typedef u64 __attribute__((aligned(4))) compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	u16		__pad1;
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 09ad88572746..db25aa15b705 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -49,7 +49,7 @@ int ftrace_int3_handler(struct pt_regs *regs);
 #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
 
 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
-#include <asm/compat.h>
+#include <linux/compat.h>
 
 /*
  * Because ia32 syscalls do not map to x86_64 syscall numbers
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index 82c34ee25a65..8527b26ad36f 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -16,7 +16,7 @@
 #include <linux/linkage.h>
 #include <linux/types.h>
 #include <linux/signal.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/ia32.h>
 
 /* ia32/sys_ia32.c */
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index a63fe77b3217..13d51bd80409 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -19,7 +19,7 @@
 #include <linux/elf.h>
 
 #include <asm/elf.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/ia32.h>
 #include <asm/syscalls.h>
 #include <asm/mpx.h>
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 7bdc6aaa0ba3..2016e0ed5865 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -18,7 +18,6 @@
 #include <linux/fs.h>
 #include <linux/blkpg.h>
 #include <linux/slab.h>
-#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/schid.h>
 #include <asm/cmb.h>
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index c4518168fd02..d74facaa1755 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -18,7 +18,6 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 
-#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/cio.h>
 #include <asm/ebcdic.h>
diff --git a/drivers/s390/char/sclp_ctl.c b/drivers/s390/char/sclp_ctl.c
index a78cea0c3a09..248b5db3eaa8 100644
--- a/drivers/s390/char/sclp_ctl.c
+++ b/drivers/s390/char/sclp_ctl.c
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/ioctl.h>
 #include <linux/fs.h>
-#include <asm/compat.h>
 #include <asm/sclp_ctl.h>
 #include <asm/sclp.h>
 
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 17e411c57576..948ce82a7725 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -23,7 +23,6 @@
 #include <linux/mutex.h>
 #include <linux/cma.h>
 #include <linux/mm.h>
-#include <asm/compat.h>
 #include <asm/cpcmd.h>
 #include <asm/debug.h>
 #include <asm/vmcp.h>
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index 8e7e19b9e92c..662d24c6b79c 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -15,7 +15,6 @@
 #include <linux/miscdevice.h>
 #include <linux/kernel_stat.h>
 
-#include <asm/compat.h>
 #include <asm/cio.h>
 #include <asm/chsc.h>
 #include <asm/isc.h>
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 49b9efeba1bd..8259c0ae3395 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -26,7 +26,7 @@
 #include <asm/chpid.h>
 #include <asm/io.h>
 #include <asm/sysinfo.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/diag.h>
 #include <asm/cio.h>
 #include <asm/ccwdev.h>
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index a960fe2e7875..3fcb238b1995 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -48,7 +48,7 @@
 #include <linux/wait.h>
 #include <linux/spi/spi.h>
 #ifdef CONFIG_COMPAT
-#include <asm/compat.h>
+#include <linux/compat.h>
 #endif
 
 #include "pi433_if.h"
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 0fc36406f32c..1a5e397ffcd4 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -7,6 +7,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/compat_time.h>
 
 #ifdef CONFIG_COMPAT
 
diff --git a/include/linux/compat_time.h b/include/linux/compat_time.h
new file mode 100644
index 000000000000..56a54a1e4355
--- /dev/null
+++ b/include/linux/compat_time.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_COMPAT_TIME_H
+#define _LINUX_COMPAT_TIME_H
+
+#include <linux/types.h>
+
+typedef s32		compat_time_t;
+
+struct compat_timespec {
+	compat_time_t	tv_sec;
+	s32		tv_nsec;
+};
+
+struct compat_timeval {
+	compat_time_t	tv_sec;
+	s32		tv_usec;
+};
+
+#endif /* _LINUX_COMPAT_TIME_H */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 1/9] include: Move compat_timespec/ timeval to compat_time.h
@ 2017-11-10 22:42   ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz
  Cc: linux-kernel, arnd, y2038, acme, benh, borntraeger,
	catalin.marinas, cmetcalf, cohuck, davem, deller, devel,
	gerald.schaefer, gregkh, heiko.carstens, hoeppner, hpa, jejb,
	jwi, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	mark.rutland, mingo, mpe, oberpar, oprofile-list, paulus, peterz,
	ralf, rostedt, rric, schwidefsky, sebott, sparclinux, sth,
	ubraun, will.deacon, x86

All the current architecture specific defines for these
are the same. Refactor these common defines to a common
header file.

The new common linux/compat_time.h is also useful as it
will eventually be used to hold all the defines that
are needed for compat time types that support non y2038
safe types. New architectures need not have to define these
new types as they will only use new y2038 safe syscalls.
This file can be deleted after y2038 when we stop supporting
non y2038 safe syscalls.

The patch also requires an operation similar to:

git grep "asm/compat\.h" | cut -d ":" -f 1 |  xargs -n 1 sed -i -e "s%asm/compat.h%linux/compat.h%g"

Cc: acme@kernel.org
Cc: benh@kernel.crashing.org
Cc: borntraeger@de.ibm.com
Cc: catalin.marinas@arm.com
Cc: cmetcalf@mellanox.com
Cc: cohuck@redhat.com
Cc: davem@davemloft.net
Cc: deller@gmx.de
Cc: devel@driverdev.osuosl.org
Cc: gerald.schaefer@de.ibm.com
Cc: gregkh@linuxfoundation.org
Cc: heiko.carstens@de.ibm.com
Cc: hoeppner@linux.vnet.ibm.com
Cc: hpa@zytor.com
Cc: jejb@parisc-linux.org
Cc: jwi@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Cc: mark.rutland@arm.com
Cc: mingo@redhat.com
Cc: mpe@ellerman.id.au
Cc: oberpar@linux.vnet.ibm.com
Cc: oprofile-list@lists.sf.net
Cc: paulus@samba.org
Cc: peterz@infradead.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: rric@kernel.org
Cc: schwidefsky@de.ibm.com
Cc: sebott@linux.vnet.ibm.com
Cc: sparclinux@vger.kernel.org
Cc: sth@linux.vnet.ibm.com
Cc: ubraun@linux.vnet.ibm.com
Cc: will.deacon@arm.com
Cc: x86@kernel.org
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 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            |  1 +
 include/linux/compat_time.h       | 19 +++++++++++++++++++
 32 files changed, 32 insertions(+), 110 deletions(-)
 create mode 100644 include/linux/compat_time.h

diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index e39d487bf724..d4f9c9ee3b15 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -34,7 +34,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -66,16 +65,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 #ifdef __AARCH64EB__
 	short		st_dev;
diff --git a/arch/arm64/include/asm/stat.h b/arch/arm64/include/asm/stat.h
index 15e35598ac40..eab738019707 100644
--- a/arch/arm64/include/asm/stat.h
+++ b/arch/arm64/include/asm/stat.h
@@ -20,6 +20,7 @@
 
 #ifdef CONFIG_COMPAT
 
+#include <linux/compat_time.h>
 #include <asm/compat.h>
 
 /*
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
index 749f81779420..bfa2b78cf0e3 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -29,7 +29,6 @@
 #include <linux/ptrace.h>
 #include <linux/smp.h>
 
-#include <asm/compat.h>
 #include <asm/current.h>
 #include <asm/debug-monitors.h>
 #include <asm/hw_breakpoint.h>
diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
index 1d091d048d04..929fc369d0be 100644
--- a/arch/arm64/kernel/perf_regs.c
+++ b/arch/arm64/kernel/perf_regs.c
@@ -5,7 +5,7 @@
 #include <linux/bug.h>
 #include <linux/sched/task_stack.h>
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/perf_regs.h>
 #include <asm/ptrace.h>
 
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index b2adcce7bc18..1acb3097d35b 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -52,7 +52,6 @@
 #include <linux/thread_info.h>
 
 #include <asm/alternative.h>
-#include <asm/compat.h>
 #include <asm/cacheflush.h>
 #include <asm/exec.h>
 #include <asm/fpsimd.h>
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h
index 8e2b5b556488..ebbf3f04f82b 100644
--- a/arch/mips/include/asm/compat.h
+++ b/arch/mips/include/asm/compat.h
@@ -14,7 +14,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_suseconds_t;
 
@@ -46,16 +45,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	s32		st_pad1[3];
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index cf5c7c05e5a3..a6b04c70a8cb 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -14,7 +14,7 @@
 #include <linux/signal.h>
 #include <linux/syscalls.h>
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/compat-signal.h>
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h
index 07f48827afda..ea453c356bf9 100644
--- a/arch/parisc/include/asm/compat.h
+++ b/arch/parisc/include/asm/compat.h
@@ -13,7 +13,6 @@
 
 typedef u32	compat_size_t;
 typedef s32	compat_ssize_t;
-typedef s32	compat_time_t;
 typedef s32	compat_clock_t;
 typedef s32	compat_pid_t;
 typedef u32	__compat_uid_t;
@@ -40,16 +39,6 @@ typedef u32	compat_ulong_t;
 typedef u64	compat_u64;
 typedef u32	compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t		tv_sec;
-	s32			tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t		tv_sec;
-	s32			tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t		st_dev;	/* dev_t is 32 bits on parisc */
 	compat_ino_t		st_ino;	/* 32 bits */
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index a035b1e5dfa7..d48892bcd38f 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -17,7 +17,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u32		__compat_uid_t;
@@ -45,16 +44,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	compat_ino_t	st_ino;
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 4ce0e8eccbcf..7698bd054181 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -42,7 +42,7 @@
 #include <asm/paca.h>
 #include <asm/lppaca.h>
 #include <asm/cache.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/mmu.h>
 #include <asm/hvcall.h>
 #include <asm/xics.h>
diff --git a/arch/powerpc/oprofile/backtrace.c b/arch/powerpc/oprofile/backtrace.c
index ecc66d5f02c9..11ff763c03ad 100644
--- a/arch/powerpc/oprofile/backtrace.c
+++ b/arch/powerpc/oprofile/backtrace.c
@@ -11,7 +11,7 @@
 #include <linux/sched.h>
 #include <asm/processor.h>
 #include <linux/uaccess.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/oprofile_impl.h>
 
 #define STACK_SP(STACK)		*(STACK)
diff --git a/arch/s390/hypfs/hypfs_sprp.c b/arch/s390/hypfs/hypfs_sprp.c
index ae0ed8dd5f1b..5d85a039391c 100644
--- a/arch/s390/hypfs/hypfs_sprp.c
+++ b/arch/s390/hypfs/hypfs_sprp.c
@@ -13,7 +13,6 @@
 #include <linux/string.h>
 #include <linux/types.h>
 #include <linux/uaccess.h>
-#include <asm/compat.h>
 #include <asm/diag.h>
 #include <asm/sclp.h>
 #include "hypfs.h"
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index 1b60eb3676d5..32a77b6d9a59 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -53,7 +53,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -97,16 +96,6 @@ typedef struct {
 	u32 gprs_high[NUM_GPRS];
 } s390_compat_regs_high;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	u16		__pad1;
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index 9a3cb3983c01..78f75384f891 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -126,7 +126,7 @@
  */
 
 #include <asm/ptrace.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/syscall.h>
 #include <asm/user.h>
 
@@ -136,7 +136,6 @@ typedef s390_regs elf_gregset_t;
 typedef s390_fp_regs compat_elf_fpregset_t;
 typedef s390_compat_regs compat_elf_gregset_t;
 
-#include <linux/compat.h>
 #include <linux/sched/mm.h>	/* for task_struct */
 #include <asm/mmu_context.h>
 
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index c954ac49eee4..07eebba4bd37 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -29,7 +29,6 @@
 #include <asm/gmap.h>
 #include <asm/io.h>
 #include <asm/ptrace.h>
-#include <asm/compat.h>
 #include <asm/sclp.h>
 #include "gaccess.h"
 #include "kvm-s390.h"
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index 93cd0f1ca12b..19b2d2a9b43d 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -19,7 +19,6 @@
 #include <linux/uaccess.h>
 #include <asm/pci_debug.h>
 #include <asm/pci_clp.h>
-#include <asm/compat.h>
 #include <asm/clp.h>
 #include <uapi/asm/clp.h>
 
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index 977c3f280ba1..7348f111d169 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -11,7 +11,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -39,16 +38,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	compat_ino_t	st_ino;
diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h
index c14e36f008c8..c3a326c9ae75 100644
--- a/arch/tile/include/asm/compat.h
+++ b/arch/tile/include/asm/compat.h
@@ -29,7 +29,6 @@ typedef u32		compat_ulong_t;
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
 typedef s32		compat_off_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef u32		compat_ino_t;
 typedef u32		compat_caddr_t;
@@ -59,16 +58,6 @@ typedef unsigned long compat_elf_greg_t;
 #define COMPAT_ELF_NGREG (sizeof(struct pt_regs) / sizeof(compat_elf_greg_t))
 typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 #define compat_stat stat
 #define compat_statfs statfs
 
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index 140d33288e78..6b8961912781 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -2391,7 +2391,7 @@ static unsigned long get_segment_base(unsigned int segment)
 
 #ifdef CONFIG_IA32_EMULATION
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 
 static inline int
 perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *entry)
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index a600a6cda9ec..5d8e0fc204db 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -17,7 +17,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -46,16 +45,6 @@ typedef u32		compat_u32;
 typedef u64 __attribute__((aligned(4))) compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	u16		__pad1;
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 09ad88572746..db25aa15b705 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -49,7 +49,7 @@ int ftrace_int3_handler(struct pt_regs *regs);
 #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
 
 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
-#include <asm/compat.h>
+#include <linux/compat.h>
 
 /*
  * Because ia32 syscalls do not map to x86_64 syscall numbers
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index 82c34ee25a65..8527b26ad36f 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -16,7 +16,7 @@
 #include <linux/linkage.h>
 #include <linux/types.h>
 #include <linux/signal.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/ia32.h>
 
 /* ia32/sys_ia32.c */
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index a63fe77b3217..13d51bd80409 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -19,7 +19,7 @@
 #include <linux/elf.h>
 
 #include <asm/elf.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/ia32.h>
 #include <asm/syscalls.h>
 #include <asm/mpx.h>
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 7bdc6aaa0ba3..2016e0ed5865 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -18,7 +18,6 @@
 #include <linux/fs.h>
 #include <linux/blkpg.h>
 #include <linux/slab.h>
-#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/schid.h>
 #include <asm/cmb.h>
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index c4518168fd02..d74facaa1755 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -18,7 +18,6 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 
-#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/cio.h>
 #include <asm/ebcdic.h>
diff --git a/drivers/s390/char/sclp_ctl.c b/drivers/s390/char/sclp_ctl.c
index a78cea0c3a09..248b5db3eaa8 100644
--- a/drivers/s390/char/sclp_ctl.c
+++ b/drivers/s390/char/sclp_ctl.c
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/ioctl.h>
 #include <linux/fs.h>
-#include <asm/compat.h>
 #include <asm/sclp_ctl.h>
 #include <asm/sclp.h>
 
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 17e411c57576..948ce82a7725 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -23,7 +23,6 @@
 #include <linux/mutex.h>
 #include <linux/cma.h>
 #include <linux/mm.h>
-#include <asm/compat.h>
 #include <asm/cpcmd.h>
 #include <asm/debug.h>
 #include <asm/vmcp.h>
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index 8e7e19b9e92c..662d24c6b79c 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -15,7 +15,6 @@
 #include <linux/miscdevice.h>
 #include <linux/kernel_stat.h>
 
-#include <asm/compat.h>
 #include <asm/cio.h>
 #include <asm/chsc.h>
 #include <asm/isc.h>
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 49b9efeba1bd..8259c0ae3395 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -26,7 +26,7 @@
 #include <asm/chpid.h>
 #include <asm/io.h>
 #include <asm/sysinfo.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/diag.h>
 #include <asm/cio.h>
 #include <asm/ccwdev.h>
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index a960fe2e7875..3fcb238b1995 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -48,7 +48,7 @@
 #include <linux/wait.h>
 #include <linux/spi/spi.h>
 #ifdef CONFIG_COMPAT
-#include <asm/compat.h>
+#include <linux/compat.h>
 #endif
 
 #include "pi433_if.h"
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 0fc36406f32c..1a5e397ffcd4 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -7,6 +7,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/compat_time.h>
 
 #ifdef CONFIG_COMPAT
 
diff --git a/include/linux/compat_time.h b/include/linux/compat_time.h
new file mode 100644
index 000000000000..56a54a1e4355
--- /dev/null
+++ b/include/linux/compat_time.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_COMPAT_TIME_H
+#define _LINUX_COMPAT_TIME_H
+
+#include <linux/types.h>
+
+typedef s32		compat_time_t;
+
+struct compat_timespec {
+	compat_time_t	tv_sec;
+	s32		tv_nsec;
+};
+
+struct compat_timeval {
+	compat_time_t	tv_sec;
+	s32		tv_usec;
+};
+
+#endif /* _LINUX_COMPAT_TIME_H */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 1/9] include: Move compat_timespec/ timeval to compat_time.h
@ 2017-11-10 22:42   ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz
  Cc: linux-kernel, arnd, y2038, acme, benh, borntraeger,
	catalin.marinas, cmetcalf, cohuck, davem, deller, devel,
	gerald.schaefer, gregkh, heiko.carstens, hoeppner, hpa, jejb,
	jwi, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	mark.rutland, mingo, mpe, oberpar, oprofile-list, paulus, peterz,
	ralf, rostedt, rric, schwidefsky, sebott, sparclinux, sth,
	ubraun, will.deacon, x86

All the current architecture specific defines for these
are the same. Refactor these common defines to a common
header file.

The new common linux/compat_time.h is also useful as it
will eventually be used to hold all the defines that
are needed for compat time types that support non y2038
safe types. New architectures need not have to define these
new types as they will only use new y2038 safe syscalls.
This file can be deleted after y2038 when we stop supporting
non y2038 safe syscalls.

The patch also requires an operation similar to:

git grep "asm/compat\.h" | cut -d ":" -f 1 |  xargs -n 1 sed -i -e "s%asm/compat.h%linux/compat.h%g"

Cc: acme@kernel.org
Cc: benh@kernel.crashing.org
Cc: borntraeger@de.ibm.com
Cc: catalin.marinas@arm.com
Cc: cmetcalf@mellanox.com
Cc: cohuck@redhat.com
Cc: davem@davemloft.net
Cc: deller@gmx.de
Cc: devel@driverdev.osuosl.org
Cc: gerald.schaefer@de.ibm.com
Cc: gregkh@linuxfoundation.org
Cc: heiko.carstens@de.ibm.com
Cc: hoeppner@linux.vnet.ibm.com
Cc: hpa@zytor.com
Cc: jejb@parisc-linux.org
Cc: jwi@linux.vnet.ibm.com
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Cc: mark.rutland@arm.com
Cc: mingo@redhat.com
Cc: mpe@ellerman.id.au
Cc: oberpar@linux.vnet.ibm.com
Cc: oprofile-list@lists.sf.net
Cc: paulus@samba.org
Cc: peterz@infradead.org
Cc: ralf@linux-mips.org
Cc: rostedt@goodmis.org
Cc: rric@kernel.org
Cc: schwidefsky@de.ibm.com
Cc: sebott@linux.vnet.ibm.com
Cc: sparclinux@vger.kernel.org
Cc: sth@linux.vnet.ibm.com
Cc: ubraun@linux.vnet.ibm.com
Cc: will.deacon@arm.com
Cc: x86@kernel.org
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 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            |  1 +
 include/linux/compat_time.h       | 19 +++++++++++++++++++
 32 files changed, 32 insertions(+), 110 deletions(-)
 create mode 100644 include/linux/compat_time.h

diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index e39d487bf724..d4f9c9ee3b15 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -34,7 +34,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -66,16 +65,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 #ifdef __AARCH64EB__
 	short		st_dev;
diff --git a/arch/arm64/include/asm/stat.h b/arch/arm64/include/asm/stat.h
index 15e35598ac40..eab738019707 100644
--- a/arch/arm64/include/asm/stat.h
+++ b/arch/arm64/include/asm/stat.h
@@ -20,6 +20,7 @@
 
 #ifdef CONFIG_COMPAT
 
+#include <linux/compat_time.h>
 #include <asm/compat.h>
 
 /*
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
index 749f81779420..bfa2b78cf0e3 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -29,7 +29,6 @@
 #include <linux/ptrace.h>
 #include <linux/smp.h>
 
-#include <asm/compat.h>
 #include <asm/current.h>
 #include <asm/debug-monitors.h>
 #include <asm/hw_breakpoint.h>
diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
index 1d091d048d04..929fc369d0be 100644
--- a/arch/arm64/kernel/perf_regs.c
+++ b/arch/arm64/kernel/perf_regs.c
@@ -5,7 +5,7 @@
 #include <linux/bug.h>
 #include <linux/sched/task_stack.h>
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/perf_regs.h>
 #include <asm/ptrace.h>
 
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
index b2adcce7bc18..1acb3097d35b 100644
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -52,7 +52,6 @@
 #include <linux/thread_info.h>
 
 #include <asm/alternative.h>
-#include <asm/compat.h>
 #include <asm/cacheflush.h>
 #include <asm/exec.h>
 #include <asm/fpsimd.h>
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h
index 8e2b5b556488..ebbf3f04f82b 100644
--- a/arch/mips/include/asm/compat.h
+++ b/arch/mips/include/asm/compat.h
@@ -14,7 +14,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_suseconds_t;
 
@@ -46,16 +45,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	s32		st_pad1[3];
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index cf5c7c05e5a3..a6b04c70a8cb 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -14,7 +14,7 @@
 #include <linux/signal.h>
 #include <linux/syscalls.h>
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/compat-signal.h>
 #include <linux/uaccess.h>
 #include <asm/unistd.h>
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h
index 07f48827afda..ea453c356bf9 100644
--- a/arch/parisc/include/asm/compat.h
+++ b/arch/parisc/include/asm/compat.h
@@ -13,7 +13,6 @@
 
 typedef u32	compat_size_t;
 typedef s32	compat_ssize_t;
-typedef s32	compat_time_t;
 typedef s32	compat_clock_t;
 typedef s32	compat_pid_t;
 typedef u32	__compat_uid_t;
@@ -40,16 +39,6 @@ typedef u32	compat_ulong_t;
 typedef u64	compat_u64;
 typedef u32	compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t		tv_sec;
-	s32			tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t		tv_sec;
-	s32			tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t		st_dev;	/* dev_t is 32 bits on parisc */
 	compat_ino_t		st_ino;	/* 32 bits */
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index a035b1e5dfa7..d48892bcd38f 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -17,7 +17,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u32		__compat_uid_t;
@@ -45,16 +44,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	compat_ino_t	st_ino;
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 4ce0e8eccbcf..7698bd054181 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -42,7 +42,7 @@
 #include <asm/paca.h>
 #include <asm/lppaca.h>
 #include <asm/cache.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/mmu.h>
 #include <asm/hvcall.h>
 #include <asm/xics.h>
diff --git a/arch/powerpc/oprofile/backtrace.c b/arch/powerpc/oprofile/backtrace.c
index ecc66d5f02c9..11ff763c03ad 100644
--- a/arch/powerpc/oprofile/backtrace.c
+++ b/arch/powerpc/oprofile/backtrace.c
@@ -11,7 +11,7 @@
 #include <linux/sched.h>
 #include <asm/processor.h>
 #include <linux/uaccess.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/oprofile_impl.h>
 
 #define STACK_SP(STACK)		*(STACK)
diff --git a/arch/s390/hypfs/hypfs_sprp.c b/arch/s390/hypfs/hypfs_sprp.c
index ae0ed8dd5f1b..5d85a039391c 100644
--- a/arch/s390/hypfs/hypfs_sprp.c
+++ b/arch/s390/hypfs/hypfs_sprp.c
@@ -13,7 +13,6 @@
 #include <linux/string.h>
 #include <linux/types.h>
 #include <linux/uaccess.h>
-#include <asm/compat.h>
 #include <asm/diag.h>
 #include <asm/sclp.h>
 #include "hypfs.h"
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index 1b60eb3676d5..32a77b6d9a59 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -53,7 +53,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -97,16 +96,6 @@ typedef struct {
 	u32 gprs_high[NUM_GPRS];
 } s390_compat_regs_high;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	u16		__pad1;
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index 9a3cb3983c01..78f75384f891 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -126,7 +126,7 @@
  */
 
 #include <asm/ptrace.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/syscall.h>
 #include <asm/user.h>
 
@@ -136,7 +136,6 @@ typedef s390_regs elf_gregset_t;
 typedef s390_fp_regs compat_elf_fpregset_t;
 typedef s390_compat_regs compat_elf_gregset_t;
 
-#include <linux/compat.h>
 #include <linux/sched/mm.h>	/* for task_struct */
 #include <asm/mmu_context.h>
 
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index c954ac49eee4..07eebba4bd37 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -29,7 +29,6 @@
 #include <asm/gmap.h>
 #include <asm/io.h>
 #include <asm/ptrace.h>
-#include <asm/compat.h>
 #include <asm/sclp.h>
 #include "gaccess.h"
 #include "kvm-s390.h"
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index 93cd0f1ca12b..19b2d2a9b43d 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -19,7 +19,6 @@
 #include <linux/uaccess.h>
 #include <asm/pci_debug.h>
 #include <asm/pci_clp.h>
-#include <asm/compat.h>
 #include <asm/clp.h>
 #include <uapi/asm/clp.h>
 
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index 977c3f280ba1..7348f111d169 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -11,7 +11,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -39,16 +38,6 @@ typedef u32		compat_ulong_t;
 typedef u64		compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	compat_ino_t	st_ino;
diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h
index c14e36f008c8..c3a326c9ae75 100644
--- a/arch/tile/include/asm/compat.h
+++ b/arch/tile/include/asm/compat.h
@@ -29,7 +29,6 @@ typedef u32		compat_ulong_t;
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
 typedef s32		compat_off_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef u32		compat_ino_t;
 typedef u32		compat_caddr_t;
@@ -59,16 +58,6 @@ typedef unsigned long compat_elf_greg_t;
 #define COMPAT_ELF_NGREG (sizeof(struct pt_regs) / sizeof(compat_elf_greg_t))
 typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 #define compat_stat stat
 #define compat_statfs statfs
 
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index 140d33288e78..6b8961912781 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -2391,7 +2391,7 @@ static unsigned long get_segment_base(unsigned int segment)
 
 #ifdef CONFIG_IA32_EMULATION
 
-#include <asm/compat.h>
+#include <linux/compat.h>
 
 static inline int
 perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *entry)
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index a600a6cda9ec..5d8e0fc204db 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -17,7 +17,6 @@
 
 typedef u32		compat_size_t;
 typedef s32		compat_ssize_t;
-typedef s32		compat_time_t;
 typedef s32		compat_clock_t;
 typedef s32		compat_pid_t;
 typedef u16		__compat_uid_t;
@@ -46,16 +45,6 @@ typedef u32		compat_u32;
 typedef u64 __attribute__((aligned(4))) compat_u64;
 typedef u32		compat_uptr_t;
 
-struct compat_timespec {
-	compat_time_t	tv_sec;
-	s32		tv_nsec;
-};
-
-struct compat_timeval {
-	compat_time_t	tv_sec;
-	s32		tv_usec;
-};
-
 struct compat_stat {
 	compat_dev_t	st_dev;
 	u16		__pad1;
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 09ad88572746..db25aa15b705 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -49,7 +49,7 @@ int ftrace_int3_handler(struct pt_regs *regs);
 #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
 
 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
-#include <asm/compat.h>
+#include <linux/compat.h>
 
 /*
  * Because ia32 syscalls do not map to x86_64 syscall numbers
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index 82c34ee25a65..8527b26ad36f 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -16,7 +16,7 @@
 #include <linux/linkage.h>
 #include <linux/types.h>
 #include <linux/signal.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/ia32.h>
 
 /* ia32/sys_ia32.c */
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index a63fe77b3217..13d51bd80409 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -19,7 +19,7 @@
 #include <linux/elf.h>
 
 #include <asm/elf.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/ia32.h>
 #include <asm/syscalls.h>
 #include <asm/mpx.h>
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 7bdc6aaa0ba3..2016e0ed5865 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -18,7 +18,6 @@
 #include <linux/fs.h>
 #include <linux/blkpg.h>
 #include <linux/slab.h>
-#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/schid.h>
 #include <asm/cmb.h>
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index c4518168fd02..d74facaa1755 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -18,7 +18,6 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 
-#include <asm/compat.h>
 #include <asm/ccwdev.h>
 #include <asm/cio.h>
 #include <asm/ebcdic.h>
diff --git a/drivers/s390/char/sclp_ctl.c b/drivers/s390/char/sclp_ctl.c
index a78cea0c3a09..248b5db3eaa8 100644
--- a/drivers/s390/char/sclp_ctl.c
+++ b/drivers/s390/char/sclp_ctl.c
@@ -14,7 +14,6 @@
 #include <linux/init.h>
 #include <linux/ioctl.h>
 #include <linux/fs.h>
-#include <asm/compat.h>
 #include <asm/sclp_ctl.h>
 #include <asm/sclp.h>
 
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 17e411c57576..948ce82a7725 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -23,7 +23,6 @@
 #include <linux/mutex.h>
 #include <linux/cma.h>
 #include <linux/mm.h>
-#include <asm/compat.h>
 #include <asm/cpcmd.h>
 #include <asm/debug.h>
 #include <asm/vmcp.h>
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index 8e7e19b9e92c..662d24c6b79c 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -15,7 +15,6 @@
 #include <linux/miscdevice.h>
 #include <linux/kernel_stat.h>
 
-#include <asm/compat.h>
 #include <asm/cio.h>
 #include <asm/chsc.h>
 #include <asm/isc.h>
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 49b9efeba1bd..8259c0ae3395 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -26,7 +26,7 @@
 #include <asm/chpid.h>
 #include <asm/io.h>
 #include <asm/sysinfo.h>
-#include <asm/compat.h>
+#include <linux/compat.h>
 #include <asm/diag.h>
 #include <asm/cio.h>
 #include <asm/ccwdev.h>
diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index a960fe2e7875..3fcb238b1995 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -48,7 +48,7 @@
 #include <linux/wait.h>
 #include <linux/spi/spi.h>
 #ifdef CONFIG_COMPAT
-#include <asm/compat.h>
+#include <linux/compat.h>
 #endif
 
 #include "pi433_if.h"
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 0fc36406f32c..1a5e397ffcd4 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -7,6 +7,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/compat_time.h>
 
 #ifdef CONFIG_COMPAT
 
diff --git a/include/linux/compat_time.h b/include/linux/compat_time.h
new file mode 100644
index 000000000000..56a54a1e4355
--- /dev/null
+++ b/include/linux/compat_time.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _LINUX_COMPAT_TIME_H
+#define _LINUX_COMPAT_TIME_H
+
+#include <linux/types.h>
+
+typedef s32		compat_time_t;
+
+struct compat_timespec {
+	compat_time_t	tv_sec;
+	s32		tv_nsec;
+};
+
+struct compat_timeval {
+	compat_time_t	tv_sec;
+	s32		tv_usec;
+};
+
+#endif /* _LINUX_COMPAT_TIME_H */
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 2/9] compat: Make compat helpers independent of CONFIG_COMPAT
  2017-11-10 22:42 ` Deepa Dinamani
                   ` (3 preceding siblings ...)
  (?)
@ 2017-11-10 22:42 ` Deepa Dinamani
  2017-11-14 16:47   ` Arnd Bergmann
  -1 siblings, 1 reply; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz; +Cc: linux-kernel, arnd, y2038

Many of the compat time syscalls are also repurposed as 32 bit
native syscalls to provide backward compatibility while adding
new y2038 safe sycalls.
Enabling the helpers makes this possible.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 include/linux/compat.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/compat.h b/include/linux/compat.h
index 1a5e397ffcd4..f59f1f2d03de 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -24,6 +24,8 @@
 #include <asm/siginfo.h>
 #include <asm/signal.h>
 
+#endif
+
 #ifndef COMPAT_USE_64BIT_TIME
 #define COMPAT_USE_64BIT_TIME 0
 #endif
@@ -59,6 +61,8 @@
 	}								\
 	static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__))
 
+#ifdef CONFIG_COMPAT
+
 #ifndef compat_user_stack_pointer
 #define compat_user_stack_pointer() current_user_stack_pointer()
 #endif
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 3/9] compat: enable compat_get/put_timespec64 always
  2017-11-10 22:42 ` Deepa Dinamani
                   ` (4 preceding siblings ...)
  (?)
@ 2017-11-10 22:42 ` Deepa Dinamani
  -1 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz; +Cc: linux-kernel, arnd, y2038

These functions are used in the repurposed compat syscalls
to provide backward compatibility for using 32 bit time_t
on 32 bit systems.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 include/linux/compat.h      |  2 -
 include/linux/compat_time.h |  4 ++
 kernel/Makefile             |  2 +-
 kernel/compat.c             | 92 +++++++++++++++++++++++----------------------
 4 files changed, 53 insertions(+), 47 deletions(-)

diff --git a/include/linux/compat.h b/include/linux/compat.h
index f59f1f2d03de..d7f566c14e84 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -170,8 +170,6 @@ extern int compat_get_timespec(struct timespec *, const void __user *);
 extern int compat_put_timespec(const struct timespec *, void __user *);
 extern int compat_get_timeval(struct timeval *, const void __user *);
 extern int compat_put_timeval(const struct timeval *, void __user *);
-extern int compat_get_timespec64(struct timespec64 *, const void __user *);
-extern int compat_put_timespec64(const struct timespec64 *, void __user *);
 extern int get_compat_itimerspec64(struct itimerspec64 *its,
 			const struct compat_itimerspec __user *uits);
 extern int put_compat_itimerspec64(const struct itimerspec64 *its,
diff --git a/include/linux/compat_time.h b/include/linux/compat_time.h
index 56a54a1e4355..31f2774f1994 100644
--- a/include/linux/compat_time.h
+++ b/include/linux/compat_time.h
@@ -3,6 +3,7 @@
 #define _LINUX_COMPAT_TIME_H
 
 #include <linux/types.h>
+#include <linux/time64.h>
 
 typedef s32		compat_time_t;
 
@@ -16,4 +17,7 @@ struct compat_timeval {
 	s32		tv_usec;
 };
 
+extern int compat_get_timespec64(struct timespec64 *, const void __user *);
+extern int compat_put_timespec64(const struct timespec64 *, void __user *);
+
 #endif /* _LINUX_COMPAT_TIME_H */
diff --git a/kernel/Makefile b/kernel/Makefile
index 172d151d429c..2e3df3deee18 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -66,7 +66,7 @@ obj-$(CONFIG_KEXEC_CORE) += kexec_core.o
 obj-$(CONFIG_KEXEC) += kexec.o
 obj-$(CONFIG_KEXEC_FILE) += kexec_file.o
 obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
-obj-$(CONFIG_COMPAT) += compat.o
+obj-y += compat.o
 obj-$(CONFIG_CGROUPS) += cgroup/
 obj-$(CONFIG_UTS_NS) += utsname.o
 obj-$(CONFIG_USER_NS) += user_namespace.o
diff --git a/kernel/compat.c b/kernel/compat.c
index d1cee656a7ed..42653ac977c0 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -30,6 +30,52 @@
 
 #include <linux/uaccess.h>
 
+static int __compat_get_timespec64(struct timespec64 *ts64,
+				   const struct compat_timespec __user *cts)
+{
+	struct compat_timespec ts;
+	int ret;
+
+	ret = copy_from_user(&ts, cts, sizeof(ts));
+	if (ret)
+		return -EFAULT;
+
+	ts64->tv_sec = ts.tv_sec;
+	ts64->tv_nsec = ts.tv_nsec;
+
+	return 0;
+}
+
+static int __compat_put_timespec64(const struct timespec64 *ts64,
+				   struct compat_timespec __user *cts)
+{
+	struct compat_timespec ts = {
+		.tv_sec = ts64->tv_sec,
+		.tv_nsec = ts64->tv_nsec
+	};
+	return copy_to_user(cts, &ts, sizeof(ts)) ? -EFAULT : 0;
+}
+
+int compat_get_timespec64(struct timespec64 *ts, const void __user *uts)
+{
+	if (COMPAT_USE_64BIT_TIME)
+		return copy_from_user(ts, uts, sizeof(*ts)) ? -EFAULT : 0;
+	else
+		return __compat_get_timespec64(ts, uts);
+}
+EXPORT_SYMBOL_GPL(compat_get_timespec64);
+
+int compat_put_timespec64(const struct timespec64 *ts, void __user *uts)
+{
+	if (COMPAT_USE_64BIT_TIME)
+		return copy_to_user(uts, ts, sizeof(*ts)) ? -EFAULT : 0;
+	else
+		return __compat_put_timespec64(ts, uts);
+}
+EXPORT_SYMBOL_GPL(compat_put_timespec64);
+
+#ifdef CONFIG_COMPAT
+
 int compat_get_timex(struct timex *txc, const struct compat_timex __user *utp)
 {
 	struct compat_timex tx32;
@@ -120,50 +166,6 @@ static int __compat_put_timespec(const struct timespec *ts, struct compat_timesp
 			__put_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
 }
 
-static int __compat_get_timespec64(struct timespec64 *ts64,
-				   const struct compat_timespec __user *cts)
-{
-	struct compat_timespec ts;
-	int ret;
-
-	ret = copy_from_user(&ts, cts, sizeof(ts));
-	if (ret)
-		return -EFAULT;
-
-	ts64->tv_sec = ts.tv_sec;
-	ts64->tv_nsec = ts.tv_nsec;
-
-	return 0;
-}
-
-static int __compat_put_timespec64(const struct timespec64 *ts64,
-				   struct compat_timespec __user *cts)
-{
-	struct compat_timespec ts = {
-		.tv_sec = ts64->tv_sec,
-		.tv_nsec = ts64->tv_nsec
-	};
-	return copy_to_user(cts, &ts, sizeof(ts)) ? -EFAULT : 0;
-}
-
-int compat_get_timespec64(struct timespec64 *ts, const void __user *uts)
-{
-	if (COMPAT_USE_64BIT_TIME)
-		return copy_from_user(ts, uts, sizeof(*ts)) ? -EFAULT : 0;
-	else
-		return __compat_get_timespec64(ts, uts);
-}
-EXPORT_SYMBOL_GPL(compat_get_timespec64);
-
-int compat_put_timespec64(const struct timespec64 *ts, void __user *uts)
-{
-	if (COMPAT_USE_64BIT_TIME)
-		return copy_to_user(uts, ts, sizeof(*ts)) ? -EFAULT : 0;
-	else
-		return __compat_put_timespec64(ts, uts);
-}
-EXPORT_SYMBOL_GPL(compat_put_timespec64);
-
 int compat_get_timeval(struct timeval *tv, const void __user *utv)
 {
 	if (COMPAT_USE_64BIT_TIME)
@@ -582,3 +584,5 @@ void __user *compat_alloc_user_space(unsigned long len)
 	return ptr;
 }
 EXPORT_SYMBOL_GPL(compat_alloc_user_space);
+
+#endif
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 4/9] posix-clocks: Enable compat syscalls always
  2017-11-10 22:42 ` Deepa Dinamani
                   ` (5 preceding siblings ...)
  (?)
@ 2017-11-10 22:42 ` Deepa Dinamani
  2017-11-13 21:03   ` Thomas Gleixner
  -1 siblings, 1 reply; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz; +Cc: linux-kernel, arnd, y2038

clock_gettime, clock_settime, clock_getres and clock_nanosleep
compat syscalls are also repurposed to provide backward compatibility
to support 32 bit time_t on 32 bit systems.

Note that nanosleep compat syscall will also be treated the same way
as the above syscalls as it shares common handler funtions with
clock_nanosleep. But, there is no plan to provide y2038 safe solution
for nanosleep.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 kernel/time/hrtimer.c      |  3 ---
 kernel/time/posix-stubs.c  |  2 +-
 kernel/time/posix-timers.c | 10 ++++------
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index d32520840fde..e7db66af5a23 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1557,8 +1557,6 @@ SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
 	return hrtimer_nanosleep(&tu, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
 }
 
-#ifdef CONFIG_COMPAT
-
 COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
 		       struct compat_timespec __user *, rmtp)
 {
@@ -1574,7 +1572,6 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
 	current->restart_block.nanosleep.compat_rmtp = rmtp;
 	return hrtimer_nanosleep(&tu, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
 }
-#endif
 
 /*
  * Functions related to boot-time initialization:
diff --git a/kernel/time/posix-stubs.c b/kernel/time/posix-stubs.c
index b258bee13b02..b2dc97a39c35 100644
--- a/kernel/time/posix-stubs.c
+++ b/kernel/time/posix-stubs.c
@@ -148,6 +148,7 @@ COMPAT_SYS_NI(timer_settime);
 COMPAT_SYS_NI(timer_gettime);
 COMPAT_SYS_NI(getitimer);
 COMPAT_SYS_NI(setitimer);
+#endif
 
 COMPAT_SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
 		       struct compat_timespec __user *, tp)
@@ -224,4 +225,3 @@ COMPAT_SYSCALL_DEFINE4(clock_nanosleep, clockid_t, which_clock, int, flags,
 				 HRTIMER_MODE_ABS : HRTIMER_MODE_REL,
 				 which_clock);
 }
-#endif
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 13d6881f908b..0650ec27a673 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -1107,8 +1107,6 @@ SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock,
 	return error;
 }
 
-#ifdef CONFIG_COMPAT
-
 COMPAT_SYSCALL_DEFINE2(clock_settime, clockid_t, which_clock,
 		       struct compat_timespec __user *, tp)
 {
@@ -1142,6 +1140,8 @@ COMPAT_SYSCALL_DEFINE2(clock_gettime, clockid_t, which_clock,
 	return err;
 }
 
+#ifdef CONFIG_COMPAT
+
 COMPAT_SYSCALL_DEFINE2(clock_adjtime, clockid_t, which_clock,
 		       struct compat_timex __user *, utp)
 {
@@ -1166,6 +1166,8 @@ COMPAT_SYSCALL_DEFINE2(clock_adjtime, clockid_t, which_clock,
 	return err;
 }
 
+#endif
+
 COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock,
 		       struct compat_timespec __user *, tp)
 {
@@ -1183,8 +1185,6 @@ COMPAT_SYSCALL_DEFINE2(clock_getres, clockid_t, which_clock,
 	return err;
 }
 
-#endif
-
 /*
  * nanosleep for monotonic and realtime clocks
  */
@@ -1221,7 +1221,6 @@ SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
 	return kc->nsleep(which_clock, flags, &t);
 }
 
-#ifdef CONFIG_COMPAT
 COMPAT_SYSCALL_DEFINE4(clock_nanosleep, clockid_t, which_clock, int, flags,
 		       struct compat_timespec __user *, rqtp,
 		       struct compat_timespec __user *, rmtp)
@@ -1246,7 +1245,6 @@ COMPAT_SYSCALL_DEFINE4(clock_nanosleep, clockid_t, which_clock, int, flags,
 
 	return kc->nsleep(which_clock, flags, &t);
 }
-#endif
 
 static const struct k_clock clock_realtime = {
 	.clock_getres		= posix_get_hrtimer_res,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 5/9] y2038: introduce CONFIG_64BIT_TIME
  2017-11-10 22:42 ` Deepa Dinamani
                   ` (6 preceding siblings ...)
  (?)
@ 2017-11-10 22:42 ` Deepa Dinamani
  2017-12-08 16:53   ` [Y2038] " Ben Hutchings
  -1 siblings, 1 reply; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz; +Cc: linux-kernel, arnd, y2038

From: Arnd Bergmann <arnd@arndb.de>

There are a total of 53 system calls (aside from ioctl) that pass a time_t
or derived data structure as an argument, and in order to extend time_t
to 64-bit, we have to replace them with new system calls and keep providing
backwards compatibility.

To avoid adding completely new and untested code for this purpose, we
introduce a new CONFIG_64BIT_TIME symbol. Every architecture that supports
new 64 bit time_t syscalls enables this config via ARCH_HAS_64BIT_TIME.

After this is done for all architectures, the CONFIG_64BIT_TIME symbol
can be made a user-selected option, to enable users to build a kernel
that only provides y2038-safe system calls by making 32 time_t syscalls
conditionally included based on the above config.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 arch/Kconfig | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 8911ff37335a..3266ac1a4ff7 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -875,6 +875,17 @@ config OLD_SIGACTION
 config COMPAT_OLD_SIGACTION
 	bool
 
+config ARCH_HAS_64BIT_TIME
+	def_bool n
+
+config CONFIG_64BIT_TIME
+	def_bool ARCH_HAS_64BIT_TIME
+	help
+	  This should be selected by all architectures that need to support
+	  new system calls with a 64-bit time_t. This is relevant on all 32-bit
+	  architectures, and 64-bit architectures as part of compat syscall
+	  handling.
+
 config ARCH_NO_COHERENT_DMA_MMAP
 	bool
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 6/9] include: Add new y2038 safe __kernel_timespec
  2017-11-10 22:42 ` Deepa Dinamani
                   ` (7 preceding siblings ...)
  (?)
@ 2017-11-10 22:42 ` Deepa Dinamani
  -1 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz; +Cc: linux-kernel, arnd, y2038, linux-arch

The new struct __kernel_timespec is similar to current
internal kernel struct timespec64 on 64 bit architecture.
The compat structure however is similar to below on little
endian systems (padding and tv_nsec are switched for big
endian systems):

typedef s32            compat_long_t;
typedef s64            compat_kernel_time64_t;

struct compat_kernel_timespec {
       compat_kernel_time64_t  tv_sec;
       compat_long_t           tv_nsec;
       compat_long_t           padding;
};

This allows for both the native and compat representations to
be the same and syscalls using this type as part of their ABI
can have a single entry point to both.

Note that the compat define is not included anywhere in the
kernel explicitly to avoid confusion.

These types will be used by the new syscalls that will be
introduced in the consequent patches.
Most of the new syscalls are just an update to the existing
native ones with this new type. Hence, put this new type under
an ifdef so that the architectures can define CONFIG_64BIT_TIME
when they are ready to handle this switch.

Cc: linux-arch@vger.kernel.org
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 include/linux/time64.h                 | 10 +++++++++-
 include/uapi/asm-generic/posix_types.h |  1 +
 include/uapi/linux/time.h              |  7 +++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/include/linux/time64.h b/include/linux/time64.h
index 93d39499838e..0d96887ba4e0 100644
--- a/include/linux/time64.h
+++ b/include/linux/time64.h
@@ -2,12 +2,20 @@
 #ifndef _LINUX_TIME64_H
 #define _LINUX_TIME64_H
 
-#include <uapi/linux/time.h>
 #include <linux/math64.h>
 
 typedef __s64 time64_t;
 typedef __u64 timeu64_t;
 
+/* CONFIG_64BIT_TIME enables new 64 bit time_t syscalls in the compat path
+ * and 32-bit emulation.
+ */
+#ifndef CONFIG_64BIT_TIME
+#define __kernel_timespec timespec
+#endif
+
+#include <uapi/linux/time.h>
+
 #if __BITS_PER_LONG == 64
 /* this trick allows us to optimize out timespec64_to_timespec */
 # define timespec64 timespec
diff --git a/include/uapi/asm-generic/posix_types.h b/include/uapi/asm-generic/posix_types.h
index 5e6ea22bd525..f0733a26ebfc 100644
--- a/include/uapi/asm-generic/posix_types.h
+++ b/include/uapi/asm-generic/posix_types.h
@@ -87,6 +87,7 @@ typedef struct {
 typedef __kernel_long_t	__kernel_off_t;
 typedef long long	__kernel_loff_t;
 typedef __kernel_long_t	__kernel_time_t;
+typedef long long __kernel_time64_t;
 typedef __kernel_long_t	__kernel_clock_t;
 typedef int		__kernel_timer_t;
 typedef int		__kernel_clockid_t;
diff --git a/include/uapi/linux/time.h b/include/uapi/linux/time.h
index 53f8dd84beb5..0ad4510884b0 100644
--- a/include/uapi/linux/time.h
+++ b/include/uapi/linux/time.h
@@ -42,6 +42,13 @@ struct itimerval {
 	struct timeval it_value;	/* current value */
 };
 
+#ifndef __kernel_timespec
+struct __kernel_timespec {
+	__kernel_time64_t       tv_sec;                 /* seconds */
+	long long               tv_nsec;                /* nanoseconds */
+};
+#endif
+
 /*
  * The IDs of the various system clocks (for POSIX.1b interval timers):
  */
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 7/9] fix get_timespec64() for y2038 safe compat interfaces
  2017-11-10 22:42 ` Deepa Dinamani
                   ` (8 preceding siblings ...)
  (?)
@ 2017-11-10 22:42 ` Deepa Dinamani
  2017-11-14 14:17   ` Arnd Bergmann
  -1 siblings, 1 reply; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz; +Cc: linux-kernel, arnd, y2038

get/put_timespec64() interfaces will eventually be used for
conversions between the new y2038 safe struct __kernel_timespec
and struct timespec64.

The new y2038 safe syscalls have a common entry for native
and compat interfaces.
On compat interfaces, the high order bits of nanoseconds are
should to be zeroed out. This is because the application code
or the libc do not garuntee zeroing of these. If used without
zeroing, kernel might be at risk of using timespec values
incorrectly.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 include/linux/time.h |  4 ++--
 kernel/time/time.c   | 10 ++++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/linux/time.h b/include/linux/time.h
index 4b62a2c0a661..aed74463592d 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -10,9 +10,9 @@
 extern struct timezone sys_tz;
 
 int get_timespec64(struct timespec64 *ts,
-		const struct timespec __user *uts);
+		const struct __kernel_timespec __user *uts);
 int put_timespec64(const struct timespec64 *ts,
-		struct timespec __user *uts);
+		struct __kernel_timespec __user *uts);
 int get_itimerspec64(struct itimerspec64 *it,
 			const struct itimerspec __user *uit);
 int put_itimerspec64(const struct itimerspec64 *it,
diff --git a/kernel/time/time.c b/kernel/time/time.c
index bd4e6c7dd689..476fd00c9bb0 100644
--- a/kernel/time/time.c
+++ b/kernel/time/time.c
@@ -841,7 +841,7 @@ struct timespec64 timespec64_add_safe(const struct timespec64 lhs,
 }
 
 int get_timespec64(struct timespec64 *ts,
-		   const struct timespec __user *uts)
+		   const struct __kernel_timespec __user *uts)
 {
 	struct timespec kts;
 	int ret;
@@ -851,6 +851,11 @@ int get_timespec64(struct timespec64 *ts,
 		return -EFAULT;
 
 	ts->tv_sec = kts.tv_sec;
+
+	/* Zero out the padding for 32 bit systems or in compat mode */
+	if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall())
+		kts.tv_nsec &= 0xFFFFFFFFUL;
+
 	ts->tv_nsec = kts.tv_nsec;
 
 	return 0;
@@ -858,12 +863,13 @@ int get_timespec64(struct timespec64 *ts,
 EXPORT_SYMBOL_GPL(get_timespec64);
 
 int put_timespec64(const struct timespec64 *ts,
-		   struct timespec __user *uts)
+		   struct __kernel_timespec __user *uts)
 {
 	struct timespec kts = {
 		.tv_sec = ts->tv_sec,
 		.tv_nsec = ts->tv_nsec
 	};
+
 	return copy_to_user(uts, &kts, sizeof(kts)) ? -EFAULT : 0;
 }
 EXPORT_SYMBOL_GPL(put_timespec64);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 8/9] change time types to new y2038 safe __kernel_* types
  2017-11-10 22:42 ` Deepa Dinamani
                   ` (9 preceding siblings ...)
  (?)
@ 2017-11-10 22:42 ` Deepa Dinamani
  -1 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz; +Cc: linux-kernel, arnd, y2038, linux-api

Change over clock_settime, clock_gettime and clock_getres
syscalls to use __kernel_timespec times. This will enable
changing over of these syscalls to use new y2038 safe syscalls
when the architectures define the CONFIG_64BIT_TIME.

Cc: linux-api@vger.kernel.org
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 include/linux/syscalls.h   | 6 +++---
 kernel/time/posix-stubs.c  | 6 +++---
 kernel/time/posix-timers.c | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index a78186d826d7..7ac1bb9ea7da 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -309,13 +309,13 @@ asmlinkage long sys_timer_settime(timer_t timer_id, int flags,
 				struct itimerspec __user *old_setting);
 asmlinkage long sys_timer_delete(timer_t timer_id);
 asmlinkage long sys_clock_settime(clockid_t which_clock,
-				const struct timespec __user *tp);
+				const struct __kernel_timespec __user *tp);
 asmlinkage long sys_clock_gettime(clockid_t which_clock,
-				struct timespec __user *tp);
+				struct __kernel_timespec __user *tp);
 asmlinkage long sys_clock_adjtime(clockid_t which_clock,
 				struct timex __user *tx);
 asmlinkage long sys_clock_getres(clockid_t which_clock,
-				struct timespec __user *tp);
+				struct __kernel_timespec __user *tp);
 asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
 				const struct timespec __user *rqtp,
 				struct timespec __user *rmtp);
diff --git a/kernel/time/posix-stubs.c b/kernel/time/posix-stubs.c
index b2dc97a39c35..684d470dba2c 100644
--- a/kernel/time/posix-stubs.c
+++ b/kernel/time/posix-stubs.c
@@ -49,7 +49,7 @@ SYS_NI(alarm);
  */
 
 SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
-		const struct timespec __user *, tp)
+		const struct __kernel_timespec __user *, tp)
 {
 	struct timespec64 new_tp;
 
@@ -80,7 +80,7 @@ int do_clock_gettime(clockid_t which_clock, struct timespec64 *tp)
 	return 0;
 }
 SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
-		struct timespec __user *, tp)
+		struct __kernel_timespec __user *, tp)
 {
 	int ret;
 	struct timespec64 kernel_tp;
@@ -94,7 +94,7 @@ SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
 	return 0;
 }
 
-SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct timespec __user *, tp)
+SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct __kernel_timespec __user *, tp)
 {
 	struct timespec64 rtn_tp = {
 		.tv_sec = 0,
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 0650ec27a673..d482359bce1b 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -1034,7 +1034,7 @@ void exit_itimers(struct signal_struct *sig)
 }
 
 SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
-		const struct timespec __user *, tp)
+		const struct __kernel_timespec __user *, tp)
 {
 	const struct k_clock *kc = clockid_to_kclock(which_clock);
 	struct timespec64 new_tp;
@@ -1049,7 +1049,7 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
 }
 
 SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
-		struct timespec __user *,tp)
+		struct __kernel_timespec __user *, tp)
 {
 	const struct k_clock *kc = clockid_to_kclock(which_clock);
 	struct timespec64 kernel_tp;
@@ -1090,7 +1090,7 @@ SYSCALL_DEFINE2(clock_adjtime, const clockid_t, which_clock,
 }
 
 SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock,
-		struct timespec __user *, tp)
+		struct __kernel_timespec __user *, tp)
 {
 	const struct k_clock *kc = clockid_to_kclock(which_clock);
 	struct timespec64 rtn_tp;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 9/9] nanosleep: change time types to safe __kernel_* types
@ 2017-11-10 22:42   ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx, john.stultz; +Cc: linux-kernel, arnd, y2038, linux-api

Change over clock_nanosleep syscalls to use y2038 safe
__kernel_timespec times. This will enable changing over
of these syscalls to use new y2038 safe syscalls when
the architectures define the CONFIG_64BIT_TIME.

Note that nanosleep syscall is deprecated and does not have a
plan for making it y2038 safe. But, the syscall should work as
before on 64 bit machines and on 32 bit machines, the syscall
works correctly until y2038 as before using the existing compat
syscall version. There is no new syscall for supporting 64 bit
time_t on 32 bit architectures.

Cc: linux-api@vger.kernel.org
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
 include/linux/restart_block.h | 7 ++-----
 include/linux/syscalls.h      | 6 +++---
 kernel/time/hrtimer.c         | 4 ++--
 kernel/time/posix-stubs.c     | 4 ++--
 kernel/time/posix-timers.c    | 4 ++--
 5 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/include/linux/restart_block.h b/include/linux/restart_block.h
index bcfdb918cd81..5d83d0c1d06c 100644
--- a/include/linux/restart_block.h
+++ b/include/linux/restart_block.h
@@ -7,6 +7,7 @@
 
 #include <linux/compiler.h>
 #include <linux/types.h>
+#include <linux/time64.h>
 
 struct timespec;
 struct compat_timespec;
@@ -15,9 +16,7 @@ struct pollfd;
 enum timespec_type {
 	TT_NONE		= 0,
 	TT_NATIVE	= 1,
-#ifdef CONFIG_COMPAT
 	TT_COMPAT	= 2,
-#endif
 };
 
 /*
@@ -40,10 +39,8 @@ struct restart_block {
 			clockid_t clockid;
 			enum timespec_type type;
 			union {
-				struct timespec __user *rmtp;
-#ifdef CONFIG_COMPAT
+				struct __kernel_timespec __user *rmtp;
 				struct compat_timespec __user *compat_rmtp;
-#endif
 			};
 			u64 expires;
 		} nanosleep;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 7ac1bb9ea7da..4df16a70b0d7 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -254,7 +254,7 @@ asmlinkage long sys_adjtimex(struct timex __user *txc_p);
 asmlinkage long sys_times(struct tms __user *tbuf);
 
 asmlinkage long sys_gettid(void);
-asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp);
+asmlinkage long sys_nanosleep(struct __kernel_timespec __user *rqtp, struct __kernel_timespec __user *rmtp);
 asmlinkage long sys_alarm(unsigned int seconds);
 asmlinkage long sys_getpid(void);
 asmlinkage long sys_getppid(void);
@@ -317,8 +317,8 @@ asmlinkage long sys_clock_adjtime(clockid_t which_clock,
 asmlinkage long sys_clock_getres(clockid_t which_clock,
 				struct __kernel_timespec __user *tp);
 asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
-				const struct timespec __user *rqtp,
-				struct timespec __user *rmtp);
+				const struct __kernel_timespec __user *rqtp,
+				struct __kernel_timespec __user *rmtp);
 
 asmlinkage long sys_nice(int increment);
 asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index e7db66af5a23..ce6cbb687c47 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1541,8 +1541,8 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp,
 	return ret;
 }
 
-SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
-		struct timespec __user *, rmtp)
+SYSCALL_DEFINE2(nanosleep, struct __kernel_timespec __user *, rqtp,
+		struct __kernel_timespec __user *, rmtp)
 {
 	struct timespec64 tu;
 
diff --git a/kernel/time/posix-stubs.c b/kernel/time/posix-stubs.c
index 684d470dba2c..cdc5fed5f89b 100644
--- a/kernel/time/posix-stubs.c
+++ b/kernel/time/posix-stubs.c
@@ -114,8 +114,8 @@ SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct __kernel_time
 }
 
 SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
-		const struct timespec __user *, rqtp,
-		struct timespec __user *, rmtp)
+		const struct __kernel_timespec __user *, rqtp,
+		struct __kernel_timespec __user *, rmtp)
 {
 	struct timespec64 t;
 
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index d482359bce1b..b8e1bf1aa00f 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -1197,8 +1197,8 @@ static int common_nsleep(const clockid_t which_clock, int flags,
 }
 
 SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
-		const struct timespec __user *, rqtp,
-		struct timespec __user *, rmtp)
+		const struct __kernel_timespec __user *, rqtp,
+		struct __kernel_timespec __user *, rmtp)
 {
 	const struct k_clock *kc = clockid_to_kclock(which_clock);
 	struct timespec64 t;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* [PATCH 9/9] nanosleep: change time types to safe __kernel_* types
@ 2017-11-10 22:42   ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-10 22:42 UTC (permalink / raw)
  To: tglx-hfZtesqFncYOwBW4kG4KsQ, john.stultz-QSEj5FYQhm4dnm+yROfE0A
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
	y2038-cunTk1MwBs8s++Sfvej+rw, linux-api-u79uwXL29TY76Z2rM5mHXA

Change over clock_nanosleep syscalls to use y2038 safe
__kernel_timespec times. This will enable changing over
of these syscalls to use new y2038 safe syscalls when
the architectures define the CONFIG_64BIT_TIME.

Note that nanosleep syscall is deprecated and does not have a
plan for making it y2038 safe. But, the syscall should work as
before on 64 bit machines and on 32 bit machines, the syscall
works correctly until y2038 as before using the existing compat
syscall version. There is no new syscall for supporting 64 bit
time_t on 32 bit architectures.

Cc: linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Deepa Dinamani <deepa.kernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 include/linux/restart_block.h | 7 ++-----
 include/linux/syscalls.h      | 6 +++---
 kernel/time/hrtimer.c         | 4 ++--
 kernel/time/posix-stubs.c     | 4 ++--
 kernel/time/posix-timers.c    | 4 ++--
 5 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/include/linux/restart_block.h b/include/linux/restart_block.h
index bcfdb918cd81..5d83d0c1d06c 100644
--- a/include/linux/restart_block.h
+++ b/include/linux/restart_block.h
@@ -7,6 +7,7 @@
 
 #include <linux/compiler.h>
 #include <linux/types.h>
+#include <linux/time64.h>
 
 struct timespec;
 struct compat_timespec;
@@ -15,9 +16,7 @@ struct pollfd;
 enum timespec_type {
 	TT_NONE		= 0,
 	TT_NATIVE	= 1,
-#ifdef CONFIG_COMPAT
 	TT_COMPAT	= 2,
-#endif
 };
 
 /*
@@ -40,10 +39,8 @@ struct restart_block {
 			clockid_t clockid;
 			enum timespec_type type;
 			union {
-				struct timespec __user *rmtp;
-#ifdef CONFIG_COMPAT
+				struct __kernel_timespec __user *rmtp;
 				struct compat_timespec __user *compat_rmtp;
-#endif
 			};
 			u64 expires;
 		} nanosleep;
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 7ac1bb9ea7da..4df16a70b0d7 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -254,7 +254,7 @@ asmlinkage long sys_adjtimex(struct timex __user *txc_p);
 asmlinkage long sys_times(struct tms __user *tbuf);
 
 asmlinkage long sys_gettid(void);
-asmlinkage long sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp);
+asmlinkage long sys_nanosleep(struct __kernel_timespec __user *rqtp, struct __kernel_timespec __user *rmtp);
 asmlinkage long sys_alarm(unsigned int seconds);
 asmlinkage long sys_getpid(void);
 asmlinkage long sys_getppid(void);
@@ -317,8 +317,8 @@ asmlinkage long sys_clock_adjtime(clockid_t which_clock,
 asmlinkage long sys_clock_getres(clockid_t which_clock,
 				struct __kernel_timespec __user *tp);
 asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags,
-				const struct timespec __user *rqtp,
-				struct timespec __user *rmtp);
+				const struct __kernel_timespec __user *rqtp,
+				struct __kernel_timespec __user *rmtp);
 
 asmlinkage long sys_nice(int increment);
 asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index e7db66af5a23..ce6cbb687c47 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1541,8 +1541,8 @@ long hrtimer_nanosleep(const struct timespec64 *rqtp,
 	return ret;
 }
 
-SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
-		struct timespec __user *, rmtp)
+SYSCALL_DEFINE2(nanosleep, struct __kernel_timespec __user *, rqtp,
+		struct __kernel_timespec __user *, rmtp)
 {
 	struct timespec64 tu;
 
diff --git a/kernel/time/posix-stubs.c b/kernel/time/posix-stubs.c
index 684d470dba2c..cdc5fed5f89b 100644
--- a/kernel/time/posix-stubs.c
+++ b/kernel/time/posix-stubs.c
@@ -114,8 +114,8 @@ SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct __kernel_time
 }
 
 SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
-		const struct timespec __user *, rqtp,
-		struct timespec __user *, rmtp)
+		const struct __kernel_timespec __user *, rqtp,
+		struct __kernel_timespec __user *, rmtp)
 {
 	struct timespec64 t;
 
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index d482359bce1b..b8e1bf1aa00f 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -1197,8 +1197,8 @@ static int common_nsleep(const clockid_t which_clock, int flags,
 }
 
 SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
-		const struct timespec __user *, rqtp,
-		struct timespec __user *, rmtp)
+		const struct __kernel_timespec __user *, rqtp,
+		struct __kernel_timespec __user *, rmtp)
 {
 	const struct k_clock *kc = clockid_to_kclock(which_clock);
 	struct timespec64 t;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 68+ messages in thread

* Re: [PATCH 1/9] include: Move compat_timespec/ timeval to compat_time.h
  2017-11-10 22:42   ` Deepa Dinamani
  (?)
@ 2017-11-11  2:38     ` Steven Rostedt
  -1 siblings, 0 replies; 68+ messages in thread
From: Steven Rostedt @ 2017-11-11  2:38 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: tglx, john.stultz, linux-kernel, arnd, y2038, acme, benh,
	borntraeger, catalin.marinas, cmetcalf, cohuck, davem, deller,
	devel, gerald.schaefer, gregkh, heiko.carstens, hoeppner, hpa,
	jejb, jwi, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	mark.rutland, mingo, mpe, oberpar, oprofile-list, paulus, peterz,
	ralf, rric

On Fri, 10 Nov 2017 14:42:51 -0800
Deepa Dinamani <deepa.kernel@gmail.com> wrote:

> diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> index 09ad88572746..db25aa15b705 100644
> --- a/arch/x86/include/asm/ftrace.h
> +++ b/arch/x86/include/asm/ftrace.h
> @@ -49,7 +49,7 @@ int ftrace_int3_handler(struct pt_regs *regs);
>  #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
>  
>  #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
> -#include <asm/compat.h>
> +#include <linux/compat.h>
>  

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 1/9] include: Move compat_timespec/ timeval to compat_time.h
@ 2017-11-11  2:38     ` Steven Rostedt
  0 siblings, 0 replies; 68+ messages in thread
From: Steven Rostedt @ 2017-11-11  2:38 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: tglx, john.stultz, linux-kernel, arnd, y2038, acme, benh,
	borntraeger, catalin.marinas, cmetcalf, cohuck, davem, deller,
	devel, gerald.schaefer, gregkh, heiko.carstens, hoeppner, hpa,
	jejb, jwi, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	mark.rutland, mingo, mpe, oberpar, oprofile-list, paulus, peterz,
	ralf, rric, schwidefsky, sebott, sparclinux, sth, ubraun,
	will.deacon, x86

On Fri, 10 Nov 2017 14:42:51 -0800
Deepa Dinamani <deepa.kernel@gmail.com> wrote:

> diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> index 09ad88572746..db25aa15b705 100644
> --- a/arch/x86/include/asm/ftrace.h
> +++ b/arch/x86/include/asm/ftrace.h
> @@ -49,7 +49,7 @@ int ftrace_int3_handler(struct pt_regs *regs);
>  #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
>  
>  #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
> -#include <asm/compat.h>
> +#include <linux/compat.h>
>  

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 1/9] include: Move compat_timespec/ timeval to compat_time.h
@ 2017-11-11  2:38     ` Steven Rostedt
  0 siblings, 0 replies; 68+ messages in thread
From: Steven Rostedt @ 2017-11-11  2:38 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: tglx, john.stultz, linux-kernel, arnd, y2038, acme, benh,
	borntraeger, catalin.marinas, cmetcalf, cohuck, davem, deller,
	devel, gerald.schaefer, gregkh, heiko.carstens, hoeppner, hpa,
	jejb, jwi, linux-mips, linux-parisc, linuxppc-dev, linux-s390,
	mark.rutland, mingo, mpe, oberpar, oprofile-list, paulus, peterz,
	ralf, rric, schwidefsky, sebott, sparclinux, sth, ubraun,
	will.deacon, x86

On Fri, 10 Nov 2017 14:42:51 -0800
Deepa Dinamani <deepa.kernel@gmail.com> wrote:

> diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
> index 09ad88572746..db25aa15b705 100644
> --- a/arch/x86/include/asm/ftrace.h
> +++ b/arch/x86/include/asm/ftrace.h
> @@ -49,7 +49,7 @@ int ftrace_int3_handler(struct pt_regs *regs);
>  #if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
>  
>  #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
> -#include <asm/compat.h>
> +#include <linux/compat.h>
>  

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 4/9] posix-clocks: Enable compat syscalls always
  2017-11-10 22:42 ` [PATCH 4/9] posix-clocks: Enable compat syscalls always Deepa Dinamani
@ 2017-11-13 21:03   ` Thomas Gleixner
  2017-11-13 23:26     ` Deepa Dinamani
  0 siblings, 1 reply; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-13 21:03 UTC (permalink / raw)
  To: Deepa Dinamani; +Cc: john.stultz, linux-kernel, arnd, y2038

On Fri, 10 Nov 2017, Deepa Dinamani wrote:
>  
> -#ifdef CONFIG_COMPAT
> -
>  COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
>  		       struct compat_timespec __user *, rmtp)
>  {
> @@ -1574,7 +1572,6 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
>  	current->restart_block.nanosleep.compat_rmtp = rmtp;
>  	return hrtimer_nanosleep(&tu, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
>  }
> -#endif

So if I'm not missing something important this will make the compat syscall
define available even for

CONFIG_X86_64=y
CONFIG_IA32_EMULATION=n
CONFIG_X86_X32=n

which is wrong because in that configuration we don't have any 32bit
executable support. So why would we need a compat syscall in that case?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 4/9] posix-clocks: Enable compat syscalls always
  2017-11-13 21:03   ` Thomas Gleixner
@ 2017-11-13 23:26     ` Deepa Dinamani
  2017-11-14 13:03       ` Arnd Bergmann
  0 siblings, 1 reply; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-13 23:26 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: John Stultz, Linux Kernel Mailing List, Arnd Bergmann,
	y2038 Mailman List

On Mon, Nov 13, 2017 at 1:03 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 10 Nov 2017, Deepa Dinamani wrote:
>>
>> -#ifdef CONFIG_COMPAT
>> -
>>  COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
>>                      struct compat_timespec __user *, rmtp)
>>  {
>> @@ -1574,7 +1572,6 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
>>       current->restart_block.nanosleep.compat_rmtp = rmtp;
>>       return hrtimer_nanosleep(&tu, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
>>  }
>> -#endif
>
> So if I'm not missing something important this will make the compat syscall
> define available even for
>
> CONFIG_X86_64=y
> CONFIG_IA32_EMULATION=n
> CONFIG_X86_X32=n
>
> which is wrong because in that configuration we don't have any 32bit
> executable support. So why would we need a compat syscall in that case?

I was thinking that we would switch the meaning of CONFIG_64BIT_TIME
after all architectures have enabled support for 64 bit time_t
syscalls.
After that, I was going to use the config to mean enable only 64 bit
time_t support and so all compat syscalls would have #ifndef
CONFIG_64BIT_TIME around them.
Compat syscalls do not mean compat anymore for these time syscalls as
the data structure is defined in a way that they are the same on 64
bit and 32 bit architectures.

But, you are right. It will leave in compat syscalls when it is not
required now.
I could add a dependency on CONFIG_COMPAT and __BITS_PER_LONG for now
if you prefer. I could introduce additional dependencies later on.

-Deepa

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 4/9] posix-clocks: Enable compat syscalls always
  2017-11-13 23:26     ` Deepa Dinamani
@ 2017-11-14 13:03       ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-14 13:03 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List

On Tue, Nov 14, 2017 at 12:26 AM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> On Mon, Nov 13, 2017 at 1:03 PM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> On Fri, 10 Nov 2017, Deepa Dinamani wrote:
>>>
>>> -#ifdef CONFIG_COMPAT
>>> -
>>>  COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
>>>                      struct compat_timespec __user *, rmtp)
>>>  {
>>> @@ -1574,7 +1572,6 @@ COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
>>>       current->restart_block.nanosleep.compat_rmtp = rmtp;
>>>       return hrtimer_nanosleep(&tu, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
>>>  }
>>> -#endif
>>
>> So if I'm not missing something important this will make the compat syscall
>> define available even for
>>
>> CONFIG_X86_64=y
>> CONFIG_IA32_EMULATION=n
>> CONFIG_X86_X32=n
>>
>> which is wrong because in that configuration we don't have any 32bit
>> executable support. So why would we need a compat syscall in that case?
>
> I was thinking that we would switch the meaning of CONFIG_64BIT_TIME
> after all architectures have enabled support for 64 bit time_t
> syscalls.

I think at that point the CONFIG_64BIT_TIME symbol can just go away,
the name would not express any useful meaning any more once all
architectures use 64-bit time types.

> After that, I was going to use the config to mean enable only 64 bit
> time_t support and so all compat syscalls would have #ifndef
> CONFIG_64BIT_TIME around them.
> Compat syscalls do not mean compat anymore for these time syscalls as
> the data structure is defined in a way that they are the same on 64
> bit and 32 bit architectures.
>
> But, you are right. It will leave in compat syscalls when it is not
> required now.
> I could add a dependency on CONFIG_COMPAT and __BITS_PER_LONG for now
> if you prefer. I could introduce additional dependencies later on.

In kernel uapi headers, checking for __BITS_PER_LONG is appropriate,
but we can't check for CONFIG_COMPAT there, since user space
does not see the CONFIG_ namespace.

In the kernel, checking for 64-bit architectures is better done using
the CONFIG_64BIT symbol.

So we could do

-#ifdef CONFIG_COMPAT
+#if defined(CONFIG_COMPAT) || !defined(CONFIG_64BIT)
-
 COMPAT_SYSCALL_DEFINE2(nanosleep, struct compat_timespec __user *, rqtp,
                      struct compat_timespec __user *, rmtp)

The trick with renaming the Kconfig symbol worked better with the old
CONFIG_COMPAT_TIME name that I had in an earlier draft of the
series, it would also enable us to leave out the 32-bit time compat
syscall implementation for future architectures that never had the
old uapi.

        Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 7/9] fix get_timespec64() for y2038 safe compat interfaces
  2017-11-10 22:42 ` [PATCH 7/9] fix get_timespec64() for y2038 safe compat interfaces Deepa Dinamani
@ 2017-11-14 14:17   ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-14 14:17 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List

On Fri, Nov 10, 2017 at 11:42 PM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:

> +
> +       /* Zero out the padding for 32 bit systems or in compat mode */
> +       if (!IS_ENABLED(CONFIG_64BIT) || in_compat_syscall())
> +               kts.tv_nsec &= 0xFFFFFFFFUL;

Is this correct for x32? Since x32 has a 64-bit tv_nsec, I think we currently
return an error in timespec64_valid when e.g. you pass 0xffffffff00000000
as the tv_nsec value, while after this patch x32 would behave the same way
as other 32-bit architectures and silently clear the upper bits.

      Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-10 22:42 ` Deepa Dinamani
  (?)
  (?)
@ 2017-11-14 14:24   ` Arnd Bergmann
  -1 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-14 14:24 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian

On Fri, Nov 10, 2017 at 11:42 PM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> 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
>
> Big picture is as per the lwn article:
> https://lwn.net/Articles/643234/
>
> 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 unconditionally.
> 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.
>
> Arnd Bergmann (1):
>   y2038: introduce CONFIG_64BIT_TIME

The series looks good to me overall, and I've added it to my build-testing tree
to see if it shows any regressions in random configurations.

I had on concern about x32, maybe we should check
for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
bits.

Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
it help to just leave out that part for now and unconditionally
define '__kernel_timespec' as 'timespec' until we are ready to
convert the architectures?

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-14 14:24   ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-14 14:24 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, rric,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

On Fri, Nov 10, 2017 at 11:42 PM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> 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
>
> Big picture is as per the lwn article:
> https://lwn.net/Articles/643234/
>
> 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 unconditionally.
> 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.
>
> Arnd Bergmann (1):
>   y2038: introduce CONFIG_64BIT_TIME

The series looks good to me overall, and I've added it to my build-testing tree
to see if it shows any regressions in random configurations.

I had on concern about x32, maybe we should check
for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
bits.

Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
it help to just leave out that part for now and unconditionally
define '__kernel_timespec' as 'timespec' until we are ready to
convert the architectures?

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-14 14:24   ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-14 14:24 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian

On Fri, Nov 10, 2017 at 11:42 PM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> 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
>
> Big picture is as per the lwn article:
> https://lwn.net/Articles/643234/
>
> 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 unconditionally.
> 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.
>
> Arnd Bergmann (1):
>   y2038: introduce CONFIG_64BIT_TIME

The series looks good to me overall, and I've added it to my build-testing tree
to see if it shows any regressions in random configurations.

I had on concern about x32, maybe we should check
for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
bits.

Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
it help to just leave out that part for now and unconditionally
define '__kernel_timespec' as 'timespec' until we are ready to
convert the architectures?

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-14 14:24   ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-14 14:24 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian

On Fri, Nov 10, 2017 at 11:42 PM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> 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
>
> Big picture is as per the lwn article:
> https://lwn.net/Articles/643234/
>
> 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 unconditionally.
> 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.
>
> Arnd Bergmann (1):
>   y2038: introduce CONFIG_64BIT_TIME

The series looks good to me overall, and I've added it to my build-testing tree
to see if it shows any regressions in random configurations.

I had on concern about x32, maybe we should check
for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
bits.

Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
it help to just leave out that part for now and unconditionally
define '__kernel_timespec' as 'timespec' until we are ready to
convert the architectures?

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 2/9] compat: Make compat helpers independent of CONFIG_COMPAT
  2017-11-10 22:42 ` [PATCH 2/9] compat: Make compat helpers independent of CONFIG_COMPAT Deepa Dinamani
@ 2017-11-14 16:47   ` Arnd Bergmann
  2017-11-15 23:01     ` Deepa Dinamani
  0 siblings, 1 reply; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-14 16:47 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List

On Fri, Nov 10, 2017 at 11:42 PM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> Many of the compat time syscalls are also repurposed as 32 bit
> native syscalls to provide backward compatibility while adding
> new y2038 safe sycalls.
> Enabling the helpers makes this possible.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>

I ran into a build error on ARM64 with CONFIG_COMPAT=n with this patch,
here is a fixup that makes it build cleanly and should also work on other
architectures. Unfortunately, including asm/compat.h has a number of
dependencies on other headers, so I decided to just include them all
for the fixup.

Alternatively, we could change the architecture code to always include
asm/compat.h when using is_compat_thread(), or to replace
is_compat_thread() calls with in_compat_syscall(), but the approach
below should be more likely to work on the 64-bit architectures that I did
not try.

        Arnd

--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -9,8 +9,6 @@
 #include <linux/types.h>
 #include <linux/compat_time.h>

-#ifdef CONFIG_COMPAT
-
 #include <linux/stat.h>
 #include <linux/param.h>       /* for HZ */
 #include <linux/sem.h>
@@ -20,12 +18,12 @@
 #include <linux/aio_abi.h>     /* for aio_context_t */
 #include <linux/unistd.h>

+#ifdef CONFIG_64BIT
 #include <asm/compat.h>
+#endif
 #include <asm/siginfo.h>
 #include <asm/signal.h>

-#endif
-
 #ifndef COMPAT_USE_64BIT_TIME
 #define COMPAT_USE_64BIT_TIME 0
 #endif
@@ -774,7 +772,9 @@ static inline struct compat_timeval
ns_to_compat_timeval(s64 nsec)
 #else /* !CONFIG_COMPAT */

 #define is_compat_task() (0)
+#ifndef in_compat_syscall
 static inline bool in_compat_syscall(void) { return false; }
+#endif

 #endif /* CONFIG_COMPAT */

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 2/9] compat: Make compat helpers independent of CONFIG_COMPAT
  2017-11-14 16:47   ` Arnd Bergmann
@ 2017-11-15 23:01     ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-15 23:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List

Thanks, I will include the patch in the update.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-14 14:24   ` Arnd Bergmann
  (?)
  (?)
@ 2017-11-15 23:11     ` Deepa Dinamani
  -1 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-15 23:11 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian

> I had on concern about x32, maybe we should check
> for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
> bits.

Thanks, I think you are right. I had the check conditional on
CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)

> Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
> it help to just leave out that part for now and unconditionally
> define '__kernel_timespec' as 'timespec' until we are ready to
> convert the architectures?

Another approach would be to use separate configs:

1. To indicate 64 bit time_t syscall support. This will be dependent
on architectures as CONFIG_64BIT_TIME.
We can delete this once all architectures have provided support for this.

2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
which will compile out all syscalls/ features that use 32 bit time_t.
This can help build a y2038 safe kernel later.

Would this work for everyone?

-Deepa

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-15 23:11     ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-15 23:11 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, Robert Richter,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

> I had on concern about x32, maybe we should check
> for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
> bits.

Thanks, I think you are right. I had the check conditional on
CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)

> Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
> it help to just leave out that part for now and unconditionally
> define '__kernel_timespec' as 'timespec' until we are ready to
> convert the architectures?

Another approach would be to use separate configs:

1. To indicate 64 bit time_t syscall support. This will be dependent
on architectures as CONFIG_64BIT_TIME.
We can delete this once all architectures have provided support for this.

2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
which will compile out all syscalls/ features that use 32 bit time_t.
This can help build a y2038 safe kernel later.

Would this work for everyone?

-Deepa

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-15 23:11     ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-15 23:11 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian

> I had on concern about x32, maybe we should check
> for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
> bits.

Thanks, I think you are right. I had the check conditional on
CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)

> Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
> it help to just leave out that part for now and unconditionally
> define '__kernel_timespec' as 'timespec' until we are ready to
> convert the architectures?

Another approach would be to use separate configs:

1. To indicate 64 bit time_t syscall support. This will be dependent
on architectures as CONFIG_64BIT_TIME.
We can delete this once all architectures have provided support for this.

2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
which will compile out all syscalls/ features that use 32 bit time_t.
This can help build a y2038 safe kernel later.

Would this work for everyone?

-Deepa

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-15 23:11     ` Deepa Dinamani
  0 siblings, 0 replies; 68+ messages in thread
From: Deepa Dinamani @ 2017-11-15 23:11 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thomas Gleixner, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian

> I had on concern about x32, maybe we should check
> for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
> bits.

Thanks, I think you are right. I had the check conditional on
CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)

> Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
> it help to just leave out that part for now and unconditionally
> define '__kernel_timespec' as 'timespec' until we are ready to
> convert the architectures?

Another approach would be to use separate configs:

1. To indicate 64 bit time_t syscall support. This will be dependent
on architectures as CONFIG_64BIT_TIME.
We can delete this once all architectures have provided support for this.

2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
which will compile out all syscalls/ features that use 32 bit time_t.
This can help build a y2038 safe kernel later.

Would this work for everyone?

-Deepa

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-15 23:11     ` Deepa Dinamani
  (?)
  (?)
@ 2017-11-16  9:04       ` Thomas Gleixner
  -1 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-16  9:04 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Stefan Haberland, Heiko Carstens, Paul Mackerras, H. Peter Anvin,
	sparclinux, devel, linux-s390, y2038 Mailman List, Helge Deller,
	the arch/x86 maintainers, sebott, James E.J. Bottomley,
	Will Deacon, Christian Borntraeger, Ingo Molnar, oprofile-list,
	Catalin Marinas, linux-arch, Robert Richter, Chris Metcalf

On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> > I had on concern about x32, maybe we should check
> > for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
> > bits.
> 
> Thanks, I think you are right. I had the check conditional on
> CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)
> 
> > Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
> > it help to just leave out that part for now and unconditionally
> > define '__kernel_timespec' as 'timespec' until we are ready to
> > convert the architectures?
> 
> Another approach would be to use separate configs:
> 
> 1. To indicate 64 bit time_t syscall support. This will be dependent
> on architectures as CONFIG_64BIT_TIME.
> We can delete this once all architectures have provided support for this.
> 
> 2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
> which will compile out all syscalls/ features that use 32 bit time_t.
> This can help build a y2038 safe kernel later.
> 
> Would this work for everyone?

Having extra config switches which are selectable by architectures and
removed when everything is converted is definitely the right way to go.

That allows you to gradually convert stuff w/o inflicting wreckage all over
the place.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-16  9:04       ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-16  9:04 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Arnd Bergmann, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, Robert Richter,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> > I had on concern about x32, maybe we should check
> > for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
> > bits.
> 
> Thanks, I think you are right. I had the check conditional on
> CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)
> 
> > Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
> > it help to just leave out that part for now and unconditionally
> > define '__kernel_timespec' as 'timespec' until we are ready to
> > convert the architectures?
> 
> Another approach would be to use separate configs:
> 
> 1. To indicate 64 bit time_t syscall support. This will be dependent
> on architectures as CONFIG_64BIT_TIME.
> We can delete this once all architectures have provided support for this.
> 
> 2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
> which will compile out all syscalls/ features that use 32 bit time_t.
> This can help build a y2038 safe kernel later.
> 
> Would this work for everyone?

Having extra config switches which are selectable by architectures and
removed when everything is converted is definitely the right way to go.

That allows you to gradually convert stuff w/o inflicting wreckage all over
the place.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-16  9:04       ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-16  9:04 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Stefan Haberland, Heiko Carstens, Paul Mackerras, H. Peter Anvin,
	sparclinux, devel, linux-s390, y2038 Mailman List, Helge Deller,
	the arch/x86 maintainers, sebott, James E.J. Bottomley,
	Will Deacon, Christian Borntraeger, Ingo Molnar, oprofile-list,
	Catalin Marinas, linux-arch, Robert Richter, Chris Metcalf

On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> > I had on concern about x32, maybe we should check
> > for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
> > bits.
> 
> Thanks, I think you are right. I had the check conditional on
> CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)
> 
> > Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
> > it help to just leave out that part for now and unconditionally
> > define '__kernel_timespec' as 'timespec' until we are ready to
> > convert the architectures?
> 
> Another approach would be to use separate configs:
> 
> 1. To indicate 64 bit time_t syscall support. This will be dependent
> on architectures as CONFIG_64BIT_TIME.
> We can delete this once all architectures have provided support for this.
> 
> 2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
> which will compile out all syscalls/ features that use 32 bit time_t.
> This can help build a y2038 safe kernel later.
> 
> Would this work for everyone?

Having extra config switches which are selectable by architectures and
removed when everything is converted is definitely the right way to go.

That allows you to gradually convert stuff w/o inflicting wreckage all over
the place.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-16  9:04       ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-16  9:04 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Stefan Haberland, Heiko Carstens, Paul Mackerras, H. Peter Anvin,
	sparclinux, devel, linux-s390, y2038 Mailman List, Helge Deller,
	the arch/x86 maintainers, sebott, James E.J. Bottomley,
	Will Deacon, Christian Borntraeger, Ingo Molnar, oprofile-list,
	Catalin Marinas, linux-arch, Robert Richter, Chris Metcalf

On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> > I had on concern about x32, maybe we should check
> > for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
> > bits.
> 
> Thanks, I think you are right. I had the check conditional on
> CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)
> 
> > Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
> > it help to just leave out that part for now and unconditionally
> > define '__kernel_timespec' as 'timespec' until we are ready to
> > convert the architectures?
> 
> Another approach would be to use separate configs:
> 
> 1. To indicate 64 bit time_t syscall support. This will be dependent
> on architectures as CONFIG_64BIT_TIME.
> We can delete this once all architectures have provided support for this.
> 
> 2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
> which will compile out all syscalls/ features that use 32 bit time_t.
> This can help build a y2038 safe kernel later.
> 
> Would this work for everyone?

Having extra config switches which are selectable by architectures and
removed when everything is converted is definitely the right way to go.

That allows you to gradually convert stuff w/o inflicting wreckage all over
the place.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-16  9:04       ` Thomas Gleixner
  (?)
  (?)
@ 2017-11-16 23:42         ` Arnd Bergmann
  -1 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-16 23:42 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck-H+wXaHxf7aLQT0dZR+AlfA, David Miller,
	Helge Deller, devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	gerald.schaefer-tA70FqPdS9bQT0dZR+AlfA, gregkh, Heiko Carstens,
	Jan Hoeppner, H. Peter Anvin, James E.J. Bottomley, Julian

On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> wrote:
> On Wed, 15 Nov 2017, Deepa Dinamani wrote:
>> > I had on concern about x32, maybe we should check
>> > for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
>> > bits.
>>
>> Thanks, I think you are right. I had the check conditional on
>> CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)
>>
>> > Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
>> > it help to just leave out that part for now and unconditionally
>> > define '__kernel_timespec' as 'timespec' until we are ready to
>> > convert the architectures?
>>
>> Another approach would be to use separate configs:
>>
>> 1. To indicate 64 bit time_t syscall support. This will be dependent
>> on architectures as CONFIG_64BIT_TIME.
>> We can delete this once all architectures have provided support for this.
>>
>> 2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
>> which will compile out all syscalls/ features that use 32 bit time_t.
>> This can help build a y2038 safe kernel later.
>>
>> Would this work for everyone?
>
> Having extra config switches which are selectable by architectures and
> removed when everything is converted is definitely the right way to go.
>
> That allows you to gradually convert stuff w/o inflicting wreckage all over
> the place.

The CONFIG_64BIT_TIME would do that nicely for the new stuff like
the conditional definition of __kernel_timespec, this one would get
removed after we convert all architectures.

A second issue is how to control the compilation of the compat syscalls.
CONFIG_COMPAT_32BIT_TIME handles that and could be defined
in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
this is then just a more readable way of expressing exactly when the
functions should be built.

For completeness, there may be a third category, depending on how
we handle things like sys_nanosleep(): Here, we want the native
sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
architectures any more, as new glibc should call clock_nanosleep()
with a new syscall number instead. Should we then enclose
sys_nanosleep in "#if !defined(CONFIG_64BIT_TIME) ||
defined(CONFIG_64BIT)", or should we try to come up with another
Kconfig symbol name that expresses this better?

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-16 23:42         ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-16 23:42 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, Robert Richter,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Wed, 15 Nov 2017, Deepa Dinamani wrote:
>> > I had on concern about x32, maybe we should check
>> > for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
>> > bits.
>>
>> Thanks, I think you are right. I had the check conditional on
>> CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)
>>
>> > Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
>> > it help to just leave out that part for now and unconditionally
>> > define '__kernel_timespec' as 'timespec' until we are ready to
>> > convert the architectures?
>>
>> Another approach would be to use separate configs:
>>
>> 1. To indicate 64 bit time_t syscall support. This will be dependent
>> on architectures as CONFIG_64BIT_TIME.
>> We can delete this once all architectures have provided support for this.
>>
>> 2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
>> which will compile out all syscalls/ features that use 32 bit time_t.
>> This can help build a y2038 safe kernel later.
>>
>> Would this work for everyone?
>
> Having extra config switches which are selectable by architectures and
> removed when everything is converted is definitely the right way to go.
>
> That allows you to gradually convert stuff w/o inflicting wreckage all over
> the place.

The CONFIG_64BIT_TIME would do that nicely for the new stuff like
the conditional definition of __kernel_timespec, this one would get
removed after we convert all architectures.

A second issue is how to control the compilation of the compat syscalls.
CONFIG_COMPAT_32BIT_TIME handles that and could be defined
in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
this is then just a more readable way of expressing exactly when the
functions should be built.

For completeness, there may be a third category, depending on how
we handle things like sys_nanosleep(): Here, we want the native
sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
architectures any more, as new glibc should call clock_nanosleep()
with a new syscall number instead. Should we then enclose
sys_nanosleep in "#if !defined(CONFIG_64BIT_TIME) ||
defined(CONFIG_64BIT)", or should we try to come up with another
Kconfig symbol name that expresses this better?

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-16 23:42         ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-16 23:42 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck-H+wXaHxf7aLQT0dZR+AlfA, David Miller,
	Helge Deller, devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	gerald.schaefer-tA70FqPdS9bQT0dZR+AlfA, gregkh, Heiko Carstens,
	Jan Hoeppner, H. Peter Anvin, James E.J. Bottomley, Julian

On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> wrote:
> On Wed, 15 Nov 2017, Deepa Dinamani wrote:
>> > I had on concern about x32, maybe we should check
>> > for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
>> > bits.
>>
>> Thanks, I think you are right. I had the check conditional on
>> CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)
>>
>> > Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
>> > it help to just leave out that part for now and unconditionally
>> > define '__kernel_timespec' as 'timespec' until we are ready to
>> > convert the architectures?
>>
>> Another approach would be to use separate configs:
>>
>> 1. To indicate 64 bit time_t syscall support. This will be dependent
>> on architectures as CONFIG_64BIT_TIME.
>> We can delete this once all architectures have provided support for this.
>>
>> 2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
>> which will compile out all syscalls/ features that use 32 bit time_t.
>> This can help build a y2038 safe kernel later.
>>
>> Would this work for everyone?
>
> Having extra config switches which are selectable by architectures and
> removed when everything is converted is definitely the right way to go.
>
> That allows you to gradually convert stuff w/o inflicting wreckage all over
> the place.

The CONFIG_64BIT_TIME would do that nicely for the new stuff like
the conditional definition of __kernel_timespec, this one would get
removed after we convert all architectures.

A second issue is how to control the compilation of the compat syscalls.
CONFIG_COMPAT_32BIT_TIME handles that and could be defined
in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
this is then just a more readable way of expressing exactly when the
functions should be built.

For completeness, there may be a third category, depending on how
we handle things like sys_nanosleep(): Here, we want the native
sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
architectures any more, as new glibc should call clock_nanosleep()
with a new syscall number instead. Should we then enclose
sys_nanosleep in "#if !defined(CONFIG_64BIT_TIME) ||
defined(CONFIG_64BIT)", or should we try to come up with another
Kconfig symbol name that expresses this better?

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-16 23:42         ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-16 23:42 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck-H+wXaHxf7aLQT0dZR+AlfA, David Miller,
	Helge Deller, devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	gerald.schaefer-tA70FqPdS9bQT0dZR+AlfA, gregkh, Heiko Carstens,
	Jan Hoeppner, H. Peter Anvin, James E.J. Bottomley, Julian

On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Wed, 15 Nov 2017, Deepa Dinamani wrote:
>> > I had on concern about x32, maybe we should check
>> > for "COMPAT_USE_64BIT_TIME" before zeroing out the tv_nsec
>> > bits.
>>
>> Thanks, I think you are right. I had the check conditional on
>> CONFIG_64BIT_TIME and then removed as I forgot why I added it. :)
>>
>> > Regarding CONFIG_COMPAT_TIME/CONFIG_64BIT_TIME, would
>> > it help to just leave out that part for now and unconditionally
>> > define '__kernel_timespec' as 'timespec' until we are ready to
>> > convert the architectures?
>>
>> Another approach would be to use separate configs:
>>
>> 1. To indicate 64 bit time_t syscall support. This will be dependent
>> on architectures as CONFIG_64BIT_TIME.
>> We can delete this once all architectures have provided support for this.
>>
>> 2. Another config (maybe COMPAT_32BIT_TIME?) to be introduced later,
>> which will compile out all syscalls/ features that use 32 bit time_t.
>> This can help build a y2038 safe kernel later.
>>
>> Would this work for everyone?
>
> Having extra config switches which are selectable by architectures and
> removed when everything is converted is definitely the right way to go.
>
> That allows you to gradually convert stuff w/o inflicting wreckage all over
> the place.

The CONFIG_64BIT_TIME would do that nicely for the new stuff like
the conditional definition of __kernel_timespec, this one would get
removed after we convert all architectures.

A second issue is how to control the compilation of the compat syscalls.
CONFIG_COMPAT_32BIT_TIME handles that and could be defined
in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
this is then just a more readable way of expressing exactly when the
functions should be built.

For completeness, there may be a third category, depending on how
we handle things like sys_nanosleep(): Here, we want the native
sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
architectures any more, as new glibc should call clock_nanosleep()
with a new syscall number instead. Should we then enclose
sys_nanosleep in "#if !defined(CONFIG_64BIT_TIME) ||
defined(CONFIG_64BIT)", or should we try to come up with another
Kconfig symbol name that expresses this better?

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-16 23:42         ` Arnd Bergmann
  (?)
  (?)
@ 2017-11-17  8:58           ` Thomas Gleixner
  -1 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17  8:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

T24gRnJpLCAxNyBOb3YgMjAxNywgQXJuZCBCZXJnbWFubiB3cm90ZToKPiBPbiBUaHUsIE5vdiAx
NiwgMjAxNyBhdCAxMDowNCBBTSwgVGhvbWFzIEdsZWl4bmVyIDx0Z2x4QGxpbnV0cm9uaXguZGU+
IHdyb3RlOgo+ID4gT24gV2VkLCAxNSBOb3YgMjAxNywgRGVlcGEgRGluYW1hbmkgd3JvdGU6Cj4g
Pj4gV291bGQgdGhpcyB3b3JrIGZvciBldmVyeW9uZT8KPiA+Cj4gPiBIYXZpbmcgZXh0cmEgY29u
ZmlnIHN3aXRjaGVzIHdoaWNoIGFyZSBzZWxlY3RhYmxlIGJ5IGFyY2hpdGVjdHVyZXMgYW5kCj4g
PiByZW1vdmVkIHdoZW4gZXZlcnl0aGluZyBpcyBjb252ZXJ0ZWQgaXMgZGVmaW5pdGVseSB0aGUg
cmlnaHQgd2F5IHRvIGdvLgo+ID4KPiA+IFRoYXQgYWxsb3dzIHlvdSB0byBncmFkdWFsbHkgY29u
dmVydCBzdHVmZiB3L28gaW5mbGljdGluZyB3cmVja2FnZSBhbGwgb3Zlcgo+ID4gdGhlIHBsYWNl
Lgo+IAo+IFRoZSBDT05GSUdfNjRCSVRfVElNRSB3b3VsZCBkbyB0aGF0IG5pY2VseSBmb3IgdGhl
IG5ldyBzdHVmZiBsaWtlCj4gdGhlIGNvbmRpdGlvbmFsIGRlZmluaXRpb24gb2YgX19rZXJuZWxf
dGltZXNwZWMsIHRoaXMgb25lIHdvdWxkIGdldAo+IHJlbW92ZWQgYWZ0ZXIgd2UgY29udmVydCBh
bGwgYXJjaGl0ZWN0dXJlcy4KPiAKPiBBIHNlY29uZCBpc3N1ZSBpcyBob3cgdG8gY29udHJvbCB0
aGUgY29tcGlsYXRpb24gb2YgdGhlIGNvbXBhdCBzeXNjYWxscy4KPiBDT05GSUdfQ09NUEFUXzMy
QklUX1RJTUUgaGFuZGxlcyB0aGF0IGFuZCBjb3VsZCBiZSBkZWZpbmVkCj4gaW4gS2NvbmZpZyBh
cyAnZGVmX2Jvb2wgKCE2NEJJVCAmJiBDT05GSUdfNjRCSVRfVElNRSkgfHwgQ09NUEFUJywKPiB0
aGlzIGlzIHRoZW4ganVzdCBhIG1vcmUgcmVhZGFibGUgd2F5IG9mIGV4cHJlc3NpbmcgZXhhY3Rs
eSB3aGVuIHRoZQo+IGZ1bmN0aW9ucyBzaG91bGQgYmUgYnVpbHQuCj4gCj4gRm9yIGNvbXBsZXRl
bmVzcywgdGhlcmUgbWF5IGJlIGEgdGhpcmQgY2F0ZWdvcnksIGRlcGVuZGluZyBvbiBob3cKPiB3
ZSBoYW5kbGUgdGhpbmdzIGxpa2Ugc3lzX25hbm9zbGVlcCgpOiBIZXJlLCB3ZSB3YW50IHRoZSBu
YXRpdmUKPiBzeXNfbmFub3NsZWVwIG9uIDY0LWJpdCBhcmNoaXRlY3R1cmVzLCBhbmQgY29tcGF0
X3N5c19uYW5vc2xlZXAoKQo+IHRvIGhhbmRsZSB0aGUgMzItYml0IHRpbWVfdCB2YXJpYW50IG9u
IGJvdGggMzItYml0IGFuZCA2NC1iaXQgdGFyZ2V0cywKPiBidXQgb3VyIHBsYW4gaXMgdG8gbm90
IGhhdmUgYSBuYXRpdmUgMzItYml0IHN5c19uYW5vc2xlZXAgb24gMzItYml0Cj4gYXJjaGl0ZWN0
dXJlcyBhbnkgbW9yZSwgYXMgbmV3IGdsaWJjIHNob3VsZCBjYWxsIGNsb2NrX25hbm9zbGVlcCgp
Cj4gd2l0aCBhIG5ldyBzeXNjYWxsIG51bWJlciBpbnN0ZWFkLiBTaG91bGQgd2UgdGhlbiBlbmNs
b3NlCgpJc24ndCB0aGF0IGdvaW5nIHRvIGJyZWFrIGV4aXN0aW5nIHVzZXJzcGFjZT8KClRoYW5r
cwoKCXRnbHgKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18K
WTIwMzggbWFpbGluZyBsaXN0ClkyMDM4QGxpc3RzLmxpbmFyby5vcmcKaHR0cHM6Ly9saXN0cy5s
aW5hcm8ub3JnL21haWxtYW4vbGlzdGluZm8veTIwMzgK

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17  8:58           ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17  8:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, Robert Richter,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> >> Would this work for everyone?
> >
> > Having extra config switches which are selectable by architectures and
> > removed when everything is converted is definitely the right way to go.
> >
> > That allows you to gradually convert stuff w/o inflicting wreckage all over
> > the place.
> 
> The CONFIG_64BIT_TIME would do that nicely for the new stuff like
> the conditional definition of __kernel_timespec, this one would get
> removed after we convert all architectures.
> 
> A second issue is how to control the compilation of the compat syscalls.
> CONFIG_COMPAT_32BIT_TIME handles that and could be defined
> in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
> this is then just a more readable way of expressing exactly when the
> functions should be built.
> 
> For completeness, there may be a third category, depending on how
> we handle things like sys_nanosleep(): Here, we want the native
> sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
> to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
> but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
> architectures any more, as new glibc should call clock_nanosleep()
> with a new syscall number instead. Should we then enclose

Isn't that going to break existing userspace?

Thanks

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17  8:58           ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17  8:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> >> Would this work for everyone?
> >
> > Having extra config switches which are selectable by architectures and
> > removed when everything is converted is definitely the right way to go.
> >
> > That allows you to gradually convert stuff w/o inflicting wreckage all over
> > the place.
> 
> The CONFIG_64BIT_TIME would do that nicely for the new stuff like
> the conditional definition of __kernel_timespec, this one would get
> removed after we convert all architectures.
> 
> A second issue is how to control the compilation of the compat syscalls.
> CONFIG_COMPAT_32BIT_TIME handles that and could be defined
> in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
> this is then just a more readable way of expressing exactly when the
> functions should be built.
> 
> For completeness, there may be a third category, depending on how
> we handle things like sys_nanosleep(): Here, we want the native
> sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
> to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
> but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
> architectures any more, as new glibc should call clock_nanosleep()
> with a new syscall number instead. Should we then enclose

Isn't that going to break existing userspace?

Thanks

	tglx
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17  8:58           ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17  8:58 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> >> Would this work for everyone?
> >
> > Having extra config switches which are selectable by architectures and
> > removed when everything is converted is definitely the right way to go.
> >
> > That allows you to gradually convert stuff w/o inflicting wreckage all over
> > the place.
> 
> The CONFIG_64BIT_TIME would do that nicely for the new stuff like
> the conditional definition of __kernel_timespec, this one would get
> removed after we convert all architectures.
> 
> A second issue is how to control the compilation of the compat syscalls.
> CONFIG_COMPAT_32BIT_TIME handles that and could be defined
> in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
> this is then just a more readable way of expressing exactly when the
> functions should be built.
> 
> For completeness, there may be a third category, depending on how
> we handle things like sys_nanosleep(): Here, we want the native
> sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
> to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
> but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
> architectures any more, as new glibc should call clock_nanosleep()
> with a new syscall number instead. Should we then enclose

Isn't that going to break existing userspace?

Thanks

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-17  8:58           ` Thomas Gleixner
  (?)
  (?)
@ 2017-11-17  9:31             ` Arnd Bergmann
  -1 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17  9:31 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

T24gRnJpLCBOb3YgMTcsIDIwMTcgYXQgOTo1OCBBTSwgVGhvbWFzIEdsZWl4bmVyIDx0Z2x4QGxp
bnV0cm9uaXguZGU+IHdyb3RlOgo+IE9uIEZyaSwgMTcgTm92IDIwMTcsIEFybmQgQmVyZ21hbm4g
d3JvdGU6Cj4+IE9uIFRodSwgTm92IDE2LCAyMDE3IGF0IDEwOjA0IEFNLCBUaG9tYXMgR2xlaXhu
ZXIgPHRnbHhAbGludXRyb25peC5kZT4gd3JvdGU6Cj4+ID4gT24gV2VkLCAxNSBOb3YgMjAxNywg
RGVlcGEgRGluYW1hbmkgd3JvdGU6Cj4+ID4+IFdvdWxkIHRoaXMgd29yayBmb3IgZXZlcnlvbmU/
Cj4+ID4KPj4gPiBIYXZpbmcgZXh0cmEgY29uZmlnIHN3aXRjaGVzIHdoaWNoIGFyZSBzZWxlY3Rh
YmxlIGJ5IGFyY2hpdGVjdHVyZXMgYW5kCj4+ID4gcmVtb3ZlZCB3aGVuIGV2ZXJ5dGhpbmcgaXMg
Y29udmVydGVkIGlzIGRlZmluaXRlbHkgdGhlIHJpZ2h0IHdheSB0byBnby4KPj4gPgo+PiA+IFRo
YXQgYWxsb3dzIHlvdSB0byBncmFkdWFsbHkgY29udmVydCBzdHVmZiB3L28gaW5mbGljdGluZyB3
cmVja2FnZSBhbGwgb3Zlcgo+PiA+IHRoZSBwbGFjZS4KPj4KPj4gVGhlIENPTkZJR182NEJJVF9U
SU1FIHdvdWxkIGRvIHRoYXQgbmljZWx5IGZvciB0aGUgbmV3IHN0dWZmIGxpa2UKPj4gdGhlIGNv
bmRpdGlvbmFsIGRlZmluaXRpb24gb2YgX19rZXJuZWxfdGltZXNwZWMsIHRoaXMgb25lIHdvdWxk
IGdldAo+PiByZW1vdmVkIGFmdGVyIHdlIGNvbnZlcnQgYWxsIGFyY2hpdGVjdHVyZXMuCj4+Cj4+
IEEgc2Vjb25kIGlzc3VlIGlzIGhvdyB0byBjb250cm9sIHRoZSBjb21waWxhdGlvbiBvZiB0aGUg
Y29tcGF0IHN5c2NhbGxzLgo+PiBDT05GSUdfQ09NUEFUXzMyQklUX1RJTUUgaGFuZGxlcyB0aGF0
IGFuZCBjb3VsZCBiZSBkZWZpbmVkCj4+IGluIEtjb25maWcgYXMgJ2RlZl9ib29sICghNjRCSVQg
JiYgQ09ORklHXzY0QklUX1RJTUUpIHx8IENPTVBBVCcsCj4+IHRoaXMgaXMgdGhlbiBqdXN0IGEg
bW9yZSByZWFkYWJsZSB3YXkgb2YgZXhwcmVzc2luZyBleGFjdGx5IHdoZW4gdGhlCj4+IGZ1bmN0
aW9ucyBzaG91bGQgYmUgYnVpbHQuCj4+Cj4+IEZvciBjb21wbGV0ZW5lc3MsIHRoZXJlIG1heSBi
ZSBhIHRoaXJkIGNhdGVnb3J5LCBkZXBlbmRpbmcgb24gaG93Cj4+IHdlIGhhbmRsZSB0aGluZ3Mg
bGlrZSBzeXNfbmFub3NsZWVwKCk6IEhlcmUsIHdlIHdhbnQgdGhlIG5hdGl2ZQo+PiBzeXNfbmFu
b3NsZWVwIG9uIDY0LWJpdCBhcmNoaXRlY3R1cmVzLCBhbmQgY29tcGF0X3N5c19uYW5vc2xlZXAo
KQo+PiB0byBoYW5kbGUgdGhlIDMyLWJpdCB0aW1lX3QgdmFyaWFudCBvbiBib3RoIDMyLWJpdCBh
bmQgNjQtYml0IHRhcmdldHMsCj4+IGJ1dCBvdXIgcGxhbiBpcyB0byBub3QgaGF2ZSBhIG5hdGl2
ZSAzMi1iaXQgc3lzX25hbm9zbGVlcCBvbiAzMi1iaXQKPj4gYXJjaGl0ZWN0dXJlcyBhbnkgbW9y
ZSwgYXMgbmV3IGdsaWJjIHNob3VsZCBjYWxsIGNsb2NrX25hbm9zbGVlcCgpCj4+IHdpdGggYSBu
ZXcgc3lzY2FsbCBudW1iZXIgaW5zdGVhZC4gU2hvdWxkIHdlIHRoZW4gZW5jbG9zZQo+Cj4gSXNu
J3QgdGhhdCBnb2luZyB0byBicmVhayBleGlzdGluZyB1c2Vyc3BhY2U/CgpObywgc3lzY2FsbCB0
aGF0IGV4aXN0aW5nIDMyLWJpdCB1c2VyIHNwYWNlIGVudGVycyB3b3VsZCBiZSBoYW5kbGVkIGJ5
CmNvbXBhdF9zeXNfbmFub3NsZWVwKCkgb24gYm90aCAzMi1iaXQgYW5kIDY0LWJpdCBrZXJuZWxz
IGF0IHRoYXQKcG9pbnQuIFRoZSBpZGVhIGhlcmUgaXMgdG8gbWFrZSB0aGUgY29kZSBwYXRoIG1v
cmUgdW5pZm9ybSBiZXR3ZWVuCjMyLWJpdCBhbmQgNjQtYml0IGtlcm5lbHMuCgogICAgICBBcm5k
Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fClkyMDM4IG1h
aWxpbmcgbGlzdApZMjAzOEBsaXN0cy5saW5hcm8ub3JnCmh0dHBzOi8vbGlzdHMubGluYXJvLm9y
Zy9tYWlsbWFuL2xpc3RpbmZvL3kyMDM4Cg==

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17  9:31             ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17  9:31 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, Robert Richter,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> > On Wed, 15 Nov 2017, Deepa Dinamani wrote:
>> >> Would this work for everyone?
>> >
>> > Having extra config switches which are selectable by architectures and
>> > removed when everything is converted is definitely the right way to go.
>> >
>> > That allows you to gradually convert stuff w/o inflicting wreckage all over
>> > the place.
>>
>> The CONFIG_64BIT_TIME would do that nicely for the new stuff like
>> the conditional definition of __kernel_timespec, this one would get
>> removed after we convert all architectures.
>>
>> A second issue is how to control the compilation of the compat syscalls.
>> CONFIG_COMPAT_32BIT_TIME handles that and could be defined
>> in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
>> this is then just a more readable way of expressing exactly when the
>> functions should be built.
>>
>> For completeness, there may be a third category, depending on how
>> we handle things like sys_nanosleep(): Here, we want the native
>> sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
>> to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
>> but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
>> architectures any more, as new glibc should call clock_nanosleep()
>> with a new syscall number instead. Should we then enclose
>
> Isn't that going to break existing userspace?

No, syscall that existing 32-bit user space enters would be handled by
compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
point. The idea here is to make the code path more uniform between
32-bit and 64-bit kernels.

      Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17  9:31             ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17  9:31 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> > On Wed, 15 Nov 2017, Deepa Dinamani wrote:
>> >> Would this work for everyone?
>> >
>> > Having extra config switches which are selectable by architectures and
>> > removed when everything is converted is definitely the right way to go.
>> >
>> > That allows you to gradually convert stuff w/o inflicting wreckage all over
>> > the place.
>>
>> The CONFIG_64BIT_TIME would do that nicely for the new stuff like
>> the conditional definition of __kernel_timespec, this one would get
>> removed after we convert all architectures.
>>
>> A second issue is how to control the compilation of the compat syscalls.
>> CONFIG_COMPAT_32BIT_TIME handles that and could be defined
>> in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
>> this is then just a more readable way of expressing exactly when the
>> functions should be built.
>>
>> For completeness, there may be a third category, depending on how
>> we handle things like sys_nanosleep(): Here, we want the native
>> sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
>> to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
>> but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
>> architectures any more, as new glibc should call clock_nanosleep()
>> with a new syscall number instead. Should we then enclose
>
> Isn't that going to break existing userspace?

No, syscall that existing 32-bit user space enters would be handled by
compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
point. The idea here is to make the code path more uniform between
32-bit and 64-bit kernels.

      Arnd
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17  9:31             ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17  9:31 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> > On Wed, 15 Nov 2017, Deepa Dinamani wrote:
>> >> Would this work for everyone?
>> >
>> > Having extra config switches which are selectable by architectures and
>> > removed when everything is converted is definitely the right way to go.
>> >
>> > That allows you to gradually convert stuff w/o inflicting wreckage all over
>> > the place.
>>
>> The CONFIG_64BIT_TIME would do that nicely for the new stuff like
>> the conditional definition of __kernel_timespec, this one would get
>> removed after we convert all architectures.
>>
>> A second issue is how to control the compilation of the compat syscalls.
>> CONFIG_COMPAT_32BIT_TIME handles that and could be defined
>> in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
>> this is then just a more readable way of expressing exactly when the
>> functions should be built.
>>
>> For completeness, there may be a third category, depending on how
>> we handle things like sys_nanosleep(): Here, we want the native
>> sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
>> to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
>> but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
>> architectures any more, as new glibc should call clock_nanosleep()
>> with a new syscall number instead. Should we then enclose
>
> Isn't that going to break existing userspace?

No, syscall that existing 32-bit user space enters would be handled by
compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
point. The idea here is to make the code path more uniform between
32-bit and 64-bit kernels.

      Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-17  9:31             ` Arnd Bergmann
  (?)
  (?)
@ 2017-11-17  9:54               ` Thomas Gleixner
  -1 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17  9:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

T24gRnJpLCAxNyBOb3YgMjAxNywgQXJuZCBCZXJnbWFubiB3cm90ZToKPiBPbiBGcmksIE5vdiAx
NywgMjAxNyBhdCA5OjU4IEFNLCBUaG9tYXMgR2xlaXhuZXIgPHRnbHhAbGludXRyb25peC5kZT4g
d3JvdGU6Cj4gPiBPbiBGcmksIDE3IE5vdiAyMDE3LCBBcm5kIEJlcmdtYW5uIHdyb3RlOgo+ID4+
IE9uIFRodSwgTm92IDE2LCAyMDE3IGF0IDEwOjA0IEFNLCBUaG9tYXMgR2xlaXhuZXIgPHRnbHhA
bGludXRyb25peC5kZT4gd3JvdGU6Cj4gPj4gPiBPbiBXZWQsIDE1IE5vdiAyMDE3LCBEZWVwYSBE
aW5hbWFuaSB3cm90ZToKPiA+PiA+PiBXb3VsZCB0aGlzIHdvcmsgZm9yIGV2ZXJ5b25lPwo+ID4+
ID4KPiA+PiA+IEhhdmluZyBleHRyYSBjb25maWcgc3dpdGNoZXMgd2hpY2ggYXJlIHNlbGVjdGFi
bGUgYnkgYXJjaGl0ZWN0dXJlcyBhbmQKPiA+PiA+IHJlbW92ZWQgd2hlbiBldmVyeXRoaW5nIGlz
IGNvbnZlcnRlZCBpcyBkZWZpbml0ZWx5IHRoZSByaWdodCB3YXkgdG8gZ28uCj4gPj4gPgo+ID4+
ID4gVGhhdCBhbGxvd3MgeW91IHRvIGdyYWR1YWxseSBjb252ZXJ0IHN0dWZmIHcvbyBpbmZsaWN0
aW5nIHdyZWNrYWdlIGFsbCBvdmVyCj4gPj4gPiB0aGUgcGxhY2UuCj4gPj4KPiA+PiBUaGUgQ09O
RklHXzY0QklUX1RJTUUgd291bGQgZG8gdGhhdCBuaWNlbHkgZm9yIHRoZSBuZXcgc3R1ZmYgbGlr
ZQo+ID4+IHRoZSBjb25kaXRpb25hbCBkZWZpbml0aW9uIG9mIF9fa2VybmVsX3RpbWVzcGVjLCB0
aGlzIG9uZSB3b3VsZCBnZXQKPiA+PiByZW1vdmVkIGFmdGVyIHdlIGNvbnZlcnQgYWxsIGFyY2hp
dGVjdHVyZXMuCj4gPj4KPiA+PiBBIHNlY29uZCBpc3N1ZSBpcyBob3cgdG8gY29udHJvbCB0aGUg
Y29tcGlsYXRpb24gb2YgdGhlIGNvbXBhdCBzeXNjYWxscy4KPiA+PiBDT05GSUdfQ09NUEFUXzMy
QklUX1RJTUUgaGFuZGxlcyB0aGF0IGFuZCBjb3VsZCBiZSBkZWZpbmVkCj4gPj4gaW4gS2NvbmZp
ZyBhcyAnZGVmX2Jvb2wgKCE2NEJJVCAmJiBDT05GSUdfNjRCSVRfVElNRSkgfHwgQ09NUEFUJywK
PiA+PiB0aGlzIGlzIHRoZW4ganVzdCBhIG1vcmUgcmVhZGFibGUgd2F5IG9mIGV4cHJlc3Npbmcg
ZXhhY3RseSB3aGVuIHRoZQo+ID4+IGZ1bmN0aW9ucyBzaG91bGQgYmUgYnVpbHQuCj4gPj4KPiA+
PiBGb3IgY29tcGxldGVuZXNzLCB0aGVyZSBtYXkgYmUgYSB0aGlyZCBjYXRlZ29yeSwgZGVwZW5k
aW5nIG9uIGhvdwo+ID4+IHdlIGhhbmRsZSB0aGluZ3MgbGlrZSBzeXNfbmFub3NsZWVwKCk6IEhl
cmUsIHdlIHdhbnQgdGhlIG5hdGl2ZQo+ID4+IHN5c19uYW5vc2xlZXAgb24gNjQtYml0IGFyY2hp
dGVjdHVyZXMsIGFuZCBjb21wYXRfc3lzX25hbm9zbGVlcCgpCj4gPj4gdG8gaGFuZGxlIHRoZSAz
Mi1iaXQgdGltZV90IHZhcmlhbnQgb24gYm90aCAzMi1iaXQgYW5kIDY0LWJpdCB0YXJnZXRzLAo+
ID4+IGJ1dCBvdXIgcGxhbiBpcyB0byBub3QgaGF2ZSBhIG5hdGl2ZSAzMi1iaXQgc3lzX25hbm9z
bGVlcCBvbiAzMi1iaXQKPiA+PiBhcmNoaXRlY3R1cmVzIGFueSBtb3JlLCBhcyBuZXcgZ2xpYmMg
c2hvdWxkIGNhbGwgY2xvY2tfbmFub3NsZWVwKCkKPiA+PiB3aXRoIGEgbmV3IHN5c2NhbGwgbnVt
YmVyIGluc3RlYWQuIFNob3VsZCB3ZSB0aGVuIGVuY2xvc2UKPiA+Cj4gPiBJc24ndCB0aGF0IGdv
aW5nIHRvIGJyZWFrIGV4aXN0aW5nIHVzZXJzcGFjZT8KPiAKPiBObywgc3lzY2FsbCB0aGF0IGV4
aXN0aW5nIDMyLWJpdCB1c2VyIHNwYWNlIGVudGVycyB3b3VsZCBiZSBoYW5kbGVkIGJ5Cj4gY29t
cGF0X3N5c19uYW5vc2xlZXAoKSBvbiBib3RoIDMyLWJpdCBhbmQgNjQtYml0IGtlcm5lbHMgYXQg
dGhhdAo+IHBvaW50LiBUaGUgaWRlYSBoZXJlIGlzIHRvIG1ha2UgdGhlIGNvZGUgcGF0aCBtb3Jl
IHVuaWZvcm0gYmV0d2Vlbgo+IDMyLWJpdCBhbmQgNjQtYml0IGtlcm5lbHMuCgpTbyBvbiBhIDMy
Yml0IHN5c3RlbSBjb21wYXRfc3lzX25hbm9zbGVlcCgpIHdvdWxkIGJlIHRoZSBsZWdhY3kKc3lz
X25hbm9zbGVlcCgpIHdpdGggdGhlIGV4aXN0aW5nIHN5c2NhbGwgbnVtYmVyLCBidXQgeW91IGRv
bid0IHdhbnQgdG8KaW50cm9kdWNlIGEgbmV3IHN5c19uYW5vc2xlZXA2NCgpIGZvciAzMmJpdC4g
VGhhdCBtYWtlcyBhIGxvdCBvZiBzZW5zZS4KClNvIGJhY2sgdG8geW91ciBvcmlnaW5hbCBxdWVz
dGlvbiB3aGV0aGVyIHRvIHVzZSAjaWYgKE1BR0lDIGxvZ2ljKSBvciBhCnNlcGFyYXRlIGNvbmZp
ZyBzeW1ib2wuIFBsZWFzZSB1c2UgdGhlIGxhdHRlciwgdGhlc2UgbWFnaWMgbG9naWMgY29uc3Ry
dWN0cwphcmUgaGFyZGVyIHRvIHJlYWQgYW5kIHByb25lIHRvIGdldCB3cm9uZyBhdCBzb21lIHBv
aW50LiBIYXZpbmcgdGhlCmRlY2lzaW9uIGxvZ2ljIGluIG9uZSBwbGFjZSBpcyBhbHdheXMgdGhl
IHJpZ2h0IHRoaW5nIHRvIGRvLgoKVGhhbmtzLAoKCXRnbHgKX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX18KWTIwMzggbWFpbGluZyBsaXN0ClkyMDM4QGxpc3Rz
LmxpbmFyby5vcmcKaHR0cHM6Ly9saXN0cy5saW5hcm8ub3JnL21haWxtYW4vbGlzdGluZm8veTIw
MzgK

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17  9:54               ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17  9:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, Robert Richter,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> >> On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >> > On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> >> >> Would this work for everyone?
> >> >
> >> > Having extra config switches which are selectable by architectures and
> >> > removed when everything is converted is definitely the right way to go.
> >> >
> >> > That allows you to gradually convert stuff w/o inflicting wreckage all over
> >> > the place.
> >>
> >> The CONFIG_64BIT_TIME would do that nicely for the new stuff like
> >> the conditional definition of __kernel_timespec, this one would get
> >> removed after we convert all architectures.
> >>
> >> A second issue is how to control the compilation of the compat syscalls.
> >> CONFIG_COMPAT_32BIT_TIME handles that and could be defined
> >> in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
> >> this is then just a more readable way of expressing exactly when the
> >> functions should be built.
> >>
> >> For completeness, there may be a third category, depending on how
> >> we handle things like sys_nanosleep(): Here, we want the native
> >> sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
> >> to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
> >> but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
> >> architectures any more, as new glibc should call clock_nanosleep()
> >> with a new syscall number instead. Should we then enclose
> >
> > Isn't that going to break existing userspace?
> 
> No, syscall that existing 32-bit user space enters would be handled by
> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
> point. The idea here is to make the code path more uniform between
> 32-bit and 64-bit kernels.

So on a 32bit system compat_sys_nanosleep() would be the legacy
sys_nanosleep() with the existing syscall number, but you don't want to
introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.

So back to your original question whether to use #if (MAGIC logic) or a
separate config symbol. Please use the latter, these magic logic constructs
are harder to read and prone to get wrong at some point. Having the
decision logic in one place is always the right thing to do.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17  9:54               ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17  9:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> >> On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >> > On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> >> >> Would this work for everyone?
> >> >
> >> > Having extra config switches which are selectable by architectures and
> >> > removed when everything is converted is definitely the right way to go.
> >> >
> >> > That allows you to gradually convert stuff w/o inflicting wreckage all over
> >> > the place.
> >>
> >> The CONFIG_64BIT_TIME would do that nicely for the new stuff like
> >> the conditional definition of __kernel_timespec, this one would get
> >> removed after we convert all architectures.
> >>
> >> A second issue is how to control the compilation of the compat syscalls.
> >> CONFIG_COMPAT_32BIT_TIME handles that and could be defined
> >> in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
> >> this is then just a more readable way of expressing exactly when the
> >> functions should be built.
> >>
> >> For completeness, there may be a third category, depending on how
> >> we handle things like sys_nanosleep(): Here, we want the native
> >> sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
> >> to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
> >> but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
> >> architectures any more, as new glibc should call clock_nanosleep()
> >> with a new syscall number instead. Should we then enclose
> >
> > Isn't that going to break existing userspace?
> 
> No, syscall that existing 32-bit user space enters would be handled by
> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
> point. The idea here is to make the code path more uniform between
> 32-bit and 64-bit kernels.

So on a 32bit system compat_sys_nanosleep() would be the legacy
sys_nanosleep() with the existing syscall number, but you don't want to
introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.

So back to your original question whether to use #if (MAGIC logic) or a
separate config symbol. Please use the latter, these magic logic constructs
are harder to read and prone to get wrong at some point. Having the
decision logic in one place is always the right thing to do.

Thanks,

	tglx
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17  9:54               ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17  9:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> >> On Thu, Nov 16, 2017 at 10:04 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >> > On Wed, 15 Nov 2017, Deepa Dinamani wrote:
> >> >> Would this work for everyone?
> >> >
> >> > Having extra config switches which are selectable by architectures and
> >> > removed when everything is converted is definitely the right way to go.
> >> >
> >> > That allows you to gradually convert stuff w/o inflicting wreckage all over
> >> > the place.
> >>
> >> The CONFIG_64BIT_TIME would do that nicely for the new stuff like
> >> the conditional definition of __kernel_timespec, this one would get
> >> removed after we convert all architectures.
> >>
> >> A second issue is how to control the compilation of the compat syscalls.
> >> CONFIG_COMPAT_32BIT_TIME handles that and could be defined
> >> in Kconfig as 'def_bool (!64BIT && CONFIG_64BIT_TIME) || COMPAT',
> >> this is then just a more readable way of expressing exactly when the
> >> functions should be built.
> >>
> >> For completeness, there may be a third category, depending on how
> >> we handle things like sys_nanosleep(): Here, we want the native
> >> sys_nanosleep on 64-bit architectures, and compat_sys_nanosleep()
> >> to handle the 32-bit time_t variant on both 32-bit and 64-bit targets,
> >> but our plan is to not have a native 32-bit sys_nanosleep on 32-bit
> >> architectures any more, as new glibc should call clock_nanosleep()
> >> with a new syscall number instead. Should we then enclose
> >
> > Isn't that going to break existing userspace?
> 
> No, syscall that existing 32-bit user space enters would be handled by
> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
> point. The idea here is to make the code path more uniform between
> 32-bit and 64-bit kernels.

So on a 32bit system compat_sys_nanosleep() would be the legacy
sys_nanosleep() with the existing syscall number, but you don't want to
introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.

So back to your original question whether to use #if (MAGIC logic) or a
separate config symbol. Please use the latter, these magic logic constructs
are harder to read and prone to get wrong at some point. Having the
decision logic in one place is always the right thing to do.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-17  9:54               ` Thomas Gleixner
  (?)
  (?)
@ 2017-11-17 10:30                 ` Arnd Bergmann
  -1 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17 10:30 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian

On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>>
>> No, syscall that existing 32-bit user space enters would be handled by
>> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
>> point. The idea here is to make the code path more uniform between
>> 32-bit and 64-bit kernels.
>
> So on a 32bit system compat_sys_nanosleep() would be the legacy
> sys_nanosleep() with the existing syscall number, but you don't want to
> introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
>
> So back to your original question whether to use #if (MAGIC logic) or a
> separate config symbol. Please use the latter, these magic logic constructs
> are harder to read and prone to get wrong at some point. Having the
> decision logic in one place is always the right thing to do.

How about this:

config LEGACY_TIME_SYSCALLS
      def_bool 64BIT || !64BIT_TIME
      help
        This controls the compilation of the following system calls:
time, stime,
        gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
        setitimer, select, utime, utimes, futimesat, and
{old,new}{l,f,}stat{,64}.
        These all pass 32-bit time_t arguments on 32-bit architectures and
        are replaced by other interfaces (e.g. posix timers and clocks, statx).
        C libraries implementing 64-bit time_t in 32-bit architectures have to
        implement the handles by wrapping around the newer interfaces.
        New architectures should not explicitly disable this.

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17 10:30                 ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17 10:30 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, Robert Richter,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>>
>> No, syscall that existing 32-bit user space enters would be handled by
>> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
>> point. The idea here is to make the code path more uniform between
>> 32-bit and 64-bit kernels.
>
> So on a 32bit system compat_sys_nanosleep() would be the legacy
> sys_nanosleep() with the existing syscall number, but you don't want to
> introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
>
> So back to your original question whether to use #if (MAGIC logic) or a
> separate config symbol. Please use the latter, these magic logic constructs
> are harder to read and prone to get wrong at some point. Having the
> decision logic in one place is always the right thing to do.

How about this:

config LEGACY_TIME_SYSCALLS
      def_bool 64BIT || !64BIT_TIME
      help
        This controls the compilation of the following system calls:
time, stime,
        gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
        setitimer, select, utime, utimes, futimesat, and
{old,new}{l,f,}stat{,64}.
        These all pass 32-bit time_t arguments on 32-bit architectures and
        are replaced by other interfaces (e.g. posix timers and clocks, statx).
        C libraries implementing 64-bit time_t in 32-bit architectures have to
        implement the handles by wrapping around the newer interfaces.
        New architectures should not explicitly disable this.

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17 10:30                 ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17 10:30 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian

On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>>
>> No, syscall that existing 32-bit user space enters would be handled by
>> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
>> point. The idea here is to make the code path more uniform between
>> 32-bit and 64-bit kernels.
>
> So on a 32bit system compat_sys_nanosleep() would be the legacy
> sys_nanosleep() with the existing syscall number, but you don't want to
> introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
>
> So back to your original question whether to use #if (MAGIC logic) or a
> separate config symbol. Please use the latter, these magic logic constructs
> are harder to read and prone to get wrong at some point. Having the
> decision logic in one place is always the right thing to do.

How about this:

config LEGACY_TIME_SYSCALLS
      def_bool 64BIT || !64BIT_TIME
      help
        This controls the compilation of the following system calls:
time, stime,
        gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
        setitimer, select, utime, utimes, futimesat, and
{old,new}{l,f,}stat{,64}.
        These all pass 32-bit time_t arguments on 32-bit architectures and
        are replaced by other interfaces (e.g. posix timers and clocks, statx).
        C libraries implementing 64-bit time_t in 32-bit architectures have to
        implement the handles by wrapping around the newer interfaces.
        New architectures should not explicitly disable this.

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17 10:30                 ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17 10:30 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian

On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>>
>> No, syscall that existing 32-bit user space enters would be handled by
>> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
>> point. The idea here is to make the code path more uniform between
>> 32-bit and 64-bit kernels.
>
> So on a 32bit system compat_sys_nanosleep() would be the legacy
> sys_nanosleep() with the existing syscall number, but you don't want to
> introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
>
> So back to your original question whether to use #if (MAGIC logic) or a
> separate config symbol. Please use the latter, these magic logic constructs
> are harder to read and prone to get wrong at some point. Having the
> decision logic in one place is always the right thing to do.

How about this:

config LEGACY_TIME_SYSCALLS
      def_bool 64BIT || !64BIT_TIME
      help
        This controls the compilation of the following system calls:
time, stime,
        gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
        setitimer, select, utime, utimes, futimesat, and
{old,new}{l,f,}stat{,64}.
        These all pass 32-bit time_t arguments on 32-bit architectures and
        are replaced by other interfaces (e.g. posix timers and clocks, statx).
        C libraries implementing 64-bit time_t in 32-bit architectures have to
        implement the handles by wrapping around the newer interfaces.
        New architectures should not explicitly disable this.

       Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-17 10:30                 ` Arnd Bergmann
  (?)
  (?)
@ 2017-11-17 10:40                   ` Thomas Gleixner
  -1 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17 10:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

T24gRnJpLCAxNyBOb3YgMjAxNywgQXJuZCBCZXJnbWFubiB3cm90ZToKPiBPbiBGcmksIE5vdiAx
NywgMjAxNyBhdCAxMDo1NCBBTSwgVGhvbWFzIEdsZWl4bmVyIDx0Z2x4QGxpbnV0cm9uaXguZGU+
IHdyb3RlOgo+ID4gT24gRnJpLCAxNyBOb3YgMjAxNywgQXJuZCBCZXJnbWFubiB3cm90ZToKPiA+
PiBPbiBGcmksIE5vdiAxNywgMjAxNyBhdCA5OjU4IEFNLCBUaG9tYXMgR2xlaXhuZXIgPHRnbHhA
bGludXRyb25peC5kZT4gd3JvdGU6Cj4gPj4KPiA+PiBObywgc3lzY2FsbCB0aGF0IGV4aXN0aW5n
IDMyLWJpdCB1c2VyIHNwYWNlIGVudGVycyB3b3VsZCBiZSBoYW5kbGVkIGJ5Cj4gPj4gY29tcGF0
X3N5c19uYW5vc2xlZXAoKSBvbiBib3RoIDMyLWJpdCBhbmQgNjQtYml0IGtlcm5lbHMgYXQgdGhh
dAo+ID4+IHBvaW50LiBUaGUgaWRlYSBoZXJlIGlzIHRvIG1ha2UgdGhlIGNvZGUgcGF0aCBtb3Jl
IHVuaWZvcm0gYmV0d2Vlbgo+ID4+IDMyLWJpdCBhbmQgNjQtYml0IGtlcm5lbHMuCj4gPgo+ID4g
U28gb24gYSAzMmJpdCBzeXN0ZW0gY29tcGF0X3N5c19uYW5vc2xlZXAoKSB3b3VsZCBiZSB0aGUg
bGVnYWN5Cj4gPiBzeXNfbmFub3NsZWVwKCkgd2l0aCB0aGUgZXhpc3Rpbmcgc3lzY2FsbCBudW1i
ZXIsIGJ1dCB5b3UgZG9uJ3Qgd2FudCB0bwo+ID4gaW50cm9kdWNlIGEgbmV3IHN5c19uYW5vc2xl
ZXA2NCgpIGZvciAzMmJpdC4gVGhhdCBtYWtlcyBhIGxvdCBvZiBzZW5zZS4KPiA+Cj4gPiBTbyBi
YWNrIHRvIHlvdXIgb3JpZ2luYWwgcXVlc3Rpb24gd2hldGhlciB0byB1c2UgI2lmIChNQUdJQyBs
b2dpYykgb3IgYQo+ID4gc2VwYXJhdGUgY29uZmlnIHN5bWJvbC4gUGxlYXNlIHVzZSB0aGUgbGF0
dGVyLCB0aGVzZSBtYWdpYyBsb2dpYyBjb25zdHJ1Y3RzCj4gPiBhcmUgaGFyZGVyIHRvIHJlYWQg
YW5kIHByb25lIHRvIGdldCB3cm9uZyBhdCBzb21lIHBvaW50LiBIYXZpbmcgdGhlCj4gPiBkZWNp
c2lvbiBsb2dpYyBpbiBvbmUgcGxhY2UgaXMgYWx3YXlzIHRoZSByaWdodCB0aGluZyB0byBkby4K
PiAKPiBIb3cgYWJvdXQgdGhpczoKPiAKPiBjb25maWcgTEVHQUNZX1RJTUVfU1lTQ0FMTFMKPiAg
ICAgICBkZWZfYm9vbCA2NEJJVCB8fCAhNjRCSVRfVElNRQo+ICAgICAgIGhlbHAKPiAgICAgICAg
IFRoaXMgY29udHJvbHMgdGhlIGNvbXBpbGF0aW9uIG9mIHRoZSBmb2xsb3dpbmcgc3lzdGVtIGNh
bGxzOgo+IHRpbWUsIHN0aW1lLAo+ICAgICAgICAgZ2V0dGltZW9mZGF5LCBzZXR0aW1lb2ZkYXks
IGFkanRpbWV4LCBuYW5vc2xlZXAsIGFsYXJtLCBnZXRpdGltZXIsCj4gICAgICAgICBzZXRpdGlt
ZXIsIHNlbGVjdCwgdXRpbWUsIHV0aW1lcywgZnV0aW1lc2F0LCBhbmQKPiB7b2xkLG5ld317bCxm
LH1zdGF0eyw2NH0uCj4gICAgICAgICBUaGVzZSBhbGwgcGFzcyAzMi1iaXQgdGltZV90IGFyZ3Vt
ZW50cyBvbiAzMi1iaXQgYXJjaGl0ZWN0dXJlcyBhbmQKPiAgICAgICAgIGFyZSByZXBsYWNlZCBi
eSBvdGhlciBpbnRlcmZhY2VzIChlLmcuIHBvc2l4IHRpbWVycyBhbmQgY2xvY2tzLCBzdGF0eCku
Cj4gICAgICAgICBDIGxpYnJhcmllcyBpbXBsZW1lbnRpbmcgNjQtYml0IHRpbWVfdCBpbiAzMi1i
aXQgYXJjaGl0ZWN0dXJlcyBoYXZlIHRvCj4gICAgICAgICBpbXBsZW1lbnQgdGhlIGhhbmRsZXMg
Ynkgd3JhcHBpbmcgYXJvdW5kIHRoZSBuZXdlciBpbnRlcmZhY2VzLgoKcy9oYW5kbGVzL2hhbmRs
aW5nLyA/Pz8/Cgo+ICAgICAgICAgTmV3IGFyY2hpdGVjdHVyZXMgc2hvdWxkIG5vdCBleHBsaWNp
dGx5IGRpc2FibGUgdGhpcy4KCk5ldyBhcmNoaXRlY3R1cmVzIHNob3VsZCBuZXZlciBlbmFibGUg
dGhpcywgcmlnaHQ/CgpUaGFua3MsCgoJdGdseApfX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fXwpZMjAzOCBtYWlsaW5nIGxpc3QKWTIwMzhAbGlzdHMubGluYXJv
Lm9yZwpodHRwczovL2xpc3RzLmxpbmFyby5vcmcvbWFpbG1hbi9saXN0aW5mby95MjAzOAo=

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17 10:40                   ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17 10:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, Robert Richter,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> >> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >>
> >> No, syscall that existing 32-bit user space enters would be handled by
> >> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
> >> point. The idea here is to make the code path more uniform between
> >> 32-bit and 64-bit kernels.
> >
> > So on a 32bit system compat_sys_nanosleep() would be the legacy
> > sys_nanosleep() with the existing syscall number, but you don't want to
> > introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
> >
> > So back to your original question whether to use #if (MAGIC logic) or a
> > separate config symbol. Please use the latter, these magic logic constructs
> > are harder to read and prone to get wrong at some point. Having the
> > decision logic in one place is always the right thing to do.
> 
> How about this:
> 
> config LEGACY_TIME_SYSCALLS
>       def_bool 64BIT || !64BIT_TIME
>       help
>         This controls the compilation of the following system calls:
> time, stime,
>         gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
>         setitimer, select, utime, utimes, futimesat, and
> {old,new}{l,f,}stat{,64}.
>         These all pass 32-bit time_t arguments on 32-bit architectures and
>         are replaced by other interfaces (e.g. posix timers and clocks, statx).
>         C libraries implementing 64-bit time_t in 32-bit architectures have to
>         implement the handles by wrapping around the newer interfaces.

s/handles/handling/ ????

>         New architectures should not explicitly disable this.

New architectures should never enable this, right?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17 10:40                   ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17 10:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> >> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >>
> >> No, syscall that existing 32-bit user space enters would be handled by
> >> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
> >> point. The idea here is to make the code path more uniform between
> >> 32-bit and 64-bit kernels.
> >
> > So on a 32bit system compat_sys_nanosleep() would be the legacy
> > sys_nanosleep() with the existing syscall number, but you don't want to
> > introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
> >
> > So back to your original question whether to use #if (MAGIC logic) or a
> > separate config symbol. Please use the latter, these magic logic constructs
> > are harder to read and prone to get wrong at some point. Having the
> > decision logic in one place is always the right thing to do.
> 
> How about this:
> 
> config LEGACY_TIME_SYSCALLS
>       def_bool 64BIT || !64BIT_TIME
>       help
>         This controls the compilation of the following system calls:
> time, stime,
>         gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
>         setitimer, select, utime, utimes, futimesat, and
> {old,new}{l,f,}stat{,64}.
>         These all pass 32-bit time_t arguments on 32-bit architectures and
>         are replaced by other interfaces (e.g. posix timers and clocks, statx).
>         C libraries implementing 64-bit time_t in 32-bit architectures have to
>         implement the handles by wrapping around the newer interfaces.

s/handles/handling/ ????

>         New architectures should not explicitly disable this.

New architectures should never enable this, right?

Thanks,

	tglx
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17 10:40                   ` Thomas Gleixner
  0 siblings, 0 replies; 68+ messages in thread
From: Thomas Gleixner @ 2017-11-17 10:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> > On Fri, 17 Nov 2017, Arnd Bergmann wrote:
> >> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> >>
> >> No, syscall that existing 32-bit user space enters would be handled by
> >> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
> >> point. The idea here is to make the code path more uniform between
> >> 32-bit and 64-bit kernels.
> >
> > So on a 32bit system compat_sys_nanosleep() would be the legacy
> > sys_nanosleep() with the existing syscall number, but you don't want to
> > introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
> >
> > So back to your original question whether to use #if (MAGIC logic) or a
> > separate config symbol. Please use the latter, these magic logic constructs
> > are harder to read and prone to get wrong at some point. Having the
> > decision logic in one place is always the right thing to do.
> 
> How about this:
> 
> config LEGACY_TIME_SYSCALLS
>       def_bool 64BIT || !64BIT_TIME
>       help
>         This controls the compilation of the following system calls:
> time, stime,
>         gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
>         setitimer, select, utime, utimes, futimesat, and
> {old,new}{l,f,}stat{,64}.
>         These all pass 32-bit time_t arguments on 32-bit architectures and
>         are replaced by other interfaces (e.g. posix timers and clocks, statx).
>         C libraries implementing 64-bit time_t in 32-bit architectures have to
>         implement the handles by wrapping around the newer interfaces.

s/handles/handling/ ????

>         New architectures should not explicitly disable this.

New architectures should never enable this, right?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
  2017-11-17 10:40                   ` Thomas Gleixner
  (?)
  (?)
@ 2017-11-17 10:46                     ` Arnd Bergmann
  -1 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17 10:46 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

T24gRnJpLCBOb3YgMTcsIDIwMTcgYXQgMTE6NDAgQU0sIFRob21hcyBHbGVpeG5lciA8dGdseEBs
aW51dHJvbml4LmRlPiB3cm90ZToKPiBPbiBGcmksIDE3IE5vdiAyMDE3LCBBcm5kIEJlcmdtYW5u
IHdyb3RlOgo+PiBPbiBGcmksIE5vdiAxNywgMjAxNyBhdCAxMDo1NCBBTSwgVGhvbWFzIEdsZWl4
bmVyIDx0Z2x4QGxpbnV0cm9uaXguZGU+IHdyb3RlOgo+PiA+IE9uIEZyaSwgMTcgTm92IDIwMTcs
IEFybmQgQmVyZ21hbm4gd3JvdGU6Cj4+ID4+IE9uIEZyaSwgTm92IDE3LCAyMDE3IGF0IDk6NTgg
QU0sIFRob21hcyBHbGVpeG5lciA8dGdseEBsaW51dHJvbml4LmRlPiB3cm90ZToKPj4gPj4KPj4g
Pj4gTm8sIHN5c2NhbGwgdGhhdCBleGlzdGluZyAzMi1iaXQgdXNlciBzcGFjZSBlbnRlcnMgd291
bGQgYmUgaGFuZGxlZCBieQo+PiA+PiBjb21wYXRfc3lzX25hbm9zbGVlcCgpIG9uIGJvdGggMzIt
Yml0IGFuZCA2NC1iaXQga2VybmVscyBhdCB0aGF0Cj4+ID4+IHBvaW50LiBUaGUgaWRlYSBoZXJl
IGlzIHRvIG1ha2UgdGhlIGNvZGUgcGF0aCBtb3JlIHVuaWZvcm0gYmV0d2Vlbgo+PiA+PiAzMi1i
aXQgYW5kIDY0LWJpdCBrZXJuZWxzLgo+PiA+Cj4+ID4gU28gb24gYSAzMmJpdCBzeXN0ZW0gY29t
cGF0X3N5c19uYW5vc2xlZXAoKSB3b3VsZCBiZSB0aGUgbGVnYWN5Cj4+ID4gc3lzX25hbm9zbGVl
cCgpIHdpdGggdGhlIGV4aXN0aW5nIHN5c2NhbGwgbnVtYmVyLCBidXQgeW91IGRvbid0IHdhbnQg
dG8KPj4gPiBpbnRyb2R1Y2UgYSBuZXcgc3lzX25hbm9zbGVlcDY0KCkgZm9yIDMyYml0LiBUaGF0
IG1ha2VzIGEgbG90IG9mIHNlbnNlLgo+PiA+Cj4+ID4gU28gYmFjayB0byB5b3VyIG9yaWdpbmFs
IHF1ZXN0aW9uIHdoZXRoZXIgdG8gdXNlICNpZiAoTUFHSUMgbG9naWMpIG9yIGEKPj4gPiBzZXBh
cmF0ZSBjb25maWcgc3ltYm9sLiBQbGVhc2UgdXNlIHRoZSBsYXR0ZXIsIHRoZXNlIG1hZ2ljIGxv
Z2ljIGNvbnN0cnVjdHMKPj4gPiBhcmUgaGFyZGVyIHRvIHJlYWQgYW5kIHByb25lIHRvIGdldCB3
cm9uZyBhdCBzb21lIHBvaW50LiBIYXZpbmcgdGhlCj4+ID4gZGVjaXNpb24gbG9naWMgaW4gb25l
IHBsYWNlIGlzIGFsd2F5cyB0aGUgcmlnaHQgdGhpbmcgdG8gZG8uCj4+Cj4+IEhvdyBhYm91dCB0
aGlzOgo+Pgo+PiBjb25maWcgTEVHQUNZX1RJTUVfU1lTQ0FMTFMKPj4gICAgICAgZGVmX2Jvb2wg
NjRCSVQgfHwgITY0QklUX1RJTUUKPj4gICAgICAgaGVscAo+PiAgICAgICAgIFRoaXMgY29udHJv
bHMgdGhlIGNvbXBpbGF0aW9uIG9mIHRoZSBmb2xsb3dpbmcgc3lzdGVtIGNhbGxzOgo+PiB0aW1l
LCBzdGltZSwKPj4gICAgICAgICBnZXR0aW1lb2ZkYXksIHNldHRpbWVvZmRheSwgYWRqdGltZXgs
IG5hbm9zbGVlcCwgYWxhcm0sIGdldGl0aW1lciwKPj4gICAgICAgICBzZXRpdGltZXIsIHNlbGVj
dCwgdXRpbWUsIHV0aW1lcywgZnV0aW1lc2F0LCBhbmQKPj4ge29sZCxuZXd9e2wsZix9c3RhdHss
NjR9Lgo+PiAgICAgICAgIFRoZXNlIGFsbCBwYXNzIDMyLWJpdCB0aW1lX3QgYXJndW1lbnRzIG9u
IDMyLWJpdCBhcmNoaXRlY3R1cmVzIGFuZAo+PiAgICAgICAgIGFyZSByZXBsYWNlZCBieSBvdGhl
ciBpbnRlcmZhY2VzIChlLmcuIHBvc2l4IHRpbWVycyBhbmQgY2xvY2tzLCBzdGF0eCkuCj4+ICAg
ICAgICAgQyBsaWJyYXJpZXMgaW1wbGVtZW50aW5nIDY0LWJpdCB0aW1lX3QgaW4gMzItYml0IGFy
Y2hpdGVjdHVyZXMgaGF2ZSB0bwo+PiAgICAgICAgIGltcGxlbWVudCB0aGUgaGFuZGxlcyBieSB3
cmFwcGluZyBhcm91bmQgdGhlIG5ld2VyIGludGVyZmFjZXMuCj4KPiBzL2hhbmRsZXMvaGFuZGxp
bmcvID8/Pz8KCkkgbWVhbnQgImhhbmRsZXJzIi4KCj4+ICAgICAgICAgTmV3IGFyY2hpdGVjdHVy
ZXMgc2hvdWxkIG5vdCBleHBsaWNpdGx5IGRpc2FibGUgdGhpcy4KPgo+IE5ldyBhcmNoaXRlY3R1
cmVzIHNob3VsZCBuZXZlciBlbmFibGUgdGhpcywgcmlnaHQ/CgpSaWdodCwgSSBnb3QgYW4gZXh0
cmEgIm5vdCIuIEkgZ3Vlc3MgaWYgRGVlcGEgaW5jb3Jwb3JhdGVzIHRoZSBuZXcgb3B0aW9uLApz
aGUgY2FuIGFsc28gaW1wcm92ZSBteSBFbmdsaXNoIDstKQoKICAgICAgICAgQXJuZApfX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpZMjAzOCBtYWlsaW5nIGxp
c3QKWTIwMzhAbGlzdHMubGluYXJvLm9yZwpodHRwczovL2xpc3RzLmxpbmFyby5vcmcvbWFpbG1h
bi9saXN0aW5mby95MjAzOAo=

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17 10:46                     ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17 10:46 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Deepa Dinamani, John Stultz, Linux Kernel Mailing List,
	y2038 Mailman List, Arnaldo Carvalho de Melo,
	Benjamin Herrenschmidt, Christian Borntraeger, Catalin Marinas,
	Chris Metcalf, cohuck, David Miller, Helge Deller, devel,
	gerald.schaefer, gregkh, Heiko Carstens, Jan Hoeppner,
	H. Peter Anvin, James E.J. Bottomley, Julian Wiedmann, Linux API,
	linux-arch, open list:RALINK MIPS ARCHITECTURE, Parisc List,
	linuxppc-dev, linux-s390, Mark Rutland, Ingo Molnar,
	Michael Ellerman, oberpar, oprofile-list, Paul Mackerras,
	Peter Zijlstra, Ralf Baechle, Steven Rostedt, Robert Richter,
	Martin Schwidefsky, sebott, sparclinux, Stefan Haberland,
	Ursula Braun, Will Deacon, the arch/x86 maintainers

On Fri, Nov 17, 2017 at 11:40 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> > On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> >> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> >>
>> >> No, syscall that existing 32-bit user space enters would be handled by
>> >> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
>> >> point. The idea here is to make the code path more uniform between
>> >> 32-bit and 64-bit kernels.
>> >
>> > So on a 32bit system compat_sys_nanosleep() would be the legacy
>> > sys_nanosleep() with the existing syscall number, but you don't want to
>> > introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
>> >
>> > So back to your original question whether to use #if (MAGIC logic) or a
>> > separate config symbol. Please use the latter, these magic logic constructs
>> > are harder to read and prone to get wrong at some point. Having the
>> > decision logic in one place is always the right thing to do.
>>
>> How about this:
>>
>> config LEGACY_TIME_SYSCALLS
>>       def_bool 64BIT || !64BIT_TIME
>>       help
>>         This controls the compilation of the following system calls:
>> time, stime,
>>         gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
>>         setitimer, select, utime, utimes, futimesat, and
>> {old,new}{l,f,}stat{,64}.
>>         These all pass 32-bit time_t arguments on 32-bit architectures and
>>         are replaced by other interfaces (e.g. posix timers and clocks, statx).
>>         C libraries implementing 64-bit time_t in 32-bit architectures have to
>>         implement the handles by wrapping around the newer interfaces.
>
> s/handles/handling/ ????

I meant "handlers".

>>         New architectures should not explicitly disable this.
>
> New architectures should never enable this, right?

Right, I got an extra "not". I guess if Deepa incorporates the new option,
she can also improve my English ;-)

         Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17 10:46                     ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17 10:46 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, Nov 17, 2017 at 11:40 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> > On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> >> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> >>
>> >> No, syscall that existing 32-bit user space enters would be handled by
>> >> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
>> >> point. The idea here is to make the code path more uniform between
>> >> 32-bit and 64-bit kernels.
>> >
>> > So on a 32bit system compat_sys_nanosleep() would be the legacy
>> > sys_nanosleep() with the existing syscall number, but you don't want to
>> > introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
>> >
>> > So back to your original question whether to use #if (MAGIC logic) or a
>> > separate config symbol. Please use the latter, these magic logic constructs
>> > are harder to read and prone to get wrong at some point. Having the
>> > decision logic in one place is always the right thing to do.
>>
>> How about this:
>>
>> config LEGACY_TIME_SYSCALLS
>>       def_bool 64BIT || !64BIT_TIME
>>       help
>>         This controls the compilation of the following system calls:
>> time, stime,
>>         gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
>>         setitimer, select, utime, utimes, futimesat, and
>> {old,new}{l,f,}stat{,64}.
>>         These all pass 32-bit time_t arguments on 32-bit architectures and
>>         are replaced by other interfaces (e.g. posix timers and clocks, statx).
>>         C libraries implementing 64-bit time_t in 32-bit architectures have to
>>         implement the handles by wrapping around the newer interfaces.
>
> s/handles/handling/ ????

I meant "handlers".

>>         New architectures should not explicitly disable this.
>
> New architectures should never enable this, right?

Right, I got an extra "not". I guess if Deepa incorporates the new option,
she can also improve my English ;-)

         Arnd
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-17 10:46                     ` Arnd Bergmann
  0 siblings, 0 replies; 68+ messages in thread
From: Arnd Bergmann @ 2017-11-17 10:46 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Mark Rutland, open list:RALINK MIPS ARCHITECTURE, Peter Zijlstra,
	Benjamin Herrenschmidt, Stefan Haberland, Heiko Carstens,
	Paul Mackerras, Deepa Dinamani, H. Peter Anvin, sparclinux,
	devel, linux-s390, y2038 Mailman List, Michael Ellerman,
	Helge Deller, the arch/x86 maintainers, sebott,
	James E.J. Bottomley, Will Deacon, Christian Borntraeger,
	Ingo Molnar, oprofile-list, Catali

On Fri, Nov 17, 2017 at 11:40 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
> On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> On Fri, Nov 17, 2017 at 10:54 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> > On Fri, 17 Nov 2017, Arnd Bergmann wrote:
>> >> On Fri, Nov 17, 2017 at 9:58 AM, Thomas Gleixner <tglx@linutronix.de> wrote:
>> >>
>> >> No, syscall that existing 32-bit user space enters would be handled by
>> >> compat_sys_nanosleep() on both 32-bit and 64-bit kernels at that
>> >> point. The idea here is to make the code path more uniform between
>> >> 32-bit and 64-bit kernels.
>> >
>> > So on a 32bit system compat_sys_nanosleep() would be the legacy
>> > sys_nanosleep() with the existing syscall number, but you don't want to
>> > introduce a new sys_nanosleep64() for 32bit. That makes a lot of sense.
>> >
>> > So back to your original question whether to use #if (MAGIC logic) or a
>> > separate config symbol. Please use the latter, these magic logic constructs
>> > are harder to read and prone to get wrong at some point. Having the
>> > decision logic in one place is always the right thing to do.
>>
>> How about this:
>>
>> config LEGACY_TIME_SYSCALLS
>>       def_bool 64BIT || !64BIT_TIME
>>       help
>>         This controls the compilation of the following system calls:
>> time, stime,
>>         gettimeofday, settimeofday, adjtimex, nanosleep, alarm, getitimer,
>>         setitimer, select, utime, utimes, futimesat, and
>> {old,new}{l,f,}stat{,64}.
>>         These all pass 32-bit time_t arguments on 32-bit architectures and
>>         are replaced by other interfaces (e.g. posix timers and clocks, statx).
>>         C libraries implementing 64-bit time_t in 32-bit architectures have to
>>         implement the handles by wrapping around the newer interfaces.
>
> s/handles/handling/ ????

I meant "handlers".

>>         New architectures should not explicitly disable this.
>
> New architectures should never enable this, right?

Right, I got an extra "not". I guess if Deepa incorporates the new option,
she can also improve my English ;-)

         Arnd

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [Y2038] [PATCH 5/9] y2038: introduce CONFIG_64BIT_TIME
  2017-11-10 22:42 ` [PATCH 5/9] y2038: introduce CONFIG_64BIT_TIME Deepa Dinamani
@ 2017-12-08 16:53   ` Ben Hutchings
  2017-12-08 17:01     ` Deepa Dinamani
  0 siblings, 1 reply; 68+ messages in thread
From: Ben Hutchings @ 2017-12-08 16:53 UTC (permalink / raw)
  To: Deepa Dinamani, tglx, john.stultz; +Cc: y2038, linux-kernel, arnd

On Fri, 2017-11-10 at 14:42 -0800, Deepa Dinamani wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> There are a total of 53 system calls (aside from ioctl) that pass a time_t
> or derived data structure as an argument, and in order to extend time_t
> to 64-bit, we have to replace them with new system calls and keep providing
> backwards compatibility.
> 
> To avoid adding completely new and untested code for this purpose, we
> introduce a new CONFIG_64BIT_TIME symbol. Every architecture that supports
> new 64 bit time_t syscalls enables this config via ARCH_HAS_64BIT_TIME.
> 
> After this is done for all architectures, the CONFIG_64BIT_TIME symbol
> can be made a user-selected option, to enable users to build a kernel
> that only provides y2038-safe system calls by making 32 time_t syscalls
> conditionally included based on the above config.

I don't understand why we would want to change the semantics of
CONFIG_64BIT_TIME symbol from "enable 64-bit time support" to "disable
32-bit time support".

Why not add two config symbols:

config 32BIT_TIME
	def_bool COMPAT || !64BIT

config 64BIT_TIME
	def_bool ARCH_HAS_64BIT_TIME

and then make 32BIT_TIME user-configurable later?

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> ---
>  arch/Kconfig | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/arch/Kconfig b/arch/Kconfig
> index 8911ff37335a..3266ac1a4ff7 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -875,6 +875,17 @@ config OLD_SIGACTION
>  config COMPAT_OLD_SIGACTION
>  	bool
>  
> +config ARCH_HAS_64BIT_TIME
> +	def_bool n
> +
> +config CONFIG_64BIT_TIME

The CONFIG_ prefix is added by kconfig scripts and shouldn't be used in
the Kconfig file.

Ben.

> +	def_bool ARCH_HAS_64BIT_TIME
> +	help
> +	  This should be selected by all architectures that need to support
> +	  new system calls with a 64-bit time_t. This is relevant on all 32-bit
> +	  architectures, and 64-bit architectures as part of compat syscall
> +	  handling.
> +
>  config ARCH_NO_COHERENT_DMA_MMAP
>  	bool
>  

-- 
Ben Hutchings
Software Developer, Codethink Ltd.

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [Y2038] [PATCH 5/9] y2038: introduce CONFIG_64BIT_TIME
  2017-12-08 16:53   ` [Y2038] " Ben Hutchings
@ 2017-12-08 17:01     ` Deepa Dinamani
  2017-12-08 18:23       ` Ben Hutchings
  0 siblings, 1 reply; 68+ messages in thread
From: Deepa Dinamani @ 2017-12-08 17:01 UTC (permalink / raw)
  To: Ben Hutchings
  Cc: Thomas Gleixner, John Stultz, y2038 Mailman List,
	Linux Kernel Mailing List, Arnd Bergmann

On Fri, Dec 8, 2017 at 8:53 AM, Ben Hutchings
<ben.hutchings@codethink.co.uk> wrote:
> On Fri, 2017-11-10 at 14:42 -0800, Deepa Dinamani wrote:
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> There are a total of 53 system calls (aside from ioctl) that pass a time_t
>> or derived data structure as an argument, and in order to extend time_t
>> to 64-bit, we have to replace them with new system calls and keep providing
>> backwards compatibility.
>>
>> To avoid adding completely new and untested code for this purpose, we
>> introduce a new CONFIG_64BIT_TIME symbol. Every architecture that supports
>> new 64 bit time_t syscalls enables this config via ARCH_HAS_64BIT_TIME.
>>
>> After this is done for all architectures, the CONFIG_64BIT_TIME symbol
>> can be made a user-selected option, to enable users to build a kernel
>> that only provides y2038-safe system calls by making 32 time_t syscalls
>> conditionally included based on the above config.
>
> I don't understand why we would want to change the semantics of
> CONFIG_64BIT_TIME symbol from "enable 64-bit time support" to "disable
> 32-bit time support".
>
> Why not add two config symbols:
>
> config 32BIT_TIME
>         def_bool COMPAT || !64BIT
>
> config 64BIT_TIME
>         def_bool ARCH_HAS_64BIT_TIME
>
> and then make 32BIT_TIME user-configurable later?

This was already discussed on the review and we have an updated version:

https://lkml.org/lkml/2017/11/27/938

>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
>> ---
>>  arch/Kconfig | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/arch/Kconfig b/arch/Kconfig
>> index 8911ff37335a..3266ac1a4ff7 100644
>> --- a/arch/Kconfig
>> +++ b/arch/Kconfig
>> @@ -875,6 +875,17 @@ config OLD_SIGACTION
>>  config COMPAT_OLD_SIGACTION
>>       bool
>>
>> +config ARCH_HAS_64BIT_TIME
>> +     def_bool n
>> +
>> +config CONFIG_64BIT_TIME
>
> The CONFIG_ prefix is added by kconfig scripts and shouldn't be used in
> the Kconfig file.

Yes, this was a typo and was fixed by the next revision which has
already been posted:

https://lkml.org/lkml/2017/11/27/938

-Deepa

^ permalink raw reply	[flat|nested] 68+ messages in thread

* Re: [Y2038] [PATCH 5/9] y2038: introduce CONFIG_64BIT_TIME
  2017-12-08 17:01     ` Deepa Dinamani
@ 2017-12-08 18:23       ` Ben Hutchings
  0 siblings, 0 replies; 68+ messages in thread
From: Ben Hutchings @ 2017-12-08 18:23 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: y2038 Mailman List, Thomas Gleixner, John Stultz,
	Linux Kernel Mailing List, Arnd Bergmann

On Fri, 2017-12-08 at 09:01 -0800, Deepa Dinamani wrote:
> On Fri, Dec 8, 2017 at 8:53 AM, Ben Hutchings
> > <ben.hutchings@codethink.co.uk> wrote:
> > On Fri, 2017-11-10 at 14:42 -0800, Deepa Dinamani wrote:
> > > From: Arnd Bergmann <arnd@arndb.de>
> > > 
> > > There are a total of 53 system calls (aside from ioctl) that pass a time_t
> > > or derived data structure as an argument, and in order to extend time_t
> > > to 64-bit, we have to replace them with new system calls and keep providing
> > > backwards compatibility.
> > > 
> > > To avoid adding completely new and untested code for this purpose, we
> > > introduce a new CONFIG_64BIT_TIME symbol. Every architecture that supports
> > > new 64 bit time_t syscalls enables this config via ARCH_HAS_64BIT_TIME.
> > > 
> > > After this is done for all architectures, the CONFIG_64BIT_TIME symbol
> > > can be made a user-selected option, to enable users to build a kernel
> > > that only provides y2038-safe system calls by making 32 time_t syscalls
> > > conditionally included based on the above config.
> > 
> > I don't understand why we would want to change the semantics of
> > CONFIG_64BIT_TIME symbol from "enable 64-bit time support" to "disable
> > 32-bit time support".
> > 
> > Why not add two config symbols:
> > 
> > config 32BIT_TIME
> >         def_bool COMPAT || !64BIT
> > 
> > config 64BIT_TIME
> >         def_bool ARCH_HAS_64BIT_TIME
> > 
> > and then make 32BIT_TIME user-configurable later?
> 
> This was already discussed on the review and we have an updated version:
> 
> https://lkml.org/lkml/2017/11/27/938

Sorry, I'll move on to reviewing that.

Ben.

-- 
Ben Hutchings
Software Developer, Codethink Ltd.

^ permalink raw reply	[flat|nested] 68+ messages in thread

end of thread, other threads:[~2017-12-08 18:23 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-10 22:42 [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion Deepa Dinamani
2017-11-10 22:42 ` Deepa Dinamani
2017-11-10 22:42 ` Deepa Dinamani
2017-11-10 22:42 ` Deepa Dinamani
2017-11-10 22:42 ` [PATCH 1/9] include: Move compat_timespec/ timeval to compat_time.h Deepa Dinamani
2017-11-10 22:42   ` Deepa Dinamani
2017-11-10 22:42   ` Deepa Dinamani
2017-11-11  2:38   ` Steven Rostedt
2017-11-11  2:38     ` Steven Rostedt
2017-11-11  2:38     ` Steven Rostedt
2017-11-10 22:42 ` [PATCH 2/9] compat: Make compat helpers independent of CONFIG_COMPAT Deepa Dinamani
2017-11-14 16:47   ` Arnd Bergmann
2017-11-15 23:01     ` Deepa Dinamani
2017-11-10 22:42 ` [PATCH 3/9] compat: enable compat_get/put_timespec64 always Deepa Dinamani
2017-11-10 22:42 ` [PATCH 4/9] posix-clocks: Enable compat syscalls always Deepa Dinamani
2017-11-13 21:03   ` Thomas Gleixner
2017-11-13 23:26     ` Deepa Dinamani
2017-11-14 13:03       ` Arnd Bergmann
2017-11-10 22:42 ` [PATCH 5/9] y2038: introduce CONFIG_64BIT_TIME Deepa Dinamani
2017-12-08 16:53   ` [Y2038] " Ben Hutchings
2017-12-08 17:01     ` Deepa Dinamani
2017-12-08 18:23       ` Ben Hutchings
2017-11-10 22:42 ` [PATCH 6/9] include: Add new y2038 safe __kernel_timespec Deepa Dinamani
2017-11-10 22:42 ` [PATCH 7/9] fix get_timespec64() for y2038 safe compat interfaces Deepa Dinamani
2017-11-14 14:17   ` Arnd Bergmann
2017-11-10 22:42 ` [PATCH 8/9] change time types to new y2038 safe __kernel_* types Deepa Dinamani
2017-11-10 22:42 ` [PATCH 9/9] nanosleep: change time types to " Deepa Dinamani
2017-11-10 22:42   ` Deepa Dinamani
2017-11-14 14:24 ` [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion Arnd Bergmann
2017-11-14 14:24   ` Arnd Bergmann
2017-11-14 14:24   ` Arnd Bergmann
2017-11-14 14:24   ` Arnd Bergmann
2017-11-15 23:11   ` Deepa Dinamani
2017-11-15 23:11     ` Deepa Dinamani
2017-11-15 23:11     ` Deepa Dinamani
2017-11-15 23:11     ` Deepa Dinamani
2017-11-16  9:04     ` Thomas Gleixner
2017-11-16  9:04       ` Thomas Gleixner
2017-11-16  9:04       ` Thomas Gleixner
2017-11-16  9:04       ` Thomas Gleixner
2017-11-16 23:42       ` Arnd Bergmann
2017-11-16 23:42         ` Arnd Bergmann
2017-11-16 23:42         ` Arnd Bergmann
2017-11-16 23:42         ` Arnd Bergmann
2017-11-17  8:58         ` Thomas Gleixner
2017-11-17  8:58           ` Thomas Gleixner
2017-11-17  8:58           ` Thomas Gleixner
2017-11-17  8:58           ` Thomas Gleixner
2017-11-17  9:31           ` Arnd Bergmann
2017-11-17  9:31             ` Arnd Bergmann
2017-11-17  9:31             ` Arnd Bergmann
2017-11-17  9:31             ` Arnd Bergmann
2017-11-17  9:54             ` Thomas Gleixner
2017-11-17  9:54               ` Thomas Gleixner
2017-11-17  9:54               ` Thomas Gleixner
2017-11-17  9:54               ` Thomas Gleixner
2017-11-17 10:30               ` Arnd Bergmann
2017-11-17 10:30                 ` Arnd Bergmann
2017-11-17 10:30                 ` Arnd Bergmann
2017-11-17 10:30                 ` Arnd Bergmann
2017-11-17 10:40                 ` Thomas Gleixner
2017-11-17 10:40                   ` Thomas Gleixner
2017-11-17 10:40                   ` Thomas Gleixner
2017-11-17 10:40                   ` Thomas Gleixner
2017-11-17 10:46                   ` Arnd Bergmann
2017-11-17 10:46                     ` Arnd Bergmann
2017-11-17 10:46                     ` Arnd Bergmann
2017-11-17 10:46                     ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.