Re: [Y2038] [PATCH v4 23/24] time/posix-cpu-timers:Convert to the 64bit methods for k_clock structure

2015-05-20 Thread Baolin Wang
On 20 May 2015 at 20:40, Arnd Bergmann wrote: > On Tuesday 19 May 2015 20:50:04 Baolin Wang wrote: > > @@ -1248,6 +1249,8 @@ static int do_cpu_nanosleep(const clockid_t > which_clock, int flags, > > struct timespec *rqtp, struct itimerspec *it) > > { > > struc

Re: [Y2038] [PATCH v4 22/24] cputime:Introduce the cputime_to_timespec64/timespec64_to_cputime function

2015-05-20 Thread Baolin Wang
On 20 May 2015 at 20:35, Arnd Bergmann wrote: > On Tuesday 19 May 2015 20:50:03 Baolin Wang wrote: > > +static inline void cputime_to_timespec(const cputime_t cputime, > > + struct timespec *value) > > +{ > > + struct timespec64 *ts64; > > + > > +

Re: [Y2038] [PATCH v4 21/24] time/time:Introduce the timespec64_to_jiffies()/jiffies_to_timespec64() function

2015-05-20 Thread Baolin Wang
On 20 May 2015 at 20:34, Arnd Bergmann wrote: > On Tuesday 19 May 2015 20:50:02 Baolin Wang wrote: > > +static inline void jiffies_to_timespec(const unsigned long jiffies, > > + struct timespec *value) > > +{ > > + struct timespec64 *ts; > > + > > +

Re: [Y2038] [PATCH v4 08/24] posix-timers:Change the implementation for timer_settime syscall

2015-05-20 Thread Baolin Wang
On 20 May 2015 at 21:39, Arnd Bergmann wrote: > On Tuesday 19 May 2015 20:49:49 Baolin Wang wrote: > > +/* Set a POSIX.1b interval timer */ > > +SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, > > + const struct itimerspec __user *, new_setting, > > + str

Re: [Y2038] [PATCH v4 11/24] posix-timers:Convert to the 64bit methods for the clock_settime syscall function

2015-05-20 Thread Baolin Wang
On 21 May 2015 at 01:55, John Stultz wrote: > On Tue, May 19, 2015 at 5:49 AM, Baolin Wang > wrote: > > This patch introduces the clock_set64 method with timespec64 type for > > k_clock structure, that makes it ready for the 2038 year. > > > > Convert to the 64bit method with timespec64 type for

Re: [Y2038] [PATCH v4 11/24] posix-timers:Convert to the 64bit methods for the clock_settime syscall function

2015-05-20 Thread John Stultz
On Tue, May 19, 2015 at 5:49 AM, Baolin Wang wrote: > This patch introduces the clock_set64 method with timespec64 type for > k_clock structure, that makes it ready for the 2038 year. > > Convert to the 64bit method with timespec64 type for the > clock_settime syscall function, and change the cloc

Re: [Y2038] [PATCH 1/9] y2038: remove unneeded ipc uapi header files

2015-05-20 Thread Arnd Bergmann
On Wednesday 20 May 2015 17:07:17 Arnd Bergmann wrote: > Eight architectures contain copies of the original i386 > ipcbuf/msgbuf/sembuf/shmbuf header files, which are all identical > to the version in uapi/asm-generic. > > This patch removes the files and replaces them with 'generic-y' > statement

[Y2038] [PATCH 6/9] y2038: sparc: extend sysvipc data structures

2015-05-20 Thread Arnd Bergmann
sparc, uses a nonstandard variation of the generic sysvipc data structures, intended to have the padding moved around so it can deal with big-endian 32-bit user space that has 64-bit time_t. Unlike most architectures, sparc actually succeeded in defining this right for big-endian CPUs, but as ever

[Y2038] [PATCH 8/9] y2038: xtensa: extend sysvipc data structures

2015-05-20 Thread Arnd Bergmann
xtensa, uses a nonstandard variation of the generic sysvipc data structures, intended to have the padding moved around so it can deal with big-endian 32-bit user space that has 64-bit time_t. xtensa tries hard to define the structures so they work in both big-endian and little-endian systems with

[Y2038] [PATCH 9/9] y2038: ipc: report long times to user space

2015-05-20 Thread Arnd Bergmann
The shmid64_ds/semid64_ds/msqid64_ds data structures have been extended to contain extra fields for storing the upper bits of the time stamps, this patch does the other half of the job and converts the internal data structures to use time64_t, and fill the new fields on 32-bit architectures as well

[Y2038] [PATCH 4/9] y2038: x86: extend sysvipc data structures

2015-05-20 Thread Arnd Bergmann
This extends the x86 copy of the sysvipc data structures to deal with 32-bit user space that has 64-bit time_t and wants to see timestamps beyond 2038. Fortunately, x86 has padding for this purpose in all the data structures, so we can just add extra fields. For consistency with big-endian archite

[Y2038] [PATCH 3/9] y2038: mips: extend sysvipc data structures

2015-05-20 Thread Arnd Bergmann
MIPS is the weirdest case for sysvipc, because each of the three data structures is done differently: * msqid64_ds has padding in the right place so we could in theory extend this one to just have 64-bit values instead of time_t. As this does not work for most of the other combinations, we j

[Y2038] [PATCH 2/9] y2038: asm-generic: extend sysvipc data structures

2015-05-20 Thread Arnd Bergmann
Most architectures now use the asm-generic copy of the sysvipc data structures (msqid64_ds, semid64_ds, shmid64_ds), which use 32-bit __kernel_time_t on 32-bit architectures but have padding behind them to allow extending the type to 64-bit. Unfortunately, that fails on all big-endian architecture

[Y2038] [PATCH 5/9] y2038: parisc: extend sysvipc data structures

2015-05-20 Thread Arnd Bergmann
parisc, uses a nonstandard variation of the generic sysvipc data structures, intended to have the padding moved around so it can deal with big-endian 32-bit user space that has 64-bit time_t. Unlike most architectures, parisc actually succeeded in defining this right for big-endian CPUs, but as ev

[Y2038] [PATCH 7/9] y2038: powerpc: extend sysvipc data structures

2015-05-20 Thread Arnd Bergmann
powerpc, uses a nonstandard variation of the generic sysvipc data structures, intended to have the padding moved around so it can deal with big-endian 32-bit user space that has 64-bit time_t. powerpc has the same definition as parisc and sparc, but now also supports little-endian mode, which is n

[Y2038] [PATCH 0/9] converting system calls to 64-bit time_t, part 2

2015-05-20 Thread Arnd Bergmann
This is a follow-up to the series posted at [1]. To make review a little easier, I'm focusing on just one class of system calls here, and this is one that is handled differently from all the others. In particular, for sys_msgctl, sys_semctl and sys_shmctl, I do not introduce a completely new set o

Re: [Y2038] [PATCH v2] [media] dvb-frontend: Replace timeval with ktime_t

2015-05-20 Thread Arnd Bergmann
On Tuesday 19 May 2015 13:52:10 Tina Ruchandani wrote: > struct timeval uses a 32-bit seconds representation which will > overflow in the year 2038 and beyond. This patch replaces > the usage of struct timeval with ktime_t which is a 64-bit > timestamp and is year 2038 safe. > This patch is part of

Re: [Y2038] [PATCH v4 08/24] posix-timers:Change the implementation for timer_settime syscall

2015-05-20 Thread Arnd Bergmann
On Tuesday 19 May 2015 20:49:49 Baolin Wang wrote: > +/* Set a POSIX.1b interval timer */ > +SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags, > + const struct itimerspec __user *, new_setting, > + struct itimerspec __user *, old_setting) > +{ > + struc

Re: [Y2038] [PATCH v2] xen/pcifront: Remove usage of struct timeval

2015-05-20 Thread Bjorn Helgaas
On Tue, May 19, 2015 at 1:08 AM, Tina Ruchandani wrote: > struct timeval uses a 32-bit field for representing seconds, > which will overflow in the year 2038 and beyond. This patch replaces > struct timeval with 64-bit ktime_t which is 2038 safe. > The patch is part of a larger effort to remove in

Re: [Y2038] [PATCH v4 23/24] time/posix-cpu-timers:Convert to the 64bit methods for k_clock structure

2015-05-20 Thread Arnd Bergmann
On Tuesday 19 May 2015 20:50:04 Baolin Wang wrote: > @@ -1248,6 +1249,8 @@ static int do_cpu_nanosleep(const clockid_t > which_clock, int flags, > struct timespec *rqtp, struct itimerspec *it) > { > struct k_itimer timer; > + struct timespec64 ts64; > +

Re: [Y2038] [PATCH v4 22/24] cputime:Introduce the cputime_to_timespec64/timespec64_to_cputime function

2015-05-20 Thread Arnd Bergmann
On Tuesday 19 May 2015 20:50:03 Baolin Wang wrote: > +static inline void cputime_to_timespec(const cputime_t cputime, > + struct timespec *value) > +{ > + struct timespec64 *ts64; > + > + *ts64 = timespec_to_timespec64(*value); > + cputime_to_

Re: [Y2038] [PATCH v4 21/24] time/time:Introduce the timespec64_to_jiffies()/jiffies_to_timespec64() function

2015-05-20 Thread Arnd Bergmann
On Tuesday 19 May 2015 20:50:02 Baolin Wang wrote: > +static inline void jiffies_to_timespec(const unsigned long jiffies, > + struct timespec *value) > +{ > + struct timespec64 *ts; > + > + *ts = timespec_to_timespec64(*value); > + jiffies_to_t

Re: [Y2038] [PATCH v2] xen/pcifront: Remove usage of struct timeval

2015-05-20 Thread Arnd Bergmann
On Tuesday 19 May 2015 11:38:09 Tina Ruchandani wrote: > struct timeval uses a 32-bit field for representing seconds, > which will overflow in the year 2038 and beyond. This patch replaces > struct timeval with 64-bit ktime_t which is 2038 safe. > The patch is part of a larger effort to remove inst

Re: [Y2038] [PATCH v4] Staging: media: lirc: Replace timeval with ktime_t

2015-05-20 Thread Arnd Bergmann
On Tuesday 19 May 2015 20:47:22 Ksenija Stanojevic wrote: > 'struct timeval last_tv' is used to get the time of last signal change > and 'struct timeval last_intr_tv' is used to get the time of last UART > interrupt. > 32-bit systems using 'struct timeval' will break in the year 2038, so we > have