* [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
@ 2017-11-10 22:42 Deepa Dinamani
2017-11-10 22:42 ` Deepa Dinamani
` (2 more replies)
0 siblings, 3 replies; 23+ 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] 23+ messages in thread
* [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
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 ` [PATCH 6/9] include: Add new y2038 safe __kernel_timespec Deepa Dinamani
2017-11-14 14:24 ` [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion Arnd Bergmann
2 siblings, 0 replies; 23+ 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] 23+ messages in thread
* [PATCH 6/9] include: Add new y2038 safe __kernel_timespec
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-14 14:24 ` [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion Arnd Bergmann
2 siblings, 0 replies; 23+ 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] 23+ messages in thread
* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
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 ` [PATCH 6/9] include: Add new y2038 safe __kernel_timespec Deepa Dinamani
@ 2017-11-14 14:24 ` Arnd Bergmann
2017-11-14 14:24 ` Arnd Bergmann
2017-11-15 23:11 ` Deepa Dinamani
2 siblings, 2 replies; 23+ 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] 23+ messages in thread
* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
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-15 23:11 ` Deepa Dinamani
1 sibling, 0 replies; 23+ 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] 23+ messages in thread
* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
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-15 23:11 ` Deepa Dinamani
2017-11-15 23:11 ` Deepa Dinamani
2017-11-16 9:04 ` Thomas Gleixner
1 sibling, 2 replies; 23+ 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] 23+ 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-15 23:11 ` Deepa Dinamani
2017-11-16 9:04 ` Thomas Gleixner
1 sibling, 0 replies; 23+ 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] 23+ 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-15 23:11 ` Deepa Dinamani
@ 2017-11-16 9:04 ` Thomas Gleixner
2017-11-16 9:04 ` Thomas Gleixner
2017-11-16 23:42 ` Arnd Bergmann
1 sibling, 2 replies; 23+ 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 <cmetc>
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] 23+ 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 9:04 ` Thomas Gleixner
2017-11-16 23:42 ` Arnd Bergmann
1 sibling, 0 replies; 23+ 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] 23+ 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 9:04 ` Thomas Gleixner
@ 2017-11-16 23:42 ` Arnd Bergmann
2017-11-16 23:42 ` Arnd Bergmann
2017-11-17 8:58 ` Thomas Gleixner
1 sibling, 2 replies; 23+ 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] 23+ 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-16 23:42 ` Arnd Bergmann
2017-11-17 8:58 ` Thomas Gleixner
1 sibling, 0 replies; 23+ 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] 23+ 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-16 23:42 ` Arnd Bergmann
@ 2017-11-17 8:58 ` Thomas Gleixner
2017-11-17 8:58 ` Thomas Gleixner
2017-11-17 9:31 ` Arnd Bergmann
1 sibling, 2 replies; 23+ 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] 23+ 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 8:58 ` Thomas Gleixner
2017-11-17 9:31 ` Arnd Bergmann
1 sibling, 0 replies; 23+ 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] 23+ 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 8:58 ` Thomas Gleixner
@ 2017-11-17 9:31 ` Arnd Bergmann
2017-11-17 9:31 ` Arnd Bergmann
2017-11-17 9:54 ` Thomas Gleixner
1 sibling, 2 replies; 23+ 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] 23+ 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:31 ` Arnd Bergmann
2017-11-17 9:54 ` Thomas Gleixner
1 sibling, 0 replies; 23+ 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] 23+ 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:31 ` Arnd Bergmann
@ 2017-11-17 9:54 ` Thomas Gleixner
2017-11-17 9:54 ` Thomas Gleixner
2017-11-17 10:30 ` Arnd Bergmann
1 sibling, 2 replies; 23+ 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] 23+ 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 9:54 ` Thomas Gleixner
2017-11-17 10:30 ` Arnd Bergmann
1 sibling, 0 replies; 23+ 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] 23+ 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 9:54 ` Thomas Gleixner
@ 2017-11-17 10:30 ` Arnd Bergmann
2017-11-17 10:30 ` Arnd Bergmann
2017-11-17 10:40 ` Thomas Gleixner
1 sibling, 2 replies; 23+ 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] 23+ 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:30 ` Arnd Bergmann
2017-11-17 10:40 ` Thomas Gleixner
1 sibling, 0 replies; 23+ 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] 23+ 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:30 ` Arnd Bergmann
@ 2017-11-17 10:40 ` Thomas Gleixner
2017-11-17 10:40 ` Thomas Gleixner
2017-11-17 10:46 ` Arnd Bergmann
1 sibling, 2 replies; 23+ 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] 23+ 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:40 ` Thomas Gleixner
2017-11-17 10:46 ` Arnd Bergmann
1 sibling, 0 replies; 23+ 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] 23+ 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:40 ` Thomas Gleixner
@ 2017-11-17 10:46 ` Arnd Bergmann
2017-11-17 10:46 ` Arnd Bergmann
1 sibling, 1 reply; 23+ 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] 23+ messages in thread
* Re: [PATCH 0/9] posix_clocks: Prepare syscalls for 64 bit time_t conversion
2017-11-17 10:46 ` Arnd Bergmann
@ 2017-11-17 10:46 ` Arnd Bergmann
0 siblings, 0 replies; 23+ 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] 23+ messages in thread
end of thread, other threads:[~2017-11-17 10:46 UTC | newest]
Thread overview: 23+ 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 ` [PATCH 6/9] include: Add new y2038 safe __kernel_timespec 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-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 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 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 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:46 ` Arnd Bergmann
2017-11-17 10:46 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox