Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'timers-2038-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull time/Y2038 updates from Thomas Gleixner:

- Consolidate SySV IPC UAPI headers

- Convert SySV IPC to the new COMPAT_32BIT_TIME mechanism

- Cleanup the core interfaces and standardize on the ktime_get_* naming
convention.

- Convert the X86 platform ops to timespec64

- Remove the ugly temporary timespec64 hack

* 'timers-2038-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits)
x86: Convert x86_platform_ops to timespec64
timekeeping: Add more coarse clocktai/boottime interfaces
timekeeping: Add ktime_get_coarse_with_offset
timekeeping: Standardize on ktime_get_*() naming
timekeeping: Clean up ktime_get_real_ts64
timekeeping: Remove timespec64 hack
y2038: ipc: Redirect ipc(SEMTIMEDOP, ...) to compat_ksys_semtimedop
y2038: ipc: Enable COMPAT_32BIT_TIME
y2038: ipc: Use __kernel_timespec
y2038: ipc: Report long times to user space
y2038: ipc: Use ktime_get_real_seconds consistently
y2038: xtensa: Extend sysvipc data structures
y2038: powerpc: Extend sysvipc data structures
y2038: sparc: Extend sysvipc data structures
y2038: parisc: Extend sysvipc data structures
y2038: mips: Extend sysvipc data structures
y2038: arm64: Extend sysvipc compat data structures
y2038: s390: Remove unneeded ipc uapi header files
y2038: ia64: Remove unneeded ipc uapi header files
y2038: alpha: Remove unneeded ipc uapi header files
...

+634 -869
+4
arch/alpha/include/uapi/asm/Kbuild
··· 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 4 generic-y += bpf_perf_event.h 5 + generic-y += ipcbuf.h 6 + generic-y += msgbuf.h 5 7 generic-y += poll.h 8 + generic-y += sembuf.h 9 + generic-y += shmbuf.h
-2
arch/alpha/include/uapi/asm/ipcbuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #include <asm-generic/ipcbuf.h>
-28
arch/alpha/include/uapi/asm/msgbuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _ALPHA_MSGBUF_H 3 - #define _ALPHA_MSGBUF_H 4 - 5 - /* 6 - * The msqid64_ds structure for alpha architecture. 7 - * Note extra padding because this structure is passed back and forth 8 - * between kernel and user space. 9 - * 10 - * Pad space is left for: 11 - * - 2 miscellaneous 64-bit values 12 - */ 13 - 14 - struct msqid64_ds { 15 - struct ipc64_perm msg_perm; 16 - __kernel_time_t msg_stime; /* last msgsnd time */ 17 - __kernel_time_t msg_rtime; /* last msgrcv time */ 18 - __kernel_time_t msg_ctime; /* last change time */ 19 - unsigned long msg_cbytes; /* current number of bytes on queue */ 20 - unsigned long msg_qnum; /* number of messages in queue */ 21 - unsigned long msg_qbytes; /* max number of bytes on queue */ 22 - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 23 - __kernel_pid_t msg_lrpid; /* last receive pid */ 24 - unsigned long __unused1; 25 - unsigned long __unused2; 26 - }; 27 - 28 - #endif /* _ALPHA_MSGBUF_H */
-23
arch/alpha/include/uapi/asm/sembuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _ALPHA_SEMBUF_H 3 - #define _ALPHA_SEMBUF_H 4 - 5 - /* 6 - * The semid64_ds structure for alpha architecture. 7 - * Note extra padding because this structure is passed back and forth 8 - * between kernel and user space. 9 - * 10 - * Pad space is left for: 11 - * - 2 miscellaneous 64-bit values 12 - */ 13 - 14 - struct semid64_ds { 15 - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 16 - __kernel_time_t sem_otime; /* last semop time */ 17 - __kernel_time_t sem_ctime; /* last change time */ 18 - unsigned long sem_nsems; /* no. of semaphores in array */ 19 - unsigned long __unused1; 20 - unsigned long __unused2; 21 - }; 22 - 23 - #endif /* _ALPHA_SEMBUF_H */
-39
arch/alpha/include/uapi/asm/shmbuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _ALPHA_SHMBUF_H 3 - #define _ALPHA_SHMBUF_H 4 - 5 - /* 6 - * The shmid64_ds structure for alpha architecture. 7 - * Note extra padding because this structure is passed back and forth 8 - * between kernel and user space. 9 - * 10 - * Pad space is left for: 11 - * - 2 miscellaneous 64-bit values 12 - */ 13 - 14 - struct shmid64_ds { 15 - struct ipc64_perm shm_perm; /* operation perms */ 16 - size_t shm_segsz; /* size of segment (bytes) */ 17 - __kernel_time_t shm_atime; /* last attach time */ 18 - __kernel_time_t shm_dtime; /* last detach time */ 19 - __kernel_time_t shm_ctime; /* last change time */ 20 - __kernel_pid_t shm_cpid; /* pid of creator */ 21 - __kernel_pid_t shm_lpid; /* pid of last operator */ 22 - unsigned long shm_nattch; /* no. of current attaches */ 23 - unsigned long __unused1; 24 - unsigned long __unused2; 25 - }; 26 - 27 - struct shminfo64 { 28 - unsigned long shmmax; 29 - unsigned long shmmin; 30 - unsigned long shmmni; 31 - unsigned long shmseg; 32 - unsigned long shmall; 33 - unsigned long __unused1; 34 - unsigned long __unused2; 35 - unsigned long __unused3; 36 - unsigned long __unused4; 37 - }; 38 - 39 - #endif /* _ALPHA_SHMBUF_H */
+16 -16
arch/arm64/include/asm/compat.h
··· 181 181 182 182 struct compat_semid64_ds { 183 183 struct compat_ipc64_perm sem_perm; 184 - compat_time_t sem_otime; 185 - compat_ulong_t __unused1; 186 - compat_time_t sem_ctime; 187 - compat_ulong_t __unused2; 184 + compat_ulong_t sem_otime; 185 + compat_ulong_t sem_otime_high; 186 + compat_ulong_t sem_ctime; 187 + compat_ulong_t sem_ctime_high; 188 188 compat_ulong_t sem_nsems; 189 189 compat_ulong_t __unused3; 190 190 compat_ulong_t __unused4; ··· 192 192 193 193 struct compat_msqid64_ds { 194 194 struct compat_ipc64_perm msg_perm; 195 - compat_time_t msg_stime; 196 - compat_ulong_t __unused1; 197 - compat_time_t msg_rtime; 198 - compat_ulong_t __unused2; 199 - compat_time_t msg_ctime; 200 - compat_ulong_t __unused3; 195 + compat_ulong_t msg_stime; 196 + compat_ulong_t msg_stime_high; 197 + compat_ulong_t msg_rtime; 198 + compat_ulong_t msg_rtime_high; 199 + compat_ulong_t msg_ctime; 200 + compat_ulong_t msg_ctime_high; 201 201 compat_ulong_t msg_cbytes; 202 202 compat_ulong_t msg_qnum; 203 203 compat_ulong_t msg_qbytes; ··· 210 210 struct compat_shmid64_ds { 211 211 struct compat_ipc64_perm shm_perm; 212 212 compat_size_t shm_segsz; 213 - compat_time_t shm_atime; 214 - compat_ulong_t __unused1; 215 - compat_time_t shm_dtime; 216 - compat_ulong_t __unused2; 217 - compat_time_t shm_ctime; 218 - compat_ulong_t __unused3; 213 + compat_ulong_t shm_atime; 214 + compat_ulong_t shm_atime_high; 215 + compat_ulong_t shm_dtime; 216 + compat_ulong_t shm_dtime_high; 217 + compat_ulong_t shm_ctime; 218 + compat_ulong_t shm_ctime_high; 219 219 compat_pid_t shm_cpid; 220 220 compat_pid_t shm_lpid; 221 221 compat_ulong_t shm_nattch;
+4
arch/ia64/include/uapi/asm/Kbuild
··· 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 4 generic-y += bpf_perf_event.h 5 + generic-y += ipcbuf.h 5 6 generic-y += kvm_para.h 7 + generic-y += msgbuf.h 6 8 generic-y += poll.h 9 + generic-y += sembuf.h 10 + generic-y += shmbuf.h
-2
arch/ia64/include/uapi/asm/ipcbuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #include <asm-generic/ipcbuf.h>
-28
arch/ia64/include/uapi/asm/msgbuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _ASM_IA64_MSGBUF_H 3 - #define _ASM_IA64_MSGBUF_H 4 - 5 - /* 6 - * The msqid64_ds structure for IA-64 architecture. 7 - * Note extra padding because this structure is passed back and forth 8 - * between kernel and user space. 9 - * 10 - * Pad space is left for: 11 - * - 2 miscellaneous 64-bit values 12 - */ 13 - 14 - struct msqid64_ds { 15 - struct ipc64_perm msg_perm; 16 - __kernel_time_t msg_stime; /* last msgsnd time */ 17 - __kernel_time_t msg_rtime; /* last msgrcv time */ 18 - __kernel_time_t msg_ctime; /* last change time */ 19 - unsigned long msg_cbytes; /* current number of bytes on queue */ 20 - unsigned long msg_qnum; /* number of messages in queue */ 21 - unsigned long msg_qbytes; /* max number of bytes on queue */ 22 - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 23 - __kernel_pid_t msg_lrpid; /* last receive pid */ 24 - unsigned long __unused1; 25 - unsigned long __unused2; 26 - }; 27 - 28 - #endif /* _ASM_IA64_MSGBUF_H */
-23
arch/ia64/include/uapi/asm/sembuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _ASM_IA64_SEMBUF_H 3 - #define _ASM_IA64_SEMBUF_H 4 - 5 - /* 6 - * The semid64_ds structure for IA-64 architecture. 7 - * Note extra padding because this structure is passed back and forth 8 - * between kernel and user space. 9 - * 10 - * Pad space is left for: 11 - * - 2 miscellaneous 64-bit values 12 - */ 13 - 14 - struct semid64_ds { 15 - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 16 - __kernel_time_t sem_otime; /* last semop time */ 17 - __kernel_time_t sem_ctime; /* last change time */ 18 - unsigned long sem_nsems; /* no. of semaphores in array */ 19 - unsigned long __unused1; 20 - unsigned long __unused2; 21 - }; 22 - 23 - #endif /* _ASM_IA64_SEMBUF_H */
-39
arch/ia64/include/uapi/asm/shmbuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _ASM_IA64_SHMBUF_H 3 - #define _ASM_IA64_SHMBUF_H 4 - 5 - /* 6 - * The shmid64_ds structure for IA-64 architecture. 7 - * Note extra padding because this structure is passed back and forth 8 - * between kernel and user space. 9 - * 10 - * Pad space is left for: 11 - * - 2 miscellaneous 64-bit values 12 - */ 13 - 14 - struct shmid64_ds { 15 - struct ipc64_perm shm_perm; /* operation perms */ 16 - size_t shm_segsz; /* size of segment (bytes) */ 17 - __kernel_time_t shm_atime; /* last attach time */ 18 - __kernel_time_t shm_dtime; /* last detach time */ 19 - __kernel_time_t shm_ctime; /* last change time */ 20 - __kernel_pid_t shm_cpid; /* pid of creator */ 21 - __kernel_pid_t shm_lpid; /* pid of last operator */ 22 - unsigned long shm_nattch; /* no. of current attaches */ 23 - unsigned long __unused1; 24 - unsigned long __unused2; 25 - }; 26 - 27 - struct shminfo64 { 28 - unsigned long shmmax; 29 - unsigned long shmmin; 30 - unsigned long shmmni; 31 - unsigned long shmseg; 32 - unsigned long shmall; 33 - unsigned long __unused1; 34 - unsigned long __unused2; 35 - unsigned long __unused3; 36 - unsigned long __unused4; 37 - }; 38 - 39 - #endif /* _ASM_IA64_SHMBUF_H */
+22 -18
arch/mips/include/asm/compat.h
··· 37 37 typedef s32 compat_timer_t; 38 38 typedef s32 compat_key_t; 39 39 40 + typedef s16 compat_short_t; 40 41 typedef s32 compat_int_t; 41 42 typedef s32 compat_long_t; 42 43 typedef s64 compat_s64; 44 + typedef u16 compat_ushort_t; 43 45 typedef u32 compat_uint_t; 44 46 typedef u32 compat_ulong_t; 45 47 typedef u64 compat_u64; ··· 159 157 160 158 struct compat_semid64_ds { 161 159 struct compat_ipc64_perm sem_perm; 162 - compat_time_t sem_otime; 163 - compat_time_t sem_ctime; 160 + compat_ulong_t sem_otime; 161 + compat_ulong_t sem_ctime; 164 162 compat_ulong_t sem_nsems; 165 - compat_ulong_t __unused1; 166 - compat_ulong_t __unused2; 163 + compat_ulong_t sem_otime_high; 164 + compat_ulong_t sem_ctime_high; 167 165 }; 168 166 169 167 struct compat_msqid64_ds { 170 168 struct compat_ipc64_perm msg_perm; 171 169 #ifndef CONFIG_CPU_LITTLE_ENDIAN 172 - compat_ulong_t __unused1; 170 + compat_ulong_t msg_stime_high; 173 171 #endif 174 - compat_time_t msg_stime; 172 + compat_ulong_t msg_stime; 175 173 #ifdef CONFIG_CPU_LITTLE_ENDIAN 176 - compat_ulong_t __unused1; 174 + compat_ulong_t msg_stime_high; 177 175 #endif 178 176 #ifndef CONFIG_CPU_LITTLE_ENDIAN 179 - compat_ulong_t __unused2; 177 + compat_ulong_t msg_rtime_high; 180 178 #endif 181 - compat_time_t msg_rtime; 179 + compat_ulong_t msg_rtime; 182 180 #ifdef CONFIG_CPU_LITTLE_ENDIAN 183 - compat_ulong_t __unused2; 181 + compat_ulong_t msg_rtime_high; 184 182 #endif 185 183 #ifndef CONFIG_CPU_LITTLE_ENDIAN 186 - compat_ulong_t __unused3; 184 + compat_ulong_t msg_ctime_high; 187 185 #endif 188 - compat_time_t msg_ctime; 186 + compat_ulong_t msg_ctime; 189 187 #ifdef CONFIG_CPU_LITTLE_ENDIAN 190 - compat_ulong_t __unused3; 188 + compat_ulong_t msg_ctime_high; 191 189 #endif 192 190 compat_ulong_t msg_cbytes; 193 191 compat_ulong_t msg_qnum; ··· 201 199 struct compat_shmid64_ds { 202 200 struct compat_ipc64_perm shm_perm; 203 201 compat_size_t shm_segsz; 204 - compat_time_t shm_atime; 205 - compat_time_t shm_dtime; 206 - compat_time_t shm_ctime; 202 + compat_ulong_t shm_atime; 203 + compat_ulong_t shm_dtime; 204 + compat_ulong_t shm_ctime; 207 205 compat_pid_t shm_cpid; 208 206 compat_pid_t shm_lpid; 209 207 compat_ulong_t shm_nattch; 210 - compat_ulong_t __unused1; 211 - compat_ulong_t __unused2; 208 + compat_ushort_t shm_atime_high; 209 + compat_ushort_t shm_dtime_high; 210 + compat_ushort_t shm_ctime_high; 211 + compat_ushort_t __unused2; 212 212 }; 213 213 214 214 /* MIPS has unusual order of fields in stack_t */
+38 -19
arch/mips/include/uapi/asm/msgbuf.h
··· 9 9 * between kernel and user space. 10 10 * 11 11 * Pad space is left for: 12 - * - extension of time_t to 64-bit on 32-bitsystem to solve the y2038 problem 13 12 * - 2 miscellaneous unsigned long values 14 13 */ 15 14 15 + #if defined(__mips64) 16 16 struct msqid64_ds { 17 17 struct ipc64_perm msg_perm; 18 - #if !defined(__mips64) && defined(__MIPSEB__) 19 - unsigned long __unused1; 20 - #endif 21 18 __kernel_time_t msg_stime; /* last msgsnd time */ 22 - #if !defined(__mips64) && defined(__MIPSEL__) 23 - unsigned long __unused1; 24 - #endif 25 - #if !defined(__mips64) && defined(__MIPSEB__) 26 - unsigned long __unused2; 27 - #endif 28 19 __kernel_time_t msg_rtime; /* last msgrcv time */ 29 - #if !defined(__mips64) && defined(__MIPSEL__) 30 - unsigned long __unused2; 31 - #endif 32 - #if !defined(__mips64) && defined(__MIPSEB__) 33 - unsigned long __unused3; 34 - #endif 35 20 __kernel_time_t msg_ctime; /* last change time */ 36 - #if !defined(__mips64) && defined(__MIPSEL__) 37 - unsigned long __unused3; 38 - #endif 39 21 unsigned long msg_cbytes; /* current number of bytes on queue */ 40 22 unsigned long msg_qnum; /* number of messages in queue */ 41 23 unsigned long msg_qbytes; /* max number of bytes on queue */ ··· 26 44 unsigned long __unused4; 27 45 unsigned long __unused5; 28 46 }; 47 + #elif defined (__MIPSEB__) 48 + struct msqid64_ds { 49 + struct ipc64_perm msg_perm; 50 + unsigned long msg_stime_high; 51 + unsigned long msg_stime; /* last msgsnd time */ 52 + unsigned long msg_rtime_high; 53 + unsigned long msg_rtime; /* last msgrcv time */ 54 + unsigned long msg_ctime_high; 55 + unsigned long msg_ctime; /* last change time */ 56 + unsigned long msg_cbytes; /* current number of bytes on queue */ 57 + unsigned long msg_qnum; /* number of messages in queue */ 58 + unsigned long msg_qbytes; /* max number of bytes on queue */ 59 + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 60 + __kernel_pid_t msg_lrpid; /* last receive pid */ 61 + unsigned long __unused4; 62 + unsigned long __unused5; 63 + }; 64 + #elif defined (__MIPSEL__) 65 + struct msqid64_ds { 66 + struct ipc64_perm msg_perm; 67 + unsigned long msg_stime; /* last msgsnd time */ 68 + unsigned long msg_stime_high; 69 + unsigned long msg_rtime; /* last msgrcv time */ 70 + unsigned long msg_rtime_high; 71 + unsigned long msg_ctime; /* last change time */ 72 + unsigned long msg_ctime_high; 73 + unsigned long msg_cbytes; /* current number of bytes on queue */ 74 + unsigned long msg_qnum; /* number of messages in queue */ 75 + unsigned long msg_qbytes; /* max number of bytes on queue */ 76 + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 77 + __kernel_pid_t msg_lrpid; /* last receive pid */ 78 + unsigned long __unused4; 79 + unsigned long __unused5; 80 + }; 81 + #else 82 + #warning no endianess set 83 + #endif 29 84 30 85 #endif /* _ASM_MSGBUF_H */
+13 -2
arch/mips/include/uapi/asm/sembuf.h
··· 7 7 * Note extra padding because this structure is passed back and forth 8 8 * between kernel and user space. 9 9 * 10 - * Pad space is left for: 11 - * - 2 miscellaneous 64-bit values 10 + * Pad space is left for 2 miscellaneous 64-bit values on mips64, 11 + * but used for the upper 32 bit of the time values on mips32. 12 12 */ 13 13 14 + #ifdef __mips64 14 15 struct semid64_ds { 15 16 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 16 17 __kernel_time_t sem_otime; /* last semop time */ ··· 20 19 unsigned long __unused1; 21 20 unsigned long __unused2; 22 21 }; 22 + #else 23 + struct semid64_ds { 24 + struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 25 + unsigned long sem_otime; /* last semop time */ 26 + unsigned long sem_ctime; /* last change time */ 27 + unsigned long sem_nsems; /* no. of semaphores in array */ 28 + unsigned long sem_otime_high; 29 + unsigned long sem_ctime_high; 30 + }; 31 + #endif 23 32 24 33 #endif /* _ASM_SEMBUF_H */
+21 -2
arch/mips/include/uapi/asm/shmbuf.h
··· 7 7 * Note extra padding because this structure is passed back and forth 8 8 * between kernel and user space. 9 9 * 10 - * Pad space is left for: 11 - * - 2 miscellaneous 32-bit rsp. 64-bit values 10 + * As MIPS was lacking proper padding after shm_?time, we use 48 bits 11 + * of the padding at the end to store a few additional bits of the time. 12 + * libc implementations need to take care to convert this into a proper 13 + * data structure when moving to 64-bit time_t. 12 14 */ 13 15 16 + #ifdef __mips64 14 17 struct shmid64_ds { 15 18 struct ipc64_perm shm_perm; /* operation perms */ 16 19 size_t shm_segsz; /* size of segment (bytes) */ ··· 26 23 unsigned long __unused1; 27 24 unsigned long __unused2; 28 25 }; 26 + #else 27 + struct shmid64_ds { 28 + struct ipc64_perm shm_perm; /* operation perms */ 29 + size_t shm_segsz; /* size of segment (bytes) */ 30 + unsigned long shm_atime; /* last attach time */ 31 + unsigned long shm_dtime; /* last detach time */ 32 + unsigned long shm_ctime; /* last change time */ 33 + __kernel_pid_t shm_cpid; /* pid of creator */ 34 + __kernel_pid_t shm_lpid; /* pid of last operator */ 35 + unsigned long shm_nattch; /* no. of current attaches */ 36 + unsigned short shm_atime_high; 37 + unsigned short shm_dtime_high; 38 + unsigned short shm_ctime_high; 39 + unsigned short __unused1; 40 + }; 41 + #endif 29 42 30 43 struct shminfo64 { 31 44 unsigned long shmmax;
+16 -16
arch/parisc/include/asm/compat.h
··· 138 138 139 139 struct compat_semid64_ds { 140 140 struct compat_ipc64_perm sem_perm; 141 - unsigned int __unused1; 142 - compat_time_t sem_otime; 143 - unsigned int __unused2; 144 - compat_time_t sem_ctime; 141 + unsigned int sem_otime_high; 142 + unsigned int sem_otime; 143 + unsigned int sem_ctime_high; 144 + unsigned int sem_ctime; 145 145 compat_ulong_t sem_nsems; 146 146 compat_ulong_t __unused3; 147 147 compat_ulong_t __unused4; ··· 149 149 150 150 struct compat_msqid64_ds { 151 151 struct compat_ipc64_perm msg_perm; 152 - unsigned int __unused1; 153 - compat_time_t msg_stime; 154 - unsigned int __unused2; 155 - compat_time_t msg_rtime; 156 - unsigned int __unused3; 157 - compat_time_t msg_ctime; 152 + unsigned int msg_stime_high; 153 + unsigned int msg_stime; 154 + unsigned int msg_rtime_high; 155 + unsigned int msg_rtime; 156 + unsigned int msg_ctime_high; 157 + unsigned int msg_ctime; 158 158 compat_ulong_t msg_cbytes; 159 159 compat_ulong_t msg_qnum; 160 160 compat_ulong_t msg_qbytes; ··· 166 166 167 167 struct compat_shmid64_ds { 168 168 struct compat_ipc64_perm shm_perm; 169 - unsigned int __unused1; 170 - compat_time_t shm_atime; 171 - unsigned int __unused2; 172 - compat_time_t shm_dtime; 173 - unsigned int __unused3; 174 - compat_time_t shm_ctime; 169 + unsigned int shm_atime_high; 170 + unsigned int shm_atime; 171 + unsigned int shm_dtime_high; 172 + unsigned int shm_dtime; 173 + unsigned int shm_ctime_high; 174 + unsigned int shm_ctime; 175 175 unsigned int __unused4; 176 176 compat_size_t shm_segsz; 177 177 compat_pid_t shm_cpid;
+16 -17
arch/parisc/include/uapi/asm/msgbuf.h
··· 10 10 * between kernel and user space. 11 11 * 12 12 * Pad space is left for: 13 - * - 64-bit time_t to solve y2038 problem 14 13 * - 2 miscellaneous 32-bit values 15 14 */ 16 15 17 16 struct msqid64_ds { 18 17 struct ipc64_perm msg_perm; 19 - #if __BITS_PER_LONG != 64 20 - unsigned int __pad1; 21 - #endif 18 + #if __BITS_PER_LONG == 64 22 19 __kernel_time_t msg_stime; /* last msgsnd time */ 23 - #if __BITS_PER_LONG != 64 24 - unsigned int __pad2; 25 - #endif 26 20 __kernel_time_t msg_rtime; /* last msgrcv time */ 27 - #if __BITS_PER_LONG != 64 28 - unsigned int __pad3; 29 - #endif 30 21 __kernel_time_t msg_ctime; /* last change time */ 31 - unsigned long msg_cbytes; /* current number of bytes on queue */ 32 - unsigned long msg_qnum; /* number of messages in queue */ 33 - unsigned long msg_qbytes; /* max number of bytes on queue */ 34 - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 35 - __kernel_pid_t msg_lrpid; /* last receive pid */ 36 - unsigned long __unused1; 37 - unsigned long __unused2; 22 + #else 23 + unsigned long msg_stime_high; 24 + unsigned long msg_stime; /* last msgsnd time */ 25 + unsigned long msg_rtime_high; 26 + unsigned long msg_rtime; /* last msgrcv time */ 27 + unsigned long msg_ctime_high; 28 + unsigned long msg_ctime; /* last change time */ 29 + #endif 30 + unsigned long msg_cbytes; /* current number of bytes on queue */ 31 + unsigned long msg_qnum; /* number of messages in queue */ 32 + unsigned long msg_qbytes; /* max number of bytes on queue */ 33 + __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 34 + __kernel_pid_t msg_lrpid; /* last receive pid */ 35 + unsigned long __unused1; 36 + unsigned long __unused2; 38 37 }; 39 38 40 39 #endif /* _PARISC_MSGBUF_H */
+8 -8
arch/parisc/include/uapi/asm/sembuf.h
··· 10 10 * between kernel and user space. 11 11 * 12 12 * Pad space is left for: 13 - * - 64-bit time_t to solve y2038 problem 14 13 * - 2 miscellaneous 32-bit values 15 14 */ 16 15 17 16 struct semid64_ds { 18 17 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 19 - #if __BITS_PER_LONG != 64 20 - unsigned int __pad1; 21 - #endif 18 + #if __BITS_PER_LONG == 64 22 19 __kernel_time_t sem_otime; /* last semop time */ 23 - #if __BITS_PER_LONG != 64 24 - unsigned int __pad2; 25 - #endif 26 20 __kernel_time_t sem_ctime; /* last change time */ 27 - unsigned long sem_nsems; /* no. of semaphores in array */ 21 + #else 22 + unsigned long sem_otime_high; 23 + unsigned long sem_otime; /* last semop time */ 24 + unsigned long sem_ctime_high; 25 + unsigned long sem_ctime; /* last change time */ 26 + #endif 27 + unsigned long sem_nsems; /* no. of semaphores in array */ 28 28 unsigned long __unused1; 29 29 unsigned long __unused2; 30 30 };
+8 -11
arch/parisc/include/uapi/asm/shmbuf.h
··· 10 10 * between kernel and user space. 11 11 * 12 12 * Pad space is left for: 13 - * - 64-bit time_t to solve y2038 problem 14 13 * - 2 miscellaneous 32-bit values 15 14 */ 16 15 17 16 struct shmid64_ds { 18 17 struct ipc64_perm shm_perm; /* operation perms */ 19 - #if __BITS_PER_LONG != 64 20 - unsigned int __pad1; 21 - #endif 18 + #if __BITS_PER_LONG == 64 22 19 __kernel_time_t shm_atime; /* last attach time */ 23 - #if __BITS_PER_LONG != 64 24 - unsigned int __pad2; 25 - #endif 26 20 __kernel_time_t shm_dtime; /* last detach time */ 27 - #if __BITS_PER_LONG != 64 28 - unsigned int __pad3; 29 - #endif 30 21 __kernel_time_t shm_ctime; /* last change time */ 31 - #if __BITS_PER_LONG != 64 22 + #else 23 + unsigned long shm_atime_high; 24 + unsigned long shm_atime; /* last attach time */ 25 + unsigned long shm_dtime_high; 26 + unsigned long shm_dtime; /* last detach time */ 27 + unsigned long shm_ctime_high; 28 + unsigned long shm_ctime; /* last change time */ 32 29 unsigned int __pad4; 33 30 #endif 34 31 __kernel_size_t shm_segsz; /* size of segment (bytes) */
+16 -16
arch/powerpc/include/asm/compat.h
··· 162 162 163 163 struct compat_semid64_ds { 164 164 struct compat_ipc64_perm sem_perm; 165 - unsigned int __unused1; 166 - compat_time_t sem_otime; 167 - unsigned int __unused2; 168 - compat_time_t sem_ctime; 165 + unsigned int sem_otime_high; 166 + unsigned int sem_otime; 167 + unsigned int sem_ctime_high; 168 + unsigned int sem_ctime; 169 169 compat_ulong_t sem_nsems; 170 170 compat_ulong_t __unused3; 171 171 compat_ulong_t __unused4; ··· 173 173 174 174 struct compat_msqid64_ds { 175 175 struct compat_ipc64_perm msg_perm; 176 - unsigned int __unused1; 177 - compat_time_t msg_stime; 178 - unsigned int __unused2; 179 - compat_time_t msg_rtime; 180 - unsigned int __unused3; 181 - compat_time_t msg_ctime; 176 + unsigned int msg_stime_high; 177 + unsigned int msg_stime; 178 + unsigned int msg_rtime_high; 179 + unsigned int msg_rtime; 180 + unsigned int msg_ctime_high; 181 + unsigned int msg_ctime; 182 182 compat_ulong_t msg_cbytes; 183 183 compat_ulong_t msg_qnum; 184 184 compat_ulong_t msg_qbytes; ··· 190 190 191 191 struct compat_shmid64_ds { 192 192 struct compat_ipc64_perm shm_perm; 193 - unsigned int __unused1; 194 - compat_time_t shm_atime; 195 - unsigned int __unused2; 196 - compat_time_t shm_dtime; 197 - unsigned int __unused3; 198 - compat_time_t shm_ctime; 193 + unsigned int shm_atime_high; 194 + unsigned int shm_atime; 195 + unsigned int shm_dtime_high; 196 + unsigned int shm_dtime; 197 + unsigned int shm_ctime_high; 198 + unsigned int shm_ctime; 199 199 unsigned int __unused4; 200 200 compat_size_t shm_segsz; 201 201 compat_pid_t shm_cpid;
+9 -9
arch/powerpc/include/uapi/asm/msgbuf.h
··· 10 10 11 11 struct msqid64_ds { 12 12 struct ipc64_perm msg_perm; 13 - #ifndef __powerpc64__ 14 - unsigned int __unused1; 15 - #endif 13 + #ifdef __powerpc64__ 16 14 __kernel_time_t msg_stime; /* last msgsnd time */ 17 - #ifndef __powerpc64__ 18 - unsigned int __unused2; 19 - #endif 20 15 __kernel_time_t msg_rtime; /* last msgrcv time */ 21 - #ifndef __powerpc64__ 22 - unsigned int __unused3; 23 - #endif 24 16 __kernel_time_t msg_ctime; /* last change time */ 17 + #else 18 + unsigned long msg_stime_high; 19 + unsigned long msg_stime; /* last msgsnd time */ 20 + unsigned long msg_rtime_high; 21 + unsigned long msg_rtime; /* last msgrcv time */ 22 + unsigned long msg_ctime_high; 23 + unsigned long msg_ctime; /* last change time */ 24 + #endif 25 25 unsigned long msg_cbytes; /* current number of bytes on queue */ 26 26 unsigned long msg_qnum; /* number of messages in queue */ 27 27 unsigned long msg_qbytes; /* max number of bytes on queue */
+7 -7
arch/powerpc/include/uapi/asm/sembuf.h
··· 15 15 * between kernel and user space. 16 16 * 17 17 * Pad space is left for: 18 - * - 64-bit time_t to solve y2038 problem 19 - * - 2 miscellaneous 32-bit values 18 + * - 2 miscellaneous 32/64-bit values 20 19 */ 21 20 22 21 struct semid64_ds { 23 22 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 24 23 #ifndef __powerpc64__ 25 - unsigned long __unused1; 26 - #endif 24 + unsigned long sem_otime_high; 25 + unsigned long sem_otime; /* last semop time */ 26 + unsigned long sem_ctime_high; 27 + unsigned long sem_ctime; /* last change time */ 28 + #else 27 29 __kernel_time_t sem_otime; /* last semop time */ 28 - #ifndef __powerpc64__ 29 - unsigned long __unused2; 30 - #endif 31 30 __kernel_time_t sem_ctime; /* last change time */ 31 + #endif 32 32 unsigned long sem_nsems; /* no. of semaphores in array */ 33 33 unsigned long __unused3; 34 34 unsigned long __unused4;
+8 -11
arch/powerpc/include/uapi/asm/shmbuf.h
··· 16 16 * between kernel and user space. 17 17 * 18 18 * Pad space is left for: 19 - * - 64-bit time_t to solve y2038 problem 20 19 * - 2 miscellaneous 32-bit values 21 20 */ 22 21 23 22 struct shmid64_ds { 24 23 struct ipc64_perm shm_perm; /* operation perms */ 25 - #ifndef __powerpc64__ 26 - unsigned long __unused1; 27 - #endif 24 + #ifdef __powerpc64__ 28 25 __kernel_time_t shm_atime; /* last attach time */ 29 - #ifndef __powerpc64__ 30 - unsigned long __unused2; 31 - #endif 32 26 __kernel_time_t shm_dtime; /* last detach time */ 33 - #ifndef __powerpc64__ 34 - unsigned long __unused3; 35 - #endif 36 27 __kernel_time_t shm_ctime; /* last change time */ 37 - #ifndef __powerpc64__ 28 + #else 29 + unsigned long shm_atime_high; 30 + unsigned long shm_atime; /* last attach time */ 31 + unsigned long shm_dtime_high; 32 + unsigned long shm_dtime; /* last detach time */ 33 + unsigned long shm_ctime_high; 34 + unsigned long shm_ctime; /* last change time */ 38 35 unsigned long __unused4; 39 36 #endif 40 37 size_t shm_segsz; /* size of segment (bytes) */
+16 -16
arch/s390/include/asm/compat.h
··· 232 232 233 233 struct compat_semid64_ds { 234 234 struct compat_ipc64_perm sem_perm; 235 - compat_time_t sem_otime; 236 - compat_ulong_t __pad1; 237 - compat_time_t sem_ctime; 238 - compat_ulong_t __pad2; 235 + compat_ulong_t sem_otime; 236 + compat_ulong_t sem_otime_high; 237 + compat_ulong_t sem_ctime; 238 + compat_ulong_t sem_ctime_high; 239 239 compat_ulong_t sem_nsems; 240 240 compat_ulong_t __unused1; 241 241 compat_ulong_t __unused2; ··· 243 243 244 244 struct compat_msqid64_ds { 245 245 struct compat_ipc64_perm msg_perm; 246 - compat_time_t msg_stime; 247 - compat_ulong_t __pad1; 248 - compat_time_t msg_rtime; 249 - compat_ulong_t __pad2; 250 - compat_time_t msg_ctime; 251 - compat_ulong_t __pad3; 246 + compat_ulong_t msg_stime; 247 + compat_ulong_t msg_stime_high; 248 + compat_ulong_t msg_rtime; 249 + compat_ulong_t msg_rtime_high; 250 + compat_ulong_t msg_ctime; 251 + compat_ulong_t msg_ctime_high; 252 252 compat_ulong_t msg_cbytes; 253 253 compat_ulong_t msg_qnum; 254 254 compat_ulong_t msg_qbytes; ··· 261 261 struct compat_shmid64_ds { 262 262 struct compat_ipc64_perm shm_perm; 263 263 compat_size_t shm_segsz; 264 - compat_time_t shm_atime; 265 - compat_ulong_t __pad1; 266 - compat_time_t shm_dtime; 267 - compat_ulong_t __pad2; 268 - compat_time_t shm_ctime; 269 - compat_ulong_t __pad3; 264 + compat_ulong_t shm_atime; 265 + compat_ulong_t shm_atime_high; 266 + compat_ulong_t shm_dtime; 267 + compat_ulong_t shm_dtime_high; 268 + compat_ulong_t shm_ctime; 269 + compat_ulong_t shm_ctime_high; 270 270 compat_pid_t shm_cpid; 271 271 compat_pid_t shm_lpid; 272 272 compat_ulong_t shm_nattch;
+3
arch/s390/include/uapi/asm/Kbuild
··· 9 9 generic-y += fcntl.h 10 10 generic-y += ioctl.h 11 11 generic-y += mman.h 12 + generic-y += msgbuf.h 12 13 generic-y += param.h 13 14 generic-y += poll.h 14 15 generic-y += resource.h 16 + generic-y += sembuf.h 17 + generic-y += shmbuf.h 15 18 generic-y += sockios.h 16 19 generic-y += swab.h 17 20 generic-y += termbits.h
-38
arch/s390/include/uapi/asm/msgbuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _S390_MSGBUF_H 3 - #define _S390_MSGBUF_H 4 - 5 - /* 6 - * The msqid64_ds structure for S/390 architecture. 7 - * Note extra padding because this structure is passed back and forth 8 - * between kernel and user space. 9 - * 10 - * Pad space is left for: 11 - * - 64-bit time_t to solve y2038 problem 12 - * - 2 miscellaneous 32-bit values 13 - */ 14 - 15 - struct msqid64_ds { 16 - struct ipc64_perm msg_perm; 17 - __kernel_time_t msg_stime; /* last msgsnd time */ 18 - #ifndef __s390x__ 19 - unsigned long __unused1; 20 - #endif /* ! __s390x__ */ 21 - __kernel_time_t msg_rtime; /* last msgrcv time */ 22 - #ifndef __s390x__ 23 - unsigned long __unused2; 24 - #endif /* ! __s390x__ */ 25 - __kernel_time_t msg_ctime; /* last change time */ 26 - #ifndef __s390x__ 27 - unsigned long __unused3; 28 - #endif /* ! __s390x__ */ 29 - unsigned long msg_cbytes; /* current number of bytes on queue */ 30 - unsigned long msg_qnum; /* number of messages in queue */ 31 - unsigned long msg_qbytes; /* max number of bytes on queue */ 32 - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 33 - __kernel_pid_t msg_lrpid; /* last receive pid */ 34 - unsigned long __unused4; 35 - unsigned long __unused5; 36 - }; 37 - 38 - #endif /* _S390_MSGBUF_H */
-30
arch/s390/include/uapi/asm/sembuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _S390_SEMBUF_H 3 - #define _S390_SEMBUF_H 4 - 5 - /* 6 - * The semid64_ds structure for S/390 architecture. 7 - * Note extra padding because this structure is passed back and forth 8 - * between kernel and user space. 9 - * 10 - * Pad space is left for: 11 - * - 64-bit time_t to solve y2038 problem (for !__s390x__) 12 - * - 2 miscellaneous 32-bit values 13 - */ 14 - 15 - struct semid64_ds { 16 - struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 17 - __kernel_time_t sem_otime; /* last semop time */ 18 - #ifndef __s390x__ 19 - unsigned long __unused1; 20 - #endif /* ! __s390x__ */ 21 - __kernel_time_t sem_ctime; /* last change time */ 22 - #ifndef __s390x__ 23 - unsigned long __unused2; 24 - #endif /* ! __s390x__ */ 25 - unsigned long sem_nsems; /* no. of semaphores in array */ 26 - unsigned long __unused3; 27 - unsigned long __unused4; 28 - }; 29 - 30 - #endif /* _S390_SEMBUF_H */
-49
arch/s390/include/uapi/asm/shmbuf.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 - #ifndef _S390_SHMBUF_H 3 - #define _S390_SHMBUF_H 4 - 5 - /* 6 - * The shmid64_ds structure for S/390 architecture. 7 - * Note extra padding because this structure is passed back and forth 8 - * between kernel and user space. 9 - * 10 - * Pad space is left for: 11 - * - 64-bit time_t to solve y2038 problem (for !__s390x__) 12 - * - 2 miscellaneous 32-bit values 13 - */ 14 - 15 - struct shmid64_ds { 16 - struct ipc64_perm shm_perm; /* operation perms */ 17 - size_t shm_segsz; /* size of segment (bytes) */ 18 - __kernel_time_t shm_atime; /* last attach time */ 19 - #ifndef __s390x__ 20 - unsigned long __unused1; 21 - #endif /* ! __s390x__ */ 22 - __kernel_time_t shm_dtime; /* last detach time */ 23 - #ifndef __s390x__ 24 - unsigned long __unused2; 25 - #endif /* ! __s390x__ */ 26 - __kernel_time_t shm_ctime; /* last change time */ 27 - #ifndef __s390x__ 28 - unsigned long __unused3; 29 - #endif /* ! __s390x__ */ 30 - __kernel_pid_t shm_cpid; /* pid of creator */ 31 - __kernel_pid_t shm_lpid; /* pid of last operator */ 32 - unsigned long shm_nattch; /* no. of current attaches */ 33 - unsigned long __unused4; 34 - unsigned long __unused5; 35 - }; 36 - 37 - struct shminfo64 { 38 - unsigned long shmmax; 39 - unsigned long shmmin; 40 - unsigned long shmmni; 41 - unsigned long shmseg; 42 - unsigned long shmall; 43 - unsigned long __unused1; 44 - unsigned long __unused2; 45 - unsigned long __unused3; 46 - unsigned long __unused4; 47 - }; 48 - 49 - #endif /* _S390_SHMBUF_H */
+16 -16
arch/sparc/include/asm/compat.h
··· 192 192 193 193 struct compat_semid64_ds { 194 194 struct compat_ipc64_perm sem_perm; 195 - unsigned int __pad1; 196 - compat_time_t sem_otime; 197 - unsigned int __pad2; 198 - compat_time_t sem_ctime; 195 + unsigned int sem_otime_high; 196 + unsigned int sem_otime; 197 + unsigned int sem_ctime_high; 198 + unsigned int sem_ctime; 199 199 u32 sem_nsems; 200 200 u32 __unused1; 201 201 u32 __unused2; ··· 203 203 204 204 struct compat_msqid64_ds { 205 205 struct compat_ipc64_perm msg_perm; 206 - unsigned int __pad1; 207 - compat_time_t msg_stime; 208 - unsigned int __pad2; 209 - compat_time_t msg_rtime; 210 - unsigned int __pad3; 211 - compat_time_t msg_ctime; 206 + unsigned int msg_stime_high; 207 + unsigned int msg_stime; 208 + unsigned int msg_rtime_high; 209 + unsigned int msg_rtime; 210 + unsigned int msg_ctime_high; 211 + unsigned int msg_ctime; 212 212 unsigned int msg_cbytes; 213 213 unsigned int msg_qnum; 214 214 unsigned int msg_qbytes; ··· 220 220 221 221 struct compat_shmid64_ds { 222 222 struct compat_ipc64_perm shm_perm; 223 - unsigned int __pad1; 224 - compat_time_t shm_atime; 225 - unsigned int __pad2; 226 - compat_time_t shm_dtime; 227 - unsigned int __pad3; 228 - compat_time_t shm_ctime; 223 + unsigned int shm_atime_high; 224 + unsigned int shm_atime; 225 + unsigned int shm_dtime_high; 226 + unsigned int shm_dtime; 227 + unsigned int shm_ctime_high; 228 + unsigned int shm_ctime; 229 229 compat_size_t shm_segsz; 230 230 compat_pid_t shm_cpid; 231 231 compat_pid_t shm_lpid;
+9 -13
arch/sparc/include/uapi/asm/msgbuf.h
··· 8 8 * between kernel and user space. 9 9 * 10 10 * Pad space is left for: 11 - * - 64-bit time_t to solve y2038 problem 12 11 * - 2 miscellaneous 32-bit values 13 12 */ 14 - 15 - #if defined(__sparc__) && defined(__arch64__) 16 - # define PADDING(x) 17 - #else 18 - # define PADDING(x) unsigned int x; 19 - #endif 20 - 21 - 22 13 struct msqid64_ds { 23 14 struct ipc64_perm msg_perm; 24 - PADDING(__pad1) 15 + #if defined(__sparc__) && defined(__arch64__) 25 16 __kernel_time_t msg_stime; /* last msgsnd time */ 26 - PADDING(__pad2) 27 17 __kernel_time_t msg_rtime; /* last msgrcv time */ 28 - PADDING(__pad3) 29 18 __kernel_time_t msg_ctime; /* last change time */ 19 + #else 20 + unsigned long msg_stime_high; 21 + unsigned long msg_stime; /* last msgsnd time */ 22 + unsigned long msg_rtime_high; 23 + unsigned long msg_rtime; /* last msgrcv time */ 24 + unsigned long msg_ctime_high; 25 + unsigned long msg_ctime; /* last change time */ 26 + #endif 30 27 unsigned long msg_cbytes; /* current number of bytes on queue */ 31 28 unsigned long msg_qnum; /* number of messages in queue */ 32 29 unsigned long msg_qbytes; /* max number of bytes on queue */ ··· 32 35 unsigned long __unused1; 33 36 unsigned long __unused2; 34 37 }; 35 - #undef PADDING 36 38 #endif /* _SPARC_MSGBUF_H */
+7 -9
arch/sparc/include/uapi/asm/sembuf.h
··· 8 8 * between kernel and user space. 9 9 * 10 10 * Pad space is left for: 11 - * - 64-bit time_t to solve y2038 problem 12 11 * - 2 miscellaneous 32-bit values 13 12 */ 14 - #if defined(__sparc__) && defined(__arch64__) 15 - # define PADDING(x) 16 - #else 17 - # define PADDING(x) unsigned int x; 18 - #endif 19 13 20 14 struct semid64_ds { 21 15 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 22 - PADDING(__pad1) 16 + #if defined(__sparc__) && defined(__arch64__) 23 17 __kernel_time_t sem_otime; /* last semop time */ 24 - PADDING(__pad2) 25 18 __kernel_time_t sem_ctime; /* last change time */ 19 + #else 20 + unsigned long sem_otime_high; 21 + unsigned long sem_otime; /* last semop time */ 22 + unsigned long sem_ctime_high; 23 + unsigned long sem_ctime; /* last change time */ 24 + #endif 26 25 unsigned long sem_nsems; /* no. of semaphores in array */ 27 26 unsigned long __unused1; 28 27 unsigned long __unused2; 29 28 }; 30 - #undef PADDING 31 29 32 30 #endif /* _SPARC64_SEMBUF_H */
+9 -12
arch/sparc/include/uapi/asm/shmbuf.h
··· 8 8 * between kernel and user space. 9 9 * 10 10 * Pad space is left for: 11 - * - 64-bit time_t to solve y2038 problem 12 11 * - 2 miscellaneous 32-bit values 13 12 */ 14 13 15 - #if defined(__sparc__) && defined(__arch64__) 16 - # define PADDING(x) 17 - #else 18 - # define PADDING(x) unsigned int x; 19 - #endif 20 - 21 14 struct shmid64_ds { 22 15 struct ipc64_perm shm_perm; /* operation perms */ 23 - PADDING(__pad1) 16 + #if defined(__sparc__) && defined(__arch64__) 24 17 __kernel_time_t shm_atime; /* last attach time */ 25 - PADDING(__pad2) 26 18 __kernel_time_t shm_dtime; /* last detach time */ 27 - PADDING(__pad3) 28 19 __kernel_time_t shm_ctime; /* last change time */ 20 + #else 21 + unsigned long shm_atime_high; 22 + unsigned long shm_atime; /* last attach time */ 23 + unsigned long shm_dtime_high; 24 + unsigned long shm_dtime; /* last detach time */ 25 + unsigned long shm_ctime_high; 26 + unsigned long shm_ctime; /* last change time */ 27 + #endif 29 28 size_t shm_segsz; /* size of segment (bytes) */ 30 29 __kernel_pid_t shm_cpid; /* pid of creator */ 31 30 __kernel_pid_t shm_lpid; /* pid of last operator */ ··· 44 45 unsigned long __unused3; 45 46 unsigned long __unused4; 46 47 }; 47 - 48 - #undef PADDING 49 48 50 49 #endif /* _SPARC_SHMBUF_H */
+16 -16
arch/x86/include/asm/compat.h
··· 134 134 135 135 struct compat_semid64_ds { 136 136 struct compat_ipc64_perm sem_perm; 137 - compat_time_t sem_otime; 138 - compat_ulong_t __unused1; 139 - compat_time_t sem_ctime; 140 - compat_ulong_t __unused2; 137 + compat_ulong_t sem_otime; 138 + compat_ulong_t sem_otime_high; 139 + compat_ulong_t sem_ctime; 140 + compat_ulong_t sem_ctime_high; 141 141 compat_ulong_t sem_nsems; 142 142 compat_ulong_t __unused3; 143 143 compat_ulong_t __unused4; ··· 145 145 146 146 struct compat_msqid64_ds { 147 147 struct compat_ipc64_perm msg_perm; 148 - compat_time_t msg_stime; 149 - compat_ulong_t __unused1; 150 - compat_time_t msg_rtime; 151 - compat_ulong_t __unused2; 152 - compat_time_t msg_ctime; 153 - compat_ulong_t __unused3; 148 + compat_ulong_t msg_stime; 149 + compat_ulong_t msg_stime_high; 150 + compat_ulong_t msg_rtime; 151 + compat_ulong_t msg_rtime_high; 152 + compat_ulong_t msg_ctime; 153 + compat_ulong_t msg_ctime_high; 154 154 compat_ulong_t msg_cbytes; 155 155 compat_ulong_t msg_qnum; 156 156 compat_ulong_t msg_qbytes; ··· 163 163 struct compat_shmid64_ds { 164 164 struct compat_ipc64_perm shm_perm; 165 165 compat_size_t shm_segsz; 166 - compat_time_t shm_atime; 167 - compat_ulong_t __unused1; 168 - compat_time_t shm_dtime; 169 - compat_ulong_t __unused2; 170 - compat_time_t shm_ctime; 171 - compat_ulong_t __unused3; 166 + compat_ulong_t shm_atime; 167 + compat_ulong_t shm_atime_high; 168 + compat_ulong_t shm_dtime; 169 + compat_ulong_t shm_dtime_high; 170 + compat_ulong_t shm_ctime; 171 + compat_ulong_t shm_ctime_high; 172 172 compat_pid_t shm_cpid; 173 173 compat_pid_t shm_lpid; 174 174 compat_ulong_t shm_nattch;
+2 -2
arch/x86/include/asm/intel_mid_vrtc.h
··· 4 4 5 5 extern unsigned char vrtc_cmos_read(unsigned char reg); 6 6 extern void vrtc_cmos_write(unsigned char val, unsigned char reg); 7 - extern void vrtc_get_time(struct timespec *now); 8 - extern int vrtc_set_mmss(const struct timespec *now); 7 + extern void vrtc_get_time(struct timespec64 *now); 8 + extern int vrtc_set_mmss(const struct timespec64 *now); 9 9 10 10 #endif
+2 -2
arch/x86/include/asm/mc146818rtc.h
··· 95 95 unsigned char rtc_cmos_read(unsigned char addr); 96 96 void rtc_cmos_write(unsigned char val, unsigned char addr); 97 97 98 - extern int mach_set_rtc_mmss(const struct timespec *now); 99 - extern void mach_get_cmos_time(struct timespec *now); 98 + extern int mach_set_rtc_mmss(const struct timespec64 *now); 99 + extern void mach_get_cmos_time(struct timespec64 *now); 100 100 101 101 #define RTC_IRQ 8 102 102
+1 -1
arch/x86/include/asm/pvclock.h
··· 12 12 unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src); 13 13 void pvclock_read_wallclock(struct pvclock_wall_clock *wall, 14 14 struct pvclock_vcpu_time_info *vcpu, 15 - struct timespec *ts); 15 + struct timespec64 *ts); 16 16 void pvclock_resume(void); 17 17 18 18 void pvclock_touch_watchdogs(void);
+3 -3
arch/x86/include/asm/x86_init.h
··· 170 170 void (*fixup_cpu_id)(struct cpuinfo_x86 *c, int node); 171 171 }; 172 172 173 - struct timespec; 173 + struct timespec64; 174 174 175 175 /** 176 176 * struct x86_legacy_devices - legacy x86 devices ··· 264 264 struct x86_platform_ops { 265 265 unsigned long (*calibrate_cpu)(void); 266 266 unsigned long (*calibrate_tsc)(void); 267 - void (*get_wallclock)(struct timespec *ts); 268 - int (*set_wallclock)(const struct timespec *ts); 267 + void (*get_wallclock)(struct timespec64 *ts); 268 + int (*set_wallclock)(const struct timespec64 *ts); 269 269 void (*iommu_shutdown)(void); 270 270 bool (*is_untracked_pat_range)(u64 start, u64 end); 271 271 void (*nmi_init)(void);
+10 -1
arch/x86/include/uapi/asm/sembuf.h
··· 8 8 * between kernel and user space. 9 9 * 10 10 * Pad space is left for: 11 - * - 64-bit time_t to solve y2038 problem 12 11 * - 2 miscellaneous 32-bit values 12 + * 13 + * x86_64 and x32 incorrectly added padding here, so the structures 14 + * are still incompatible with the padding on x86. 13 15 */ 14 16 struct semid64_ds { 15 17 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 18 + #ifdef __i386__ 19 + unsigned long sem_otime; /* last semop time */ 20 + unsigned long sem_otime_high; 21 + unsigned long sem_ctime; /* last change time */ 22 + unsigned long sem_ctime_high; 23 + #else 16 24 __kernel_time_t sem_otime; /* last semop time */ 17 25 __kernel_ulong_t __unused1; 18 26 __kernel_time_t sem_ctime; /* last change time */ 19 27 __kernel_ulong_t __unused2; 28 + #endif 20 29 __kernel_ulong_t sem_nsems; /* no. of semaphores in array */ 21 30 __kernel_ulong_t __unused3; 22 31 __kernel_ulong_t __unused4;
+1 -1
arch/x86/kernel/jailhouse.c
··· 37 37 return jailhouse_cpuid_base(); 38 38 } 39 39 40 - static void jailhouse_get_wallclock(struct timespec *now) 40 + static void jailhouse_get_wallclock(struct timespec64 *now) 41 41 { 42 42 memset(now, 0, sizeof(*now)); 43 43 }
+2 -2
arch/x86/kernel/kvmclock.c
··· 53 53 * have elapsed since the hypervisor wrote the data. So we try to account for 54 54 * that with system time 55 55 */ 56 - static void kvm_get_wallclock(struct timespec *now) 56 + static void kvm_get_wallclock(struct timespec64 *now) 57 57 { 58 58 struct pvclock_vcpu_time_info *vcpu_time; 59 59 int low, high; ··· 72 72 put_cpu(); 73 73 } 74 74 75 - static int kvm_set_wallclock(const struct timespec *now) 75 + static int kvm_set_wallclock(const struct timespec64 *now) 76 76 { 77 77 return -ENODEV; 78 78 }
+11 -4
arch/x86/kernel/pvclock.c
··· 123 123 124 124 void pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock, 125 125 struct pvclock_vcpu_time_info *vcpu_time, 126 - struct timespec *ts) 126 + struct timespec64 *ts) 127 127 { 128 128 u32 version; 129 129 u64 delta; 130 - struct timespec now; 130 + struct timespec64 now; 131 131 132 132 /* get wallclock at system boot */ 133 133 do { 134 134 version = wall_clock->version; 135 135 rmb(); /* fetch version before time */ 136 + /* 137 + * Note: wall_clock->sec is a u32 value, so it can 138 + * only store dates between 1970 and 2106. To allow 139 + * times beyond that, we need to create a new hypercall 140 + * interface with an extended pvclock_wall_clock structure 141 + * like ARM has. 142 + */ 136 143 now.tv_sec = wall_clock->sec; 137 144 now.tv_nsec = wall_clock->nsec; 138 145 rmb(); /* fetch time before checking version */ 139 146 } while ((wall_clock->version & 1) || (version != wall_clock->version)); 140 147 141 148 delta = pvclock_clocksource_read(vcpu_time); /* time since system boot */ 142 - delta += now.tv_sec * (u64)NSEC_PER_SEC + now.tv_nsec; 149 + delta += now.tv_sec * NSEC_PER_SEC + now.tv_nsec; 143 150 144 151 now.tv_nsec = do_div(delta, NSEC_PER_SEC); 145 152 now.tv_sec = delta; 146 153 147 - set_normalized_timespec(ts, now.tv_sec, now.tv_nsec); 154 + set_normalized_timespec64(ts, now.tv_sec, now.tv_nsec); 148 155 } 149 156 150 157 void pvclock_set_pvti_cpu0_va(struct pvclock_vsyscall_time_info *pvti)
+5 -5
arch/x86/kernel/rtc.c
··· 39 39 * jump to the next second precisely 500 ms later. Check the Motorola 40 40 * MC146818A or Dallas DS12887 data sheet for details. 41 41 */ 42 - int mach_set_rtc_mmss(const struct timespec *now) 42 + int mach_set_rtc_mmss(const struct timespec64 *now) 43 43 { 44 44 unsigned long long nowtime = now->tv_sec; 45 45 struct rtc_time tm; ··· 60 60 return retval; 61 61 } 62 62 63 - void mach_get_cmos_time(struct timespec *now) 63 + void mach_get_cmos_time(struct timespec64 *now) 64 64 { 65 65 unsigned int status, year, mon, day, hour, min, sec, century = 0; 66 66 unsigned long flags; ··· 118 118 } else 119 119 year += CMOS_YEARS_OFFS; 120 120 121 - now->tv_sec = mktime(year, mon, day, hour, min, sec); 121 + now->tv_sec = mktime64(year, mon, day, hour, min, sec); 122 122 now->tv_nsec = 0; 123 123 } 124 124 ··· 145 145 } 146 146 EXPORT_SYMBOL(rtc_cmos_write); 147 147 148 - int update_persistent_clock(struct timespec now) 148 + int update_persistent_clock64(struct timespec64 now) 149 149 { 150 150 return x86_platform.set_wallclock(&now); 151 151 } 152 152 153 153 /* not static: needed by APM */ 154 - void read_persistent_clock(struct timespec *ts) 154 + void read_persistent_clock64(struct timespec64 *ts) 155 155 { 156 156 x86_platform.get_wallclock(ts); 157 157 }
+6 -6
arch/x86/platform/intel-mid/intel_mid_vrtc.c
··· 57 57 } 58 58 EXPORT_SYMBOL_GPL(vrtc_cmos_write); 59 59 60 - void vrtc_get_time(struct timespec *now) 60 + void vrtc_get_time(struct timespec64 *now) 61 61 { 62 62 u8 sec, min, hour, mday, mon; 63 63 unsigned long flags; ··· 83 83 pr_info("vRTC: sec: %d min: %d hour: %d day: %d " 84 84 "mon: %d year: %d\n", sec, min, hour, mday, mon, year); 85 85 86 - now->tv_sec = mktime(year, mon, mday, hour, min, sec); 86 + now->tv_sec = mktime64(year, mon, mday, hour, min, sec); 87 87 now->tv_nsec = 0; 88 88 } 89 89 90 - int vrtc_set_mmss(const struct timespec *now) 90 + int vrtc_set_mmss(const struct timespec64 *now) 91 91 { 92 92 unsigned long flags; 93 93 struct rtc_time tm; 94 94 int year; 95 95 int retval = 0; 96 96 97 - rtc_time_to_tm(now->tv_sec, &tm); 97 + rtc_time64_to_tm(now->tv_sec, &tm); 98 98 if (!rtc_valid_tm(&tm) && tm.tm_year >= 72) { 99 99 /* 100 100 * tm.year is the number of years since 1900, and the ··· 110 110 vrtc_cmos_write(tm.tm_sec, RTC_SECONDS); 111 111 spin_unlock_irqrestore(&rtc_lock, flags); 112 112 } else { 113 - pr_err("%s: Invalid vRTC value: write of %lx to vRTC failed\n", 114 - __func__, now->tv_sec); 113 + pr_err("%s: Invalid vRTC value: write of %llx to vRTC failed\n", 114 + __func__, (s64)now->tv_sec); 115 115 retval = -EINVAL; 116 116 } 117 117 return retval;
+5 -5
arch/x86/xen/time.c
··· 57 57 return xen_clocksource_read(); 58 58 } 59 59 60 - static void xen_read_wallclock(struct timespec *ts) 60 + static void xen_read_wallclock(struct timespec64 *ts) 61 61 { 62 62 struct shared_info *s = HYPERVISOR_shared_info; 63 63 struct pvclock_wall_clock *wall_clock = &(s->wc); ··· 68 68 put_cpu_var(xen_vcpu); 69 69 } 70 70 71 - static void xen_get_wallclock(struct timespec *now) 71 + static void xen_get_wallclock(struct timespec64 *now) 72 72 { 73 73 xen_read_wallclock(now); 74 74 } 75 75 76 - static int xen_set_wallclock(const struct timespec *now) 76 + static int xen_set_wallclock(const struct timespec64 *now) 77 77 { 78 78 return -ENODEV; 79 79 } ··· 461 461 { 462 462 struct pvclock_vcpu_time_info *pvti; 463 463 int cpu = smp_processor_id(); 464 - struct timespec tp; 464 + struct timespec64 tp; 465 465 466 466 /* As Dom0 is never moved, no penalty on using TSC there */ 467 467 if (xen_initial_domain()) ··· 479 479 480 480 /* Set initial system time with full resolution */ 481 481 xen_read_wallclock(&tp); 482 - do_settimeofday(&tp); 482 + do_settimeofday64(&tp); 483 483 484 484 setup_force_cpu_cap(X86_FEATURE_TSC); 485 485
+12 -13
arch/xtensa/include/uapi/asm/msgbuf.h
··· 7 7 * between kernel and user space. 8 8 * 9 9 * Pad space is left for: 10 - * - 64-bit time_t to solve y2038 problem 11 10 * - 2 miscellaneous 32-bit values 12 11 * 13 12 * This file is subject to the terms and conditions of the GNU General ··· 20 21 struct msqid64_ds { 21 22 struct ipc64_perm msg_perm; 22 23 #ifdef __XTENSA_EB__ 23 - unsigned int __unused1; 24 - __kernel_time_t msg_stime; /* last msgsnd time */ 25 - unsigned int __unused2; 26 - __kernel_time_t msg_rtime; /* last msgrcv time */ 27 - unsigned int __unused3; 28 - __kernel_time_t msg_ctime; /* last change time */ 24 + unsigned long msg_stime_high; 25 + unsigned long msg_stime; /* last msgsnd time */ 26 + unsigned long msg_rtime_high; 27 + unsigned long msg_rtime; /* last msgrcv time */ 28 + unsigned long msg_ctime_high; 29 + unsigned long msg_ctime; /* last change time */ 29 30 #elif defined(__XTENSA_EL__) 30 - __kernel_time_t msg_stime; /* last msgsnd time */ 31 - unsigned int __unused1; 32 - __kernel_time_t msg_rtime; /* last msgrcv time */ 33 - unsigned int __unused2; 34 - __kernel_time_t msg_ctime; /* last change time */ 35 - unsigned int __unused3; 31 + unsigned long msg_stime; /* last msgsnd time */ 32 + unsigned long msg_stime_high; 33 + unsigned long msg_rtime; /* last msgrcv time */ 34 + unsigned long msg_rtime_high; 35 + unsigned long msg_ctime; /* last change time */ 36 + unsigned long msg_ctime_high; 36 37 #else 37 38 # error processor byte order undefined! 38 39 #endif
+8 -9
arch/xtensa/include/uapi/asm/sembuf.h
··· 14 14 * between kernel and user space. 15 15 * 16 16 * Pad space is left for: 17 - * - 64-bit time_t to solve y2038 problem 18 17 * - 2 miscellaneous 32-bit values 19 18 * 20 19 */ ··· 26 27 struct semid64_ds { 27 28 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 28 29 #ifdef __XTENSA_EL__ 29 - __kernel_time_t sem_otime; /* last semop time */ 30 - unsigned long __unused1; 31 - __kernel_time_t sem_ctime; /* last change time */ 32 - unsigned long __unused2; 30 + unsigned long sem_otime; /* last semop time */ 31 + unsigned long sem_otime_high; 32 + unsigned long sem_ctime; /* last change time */ 33 + unsigned long sem_ctime_high; 33 34 #else 34 - unsigned long __unused1; 35 - __kernel_time_t sem_otime; /* last semop time */ 36 - unsigned long __unused2; 37 - __kernel_time_t sem_ctime; /* last change time */ 35 + unsigned long sem_otime_high; 36 + unsigned long sem_otime; /* last semop time */ 37 + unsigned long sem_ctime_high; 38 + unsigned long sem_ctime; /* last change time */ 38 39 #endif 39 40 unsigned long sem_nsems; /* no. of semaphores in array */ 40 41 unsigned long __unused3;
+8 -29
arch/xtensa/include/uapi/asm/shmbuf.h
··· 4 4 * 5 5 * The shmid64_ds structure for Xtensa architecture. 6 6 * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 7 + * between kernel and user space, but the padding is on the wrong 8 + * side for big-endian xtensa, for historic reasons. 8 9 * 9 10 * Pad space is left for: 10 - * - 64-bit time_t to solve y2038 problem 11 11 * - 2 miscellaneous 32-bit values 12 12 * 13 13 * This file is subject to the terms and conditions of the GNU General Public ··· 20 20 #ifndef _XTENSA_SHMBUF_H 21 21 #define _XTENSA_SHMBUF_H 22 22 23 - #if defined (__XTENSA_EL__) 24 23 struct shmid64_ds { 25 24 struct ipc64_perm shm_perm; /* operation perms */ 26 25 size_t shm_segsz; /* size of segment (bytes) */ 27 - __kernel_time_t shm_atime; /* last attach time */ 28 - unsigned long __unused1; 29 - __kernel_time_t shm_dtime; /* last detach time */ 30 - unsigned long __unused2; 31 - __kernel_time_t shm_ctime; /* last change time */ 32 - unsigned long __unused3; 26 + unsigned long shm_atime; /* last attach time */ 27 + unsigned long shm_atime_high; 28 + unsigned long shm_dtime; /* last detach time */ 29 + unsigned long shm_dtime_high; 30 + unsigned long shm_ctime; /* last change time */ 31 + unsigned long shm_ctime_high; 33 32 __kernel_pid_t shm_cpid; /* pid of creator */ 34 33 __kernel_pid_t shm_lpid; /* pid of last operator */ 35 34 unsigned long shm_nattch; /* no. of current attaches */ 36 35 unsigned long __unused4; 37 36 unsigned long __unused5; 38 37 }; 39 - #elif defined (__XTENSA_EB__) 40 - struct shmid64_ds { 41 - struct ipc64_perm shm_perm; /* operation perms */ 42 - size_t shm_segsz; /* size of segment (bytes) */ 43 - __kernel_time_t shm_atime; /* last attach time */ 44 - unsigned long __unused1; 45 - __kernel_time_t shm_dtime; /* last detach time */ 46 - unsigned long __unused2; 47 - __kernel_time_t shm_ctime; /* last change time */ 48 - unsigned long __unused3; 49 - __kernel_pid_t shm_cpid; /* pid of creator */ 50 - __kernel_pid_t shm_lpid; /* pid of last operator */ 51 - unsigned long shm_nattch; /* no. of current attaches */ 52 - unsigned long __unused4; 53 - unsigned long __unused5; 54 - }; 55 - #else 56 - # error endian order not defined 57 - #endif 58 - 59 38 60 39 struct shminfo64 { 61 40 unsigned long shmmax;
+3 -3
include/linux/syscalls.h
··· 686 686 /* ipc/mqueue.c */ 687 687 asmlinkage long sys_mq_open(const char __user *name, int oflag, umode_t mode, struct mq_attr __user *attr); 688 688 asmlinkage long sys_mq_unlink(const char __user *name); 689 - asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); 690 - asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); 689 + asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct __kernel_timespec __user *abs_timeout); 690 + asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct __kernel_timespec __user *abs_timeout); 691 691 asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *notification); 692 692 asmlinkage long sys_mq_getsetattr(mqd_t mqdes, const struct mq_attr __user *mqstat, struct mq_attr __user *omqstat); 693 693 ··· 704 704 asmlinkage long sys_semctl(int semid, int semnum, int cmd, unsigned long arg); 705 705 asmlinkage long sys_semtimedop(int semid, struct sembuf __user *sops, 706 706 unsigned nsops, 707 - const struct timespec __user *timeout); 707 + const struct __kernel_timespec __user *timeout); 708 708 asmlinkage long sys_semop(int semid, struct sembuf __user *sops, 709 709 unsigned nsops); 710 710
+3 -15
include/linux/time32.h
··· 18 18 /* timespec64 is defined as timespec here */ 19 19 static inline struct timespec timespec64_to_timespec(const struct timespec64 ts64) 20 20 { 21 - return ts64; 21 + return *(const struct timespec *)&ts64; 22 22 } 23 23 24 24 static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) 25 25 { 26 - return ts; 26 + return *(const struct timespec64 *)&ts; 27 27 } 28 - 29 - # define timespec_equal timespec64_equal 30 - # define timespec_compare timespec64_compare 31 - # define set_normalized_timespec set_normalized_timespec64 32 - # define timespec_add timespec64_add 33 - # define timespec_sub timespec64_sub 34 - # define timespec_valid timespec64_valid 35 - # define timespec_valid_strict timespec64_valid_strict 36 - # define timespec_to_ns timespec64_to_ns 37 - # define ns_to_timespec ns_to_timespec64 38 - # define timespec_add_ns timespec64_add_ns 39 28 40 29 #else 41 30 static inline struct timespec timespec64_to_timespec(const struct timespec64 ts64) ··· 44 55 ret.tv_nsec = ts.tv_nsec; 45 56 return ret; 46 57 } 58 + #endif 47 59 48 60 static inline int timespec_equal(const struct timespec *a, 49 61 const struct timespec *b) ··· 148 158 a->tv_sec += __iter_div_u64_rem(a->tv_nsec + ns, NSEC_PER_SEC, &ns); 149 159 a->tv_nsec = ns; 150 160 } 151 - 152 - #endif 153 161 154 162 /** 155 163 * time_to_tm - converts the calendar time to local broken-down time
-7
include/linux/time64.h
··· 16 16 17 17 #include <uapi/linux/time.h> 18 18 19 - #if __BITS_PER_LONG == 64 20 - /* this trick allows us to optimize out timespec64_to_timespec */ 21 - # define timespec64 timespec 22 - #define itimerspec64 itimerspec 23 - #else 24 19 struct timespec64 { 25 20 time64_t tv_sec; /* seconds */ 26 21 long tv_nsec; /* nanoseconds */ ··· 25 30 struct timespec64 it_interval; 26 31 struct timespec64 it_value; 27 32 }; 28 - 29 - #endif 30 33 31 34 /* Parameters used to convert the timespec values: */ 32 35 #define MSEC_PER_SEC 1000L
+76 -15
include/linux/timekeeping.h
··· 19 19 extern int do_settimeofday64(const struct timespec64 *ts); 20 20 extern int do_sys_settimeofday64(const struct timespec64 *tv, 21 21 const struct timezone *tz); 22 - /* 23 - * Kernel time accessors 24 - */ 25 - struct timespec64 current_kernel_time64(void); 26 22 27 23 /* 28 24 * timespec64 based interfaces 29 25 */ 30 - struct timespec64 get_monotonic_coarse64(void); 31 - extern void getrawmonotonic64(struct timespec64 *ts); 26 + extern void ktime_get_raw_ts64(struct timespec64 *ts); 32 27 extern void ktime_get_ts64(struct timespec64 *ts); 28 + extern void ktime_get_real_ts64(struct timespec64 *tv); 29 + extern void ktime_get_coarse_ts64(struct timespec64 *ts); 30 + extern void ktime_get_coarse_real_ts64(struct timespec64 *ts); 31 + 32 + void getboottime64(struct timespec64 *ts); 33 + 34 + /* 35 + * time64_t base interfaces 36 + */ 33 37 extern time64_t ktime_get_seconds(void); 34 38 extern time64_t __ktime_get_real_seconds(void); 35 39 extern time64_t ktime_get_real_seconds(void); 36 - 37 - extern int __getnstimeofday64(struct timespec64 *tv); 38 - extern void getnstimeofday64(struct timespec64 *tv); 39 - extern void getboottime64(struct timespec64 *ts); 40 - 41 - #define ktime_get_real_ts64(ts) getnstimeofday64(ts) 42 40 43 41 /* 44 42 * ktime_t based interfaces ··· 51 53 52 54 extern ktime_t ktime_get(void); 53 55 extern ktime_t ktime_get_with_offset(enum tk_offsets offs); 56 + extern ktime_t ktime_get_coarse_with_offset(enum tk_offsets offs); 54 57 extern ktime_t ktime_mono_to_any(ktime_t tmono, enum tk_offsets offs); 55 58 extern ktime_t ktime_get_raw(void); 56 59 extern u32 ktime_get_resolution_ns(void); ··· 62 63 static inline ktime_t ktime_get_real(void) 63 64 { 64 65 return ktime_get_with_offset(TK_OFFS_REAL); 66 + } 67 + 68 + static inline ktime_t ktime_get_coarse_real(void) 69 + { 70 + return ktime_get_coarse_with_offset(TK_OFFS_REAL); 65 71 } 66 72 67 73 /** ··· 80 76 return ktime_get_with_offset(TK_OFFS_BOOT); 81 77 } 82 78 79 + static inline ktime_t ktime_get_coarse_boottime(void) 80 + { 81 + return ktime_get_coarse_with_offset(TK_OFFS_BOOT); 82 + } 83 + 83 84 /** 84 85 * ktime_get_clocktai - Returns the TAI time of day in ktime_t format 85 86 */ 86 87 static inline ktime_t ktime_get_clocktai(void) 87 88 { 88 89 return ktime_get_with_offset(TK_OFFS_TAI); 90 + } 91 + 92 + static inline ktime_t ktime_get_coarse_clocktai(void) 93 + { 94 + return ktime_get_coarse_with_offset(TK_OFFS_TAI); 89 95 } 90 96 91 97 /** ··· 137 123 extern u64 ktime_get_real_fast_ns(void); 138 124 139 125 /* 140 - * timespec64 interfaces utilizing the ktime based ones 126 + * timespec64/time64_t interfaces utilizing the ktime based ones 127 + * for API completeness, these could be implemented more efficiently 128 + * if needed. 141 129 */ 142 - static inline void get_monotonic_boottime64(struct timespec64 *ts) 130 + static inline void ktime_get_boottime_ts64(struct timespec64 *ts) 143 131 { 144 132 *ts = ktime_to_timespec64(ktime_get_boottime()); 145 133 } 146 134 147 - static inline void timekeeping_clocktai64(struct timespec64 *ts) 135 + static inline void ktime_get_coarse_boottime_ts64(struct timespec64 *ts) 136 + { 137 + *ts = ktime_to_timespec64(ktime_get_coarse_boottime()); 138 + } 139 + 140 + static inline time64_t ktime_get_boottime_seconds(void) 141 + { 142 + return ktime_divns(ktime_get_coarse_boottime(), NSEC_PER_SEC); 143 + } 144 + 145 + static inline void ktime_get_clocktai_ts64(struct timespec64 *ts) 148 146 { 149 147 *ts = ktime_to_timespec64(ktime_get_clocktai()); 148 + } 149 + 150 + static inline void ktime_get_coarse_clocktai_ts64(struct timespec64 *ts) 151 + { 152 + *ts = ktime_to_timespec64(ktime_get_coarse_clocktai()); 153 + } 154 + 155 + static inline time64_t ktime_get_clocktai_seconds(void) 156 + { 157 + return ktime_divns(ktime_get_coarse_clocktai(), NSEC_PER_SEC); 150 158 } 151 159 152 160 /* ··· 246 210 extern void read_boot_clock64(struct timespec64 *ts); 247 211 extern int update_persistent_clock64(struct timespec64 now); 248 212 213 + /* 214 + * deprecated aliases, don't use in new code 215 + */ 216 + #define getnstimeofday64(ts) ktime_get_real_ts64(ts) 217 + #define get_monotonic_boottime64(ts) ktime_get_boottime_ts64(ts) 218 + #define getrawmonotonic64(ts) ktime_get_raw_ts64(ts) 219 + #define timekeeping_clocktai64(ts) ktime_get_clocktai_ts64(ts) 220 + 221 + static inline struct timespec64 current_kernel_time64(void) 222 + { 223 + struct timespec64 ts; 224 + 225 + ktime_get_coarse_real_ts64(&ts); 226 + 227 + return ts; 228 + } 229 + 230 + static inline struct timespec64 get_monotonic_coarse64(void) 231 + { 232 + struct timespec64 ts; 233 + 234 + ktime_get_coarse_ts64(&ts); 235 + 236 + return ts; 237 + } 249 238 250 239 #endif
+12 -60
include/linux/timekeeping32.h
··· 11 11 12 12 static inline struct timespec current_kernel_time(void) 13 13 { 14 - struct timespec64 now = current_kernel_time64(); 14 + struct timespec64 ts64; 15 15 16 - return timespec64_to_timespec(now); 16 + ktime_get_coarse_real_ts64(&ts64); 17 + 18 + return timespec64_to_timespec(ts64); 17 19 } 18 20 19 - #if BITS_PER_LONG == 64 20 - /** 21 - * Deprecated. Use do_settimeofday64(). 22 - */ 23 - static inline int do_settimeofday(const struct timespec *ts) 24 - { 25 - return do_settimeofday64(ts); 26 - } 27 - 28 - static inline int __getnstimeofday(struct timespec *ts) 29 - { 30 - return __getnstimeofday64(ts); 31 - } 32 - 33 - static inline void getnstimeofday(struct timespec *ts) 34 - { 35 - getnstimeofday64(ts); 36 - } 37 - 38 - static inline void ktime_get_ts(struct timespec *ts) 39 - { 40 - ktime_get_ts64(ts); 41 - } 42 - 43 - static inline void ktime_get_real_ts(struct timespec *ts) 44 - { 45 - getnstimeofday64(ts); 46 - } 47 - 48 - static inline void getrawmonotonic(struct timespec *ts) 49 - { 50 - getrawmonotonic64(ts); 51 - } 52 - 53 - static inline struct timespec get_monotonic_coarse(void) 54 - { 55 - return get_monotonic_coarse64(); 56 - } 57 - 58 - static inline void getboottime(struct timespec *ts) 59 - { 60 - return getboottime64(ts); 61 - } 62 - #else 63 21 /** 64 22 * Deprecated. Use do_settimeofday64(). 65 23 */ ··· 29 71 return do_settimeofday64(&ts64); 30 72 } 31 73 32 - static inline int __getnstimeofday(struct timespec *ts) 33 - { 34 - struct timespec64 ts64; 35 - int ret = __getnstimeofday64(&ts64); 36 - 37 - *ts = timespec64_to_timespec(ts64); 38 - return ret; 39 - } 40 - 41 74 static inline void getnstimeofday(struct timespec *ts) 42 75 { 43 76 struct timespec64 ts64; 44 77 45 - getnstimeofday64(&ts64); 78 + ktime_get_real_ts64(&ts64); 46 79 *ts = timespec64_to_timespec(ts64); 47 80 } 48 81 ··· 49 100 { 50 101 struct timespec64 ts64; 51 102 52 - getnstimeofday64(&ts64); 103 + ktime_get_real_ts64(&ts64); 53 104 *ts = timespec64_to_timespec(ts64); 54 105 } 55 106 ··· 57 108 { 58 109 struct timespec64 ts64; 59 110 60 - getrawmonotonic64(&ts64); 111 + ktime_get_raw_ts64(&ts64); 61 112 *ts = timespec64_to_timespec(ts64); 62 113 } 63 114 64 115 static inline struct timespec get_monotonic_coarse(void) 65 116 { 66 - return timespec64_to_timespec(get_monotonic_coarse64()); 117 + struct timespec64 ts64; 118 + 119 + ktime_get_coarse_ts64(&ts64); 120 + 121 + return timespec64_to_timespec(ts64); 67 122 } 68 123 69 124 static inline void getboottime(struct timespec *ts) ··· 77 124 getboottime64(&ts64); 78 125 *ts = timespec64_to_timespec(ts64); 79 126 } 80 - #endif 81 127 82 128 /* 83 129 * Timespec interfaces utilizing the ktime based ones
+13 -14
include/uapi/asm-generic/msgbuf.h
··· 18 18 * On big-endian systems, the padding is in the wrong place. 19 19 * 20 20 * Pad space is left for: 21 - * - 64-bit time_t to solve y2038 problem 22 21 * - 2 miscellaneous 32-bit values 23 22 */ 24 23 25 24 struct msqid64_ds { 26 25 struct ipc64_perm msg_perm; 26 + #if __BITS_PER_LONG == 64 27 27 __kernel_time_t msg_stime; /* last msgsnd time */ 28 - #if __BITS_PER_LONG != 64 29 - unsigned long __unused1; 30 - #endif 31 28 __kernel_time_t msg_rtime; /* last msgrcv time */ 32 - #if __BITS_PER_LONG != 64 33 - unsigned long __unused2; 34 - #endif 35 29 __kernel_time_t msg_ctime; /* last change time */ 36 - #if __BITS_PER_LONG != 64 37 - unsigned long __unused3; 30 + #else 31 + unsigned long msg_stime; /* last msgsnd time */ 32 + unsigned long msg_stime_high; 33 + unsigned long msg_rtime; /* last msgrcv time */ 34 + unsigned long msg_rtime_high; 35 + unsigned long msg_ctime; /* last change time */ 36 + unsigned long msg_ctime_high; 38 37 #endif 39 - __kernel_ulong_t msg_cbytes; /* current number of bytes on queue */ 40 - __kernel_ulong_t msg_qnum; /* number of messages in queue */ 41 - __kernel_ulong_t msg_qbytes; /* max number of bytes on queue */ 38 + unsigned long msg_cbytes; /* current number of bytes on queue */ 39 + unsigned long msg_qnum; /* number of messages in queue */ 40 + unsigned long msg_qbytes; /* max number of bytes on queue */ 42 41 __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 43 42 __kernel_pid_t msg_lrpid; /* last receive pid */ 44 - __kernel_ulong_t __unused4; 45 - __kernel_ulong_t __unused5; 43 + unsigned long __unused4; 44 + unsigned long __unused5; 46 45 }; 47 46 48 47 #endif /* __ASM_GENERIC_MSGBUF_H */
+16 -10
include/uapi/asm-generic/sembuf.h
··· 13 13 * everyone just ended up making identical copies without specific 14 14 * optimizations, so we may just as well all use the same one. 15 15 * 16 - * 64 bit architectures typically define a 64 bit __kernel_time_t, 16 + * 64 bit architectures use a 64-bit __kernel_time_t here, while 17 + * 32 bit architectures have a pair of unsigned long values. 17 18 * so they do not need the first two padding words. 18 - * On big-endian systems, the padding is in the wrong place. 19 19 * 20 - * Pad space is left for: 21 - * - 64-bit time_t to solve y2038 problem 22 - * - 2 miscellaneous 32-bit values 20 + * On big-endian systems, the padding is in the wrong place for 21 + * historic reasons, so user space has to reconstruct a time_t 22 + * value using 23 + * 24 + * user_semid_ds.sem_otime = kernel_semid64_ds.sem_otime + 25 + * ((long long)kernel_semid64_ds.sem_otime_high << 32) 26 + * 27 + * Pad space is left for 2 miscellaneous 32-bit values 23 28 */ 24 29 struct semid64_ds { 25 30 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ 31 + #if __BITS_PER_LONG == 64 26 32 __kernel_time_t sem_otime; /* last semop time */ 27 - #if __BITS_PER_LONG != 64 28 - unsigned long __unused1; 29 - #endif 30 33 __kernel_time_t sem_ctime; /* last change time */ 31 - #if __BITS_PER_LONG != 64 32 - unsigned long __unused2; 34 + #else 35 + unsigned long sem_otime; /* last semop time */ 36 + unsigned long sem_otime_high; 37 + unsigned long sem_ctime; /* last change time */ 38 + unsigned long sem_ctime_high; 33 39 #endif 34 40 unsigned long sem_nsems; /* no. of semaphores in array */ 35 41 unsigned long __unused3;
+20 -21
include/uapi/asm-generic/shmbuf.h
··· 19 19 * 20 20 * 21 21 * Pad space is left for: 22 - * - 64-bit time_t to solve y2038 problem 23 22 * - 2 miscellaneous 32-bit values 24 23 */ 25 24 26 25 struct shmid64_ds { 27 26 struct ipc64_perm shm_perm; /* operation perms */ 28 27 size_t shm_segsz; /* size of segment (bytes) */ 28 + #if __BITS_PER_LONG == 64 29 29 __kernel_time_t shm_atime; /* last attach time */ 30 - #if __BITS_PER_LONG != 64 31 - unsigned long __unused1; 32 - #endif 33 30 __kernel_time_t shm_dtime; /* last detach time */ 34 - #if __BITS_PER_LONG != 64 35 - unsigned long __unused2; 36 - #endif 37 31 __kernel_time_t shm_ctime; /* last change time */ 38 - #if __BITS_PER_LONG != 64 39 - unsigned long __unused3; 32 + #else 33 + unsigned long shm_atime; /* last attach time */ 34 + unsigned long shm_atime_high; 35 + unsigned long shm_dtime; /* last detach time */ 36 + unsigned long shm_dtime_high; 37 + unsigned long shm_ctime; /* last change time */ 38 + unsigned long shm_ctime_high; 40 39 #endif 41 40 __kernel_pid_t shm_cpid; /* pid of creator */ 42 41 __kernel_pid_t shm_lpid; /* pid of last operator */ 43 - __kernel_ulong_t shm_nattch; /* no. of current attaches */ 44 - __kernel_ulong_t __unused4; 45 - __kernel_ulong_t __unused5; 42 + unsigned long shm_nattch; /* no. of current attaches */ 43 + unsigned long __unused4; 44 + unsigned long __unused5; 46 45 }; 47 46 48 47 struct shminfo64 { 49 - __kernel_ulong_t shmmax; 50 - __kernel_ulong_t shmmin; 51 - __kernel_ulong_t shmmni; 52 - __kernel_ulong_t shmseg; 53 - __kernel_ulong_t shmall; 54 - __kernel_ulong_t __unused1; 55 - __kernel_ulong_t __unused2; 56 - __kernel_ulong_t __unused3; 57 - __kernel_ulong_t __unused4; 48 + unsigned long shmmax; 49 + unsigned long shmmin; 50 + unsigned long shmmni; 51 + unsigned long shmseg; 52 + unsigned long shmall; 53 + unsigned long __unused1; 54 + unsigned long __unused2; 55 + unsigned long __unused3; 56 + unsigned long __unused4; 58 57 }; 59 58 60 59 #endif /* __ASM_GENERIC_SHMBUF_H */
+44 -42
ipc/mqueue.c
··· 691 691 wake_up(&info->wait_q); 692 692 } 693 693 694 - static int prepare_timeout(const struct timespec __user *u_abs_timeout, 694 + static int prepare_timeout(const struct __kernel_timespec __user *u_abs_timeout, 695 695 struct timespec64 *ts) 696 696 { 697 697 if (get_timespec64(ts, u_abs_timeout)) ··· 1128 1128 1129 1129 SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes, const char __user *, u_msg_ptr, 1130 1130 size_t, msg_len, unsigned int, msg_prio, 1131 - const struct timespec __user *, u_abs_timeout) 1131 + const struct __kernel_timespec __user *, u_abs_timeout) 1132 1132 { 1133 1133 struct timespec64 ts, *p = NULL; 1134 1134 if (u_abs_timeout) { ··· 1142 1142 1143 1143 SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes, char __user *, u_msg_ptr, 1144 1144 size_t, msg_len, unsigned int __user *, u_msg_prio, 1145 - const struct timespec __user *, u_abs_timeout) 1145 + const struct __kernel_timespec __user *, u_abs_timeout) 1146 1146 { 1147 1147 struct timespec64 ts, *p = NULL; 1148 1148 if (u_abs_timeout) { ··· 1420 1420 return do_mq_open(u_name, oflag, mode, p); 1421 1421 } 1422 1422 1423 + COMPAT_SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes, 1424 + const struct compat_sigevent __user *, u_notification) 1425 + { 1426 + struct sigevent n, *p = NULL; 1427 + if (u_notification) { 1428 + if (get_compat_sigevent(&n, u_notification)) 1429 + return -EFAULT; 1430 + if (n.sigev_notify == SIGEV_THREAD) 1431 + n.sigev_value.sival_ptr = compat_ptr(n.sigev_value.sival_int); 1432 + p = &n; 1433 + } 1434 + return do_mq_notify(mqdes, p); 1435 + } 1436 + 1437 + COMPAT_SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, 1438 + const struct compat_mq_attr __user *, u_mqstat, 1439 + struct compat_mq_attr __user *, u_omqstat) 1440 + { 1441 + int ret; 1442 + struct mq_attr mqstat, omqstat; 1443 + struct mq_attr *new = NULL, *old = NULL; 1444 + 1445 + if (u_mqstat) { 1446 + new = &mqstat; 1447 + if (get_compat_mq_attr(new, u_mqstat)) 1448 + return -EFAULT; 1449 + } 1450 + if (u_omqstat) 1451 + old = &omqstat; 1452 + 1453 + ret = do_mq_getsetattr(mqdes, new, old); 1454 + if (ret || !old) 1455 + return ret; 1456 + 1457 + if (put_compat_mq_attr(old, u_omqstat)) 1458 + return -EFAULT; 1459 + return 0; 1460 + } 1461 + #endif 1462 + 1463 + #ifdef CONFIG_COMPAT_32BIT_TIME 1423 1464 static int compat_prepare_timeout(const struct compat_timespec __user *p, 1424 1465 struct timespec64 *ts) 1425 1466 { ··· 1499 1458 p = &ts; 1500 1459 } 1501 1460 return do_mq_timedreceive(mqdes, u_msg_ptr, msg_len, u_msg_prio, p); 1502 - } 1503 - 1504 - COMPAT_SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes, 1505 - const struct compat_sigevent __user *, u_notification) 1506 - { 1507 - struct sigevent n, *p = NULL; 1508 - if (u_notification) { 1509 - if (get_compat_sigevent(&n, u_notification)) 1510 - return -EFAULT; 1511 - if (n.sigev_notify == SIGEV_THREAD) 1512 - n.sigev_value.sival_ptr = compat_ptr(n.sigev_value.sival_int); 1513 - p = &n; 1514 - } 1515 - return do_mq_notify(mqdes, p); 1516 - } 1517 - 1518 - COMPAT_SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes, 1519 - const struct compat_mq_attr __user *, u_mqstat, 1520 - struct compat_mq_attr __user *, u_omqstat) 1521 - { 1522 - int ret; 1523 - struct mq_attr mqstat, omqstat; 1524 - struct mq_attr *new = NULL, *old = NULL; 1525 - 1526 - if (u_mqstat) { 1527 - new = &mqstat; 1528 - if (get_compat_mq_attr(new, u_mqstat)) 1529 - return -EFAULT; 1530 - } 1531 - if (u_omqstat) 1532 - old = &omqstat; 1533 - 1534 - ret = do_mq_getsetattr(mqdes, new, old); 1535 - if (ret || !old) 1536 - return ret; 1537 - 1538 - if (put_compat_mq_attr(old, u_omqstat)) 1539 - return -EFAULT; 1540 - return 0; 1541 1461 } 1542 1462 #endif 1543 1463
+14 -6
ipc/msg.c
··· 537 537 p->msg_stime = msq->q_stime; 538 538 p->msg_rtime = msq->q_rtime; 539 539 p->msg_ctime = msq->q_ctime; 540 + #ifndef CONFIG_64BIT 541 + p->msg_stime_high = msq->q_stime >> 32; 542 + p->msg_rtime_high = msq->q_rtime >> 32; 543 + p->msg_ctime_high = msq->q_ctime >> 32; 544 + #endif 540 545 p->msg_cbytes = msq->q_cbytes; 541 546 p->msg_qnum = msq->q_qnum; 542 547 p->msg_qbytes = msq->q_qbytes; ··· 651 646 struct compat_msqid64_ds v; 652 647 memset(&v, 0, sizeof(v)); 653 648 to_compat_ipc64_perm(&v.msg_perm, &in->msg_perm); 654 - v.msg_stime = in->msg_stime; 655 - v.msg_rtime = in->msg_rtime; 656 - v.msg_ctime = in->msg_ctime; 649 + v.msg_stime = lower_32_bits(in->msg_stime); 650 + v.msg_stime_high = upper_32_bits(in->msg_stime); 651 + v.msg_rtime = lower_32_bits(in->msg_rtime); 652 + v.msg_rtime_high = upper_32_bits(in->msg_rtime); 653 + v.msg_ctime = lower_32_bits(in->msg_ctime); 654 + v.msg_ctime_high = upper_32_bits(in->msg_ctime); 657 655 v.msg_cbytes = in->msg_cbytes; 658 656 v.msg_qnum = in->msg_qnum; 659 657 v.msg_qbytes = in->msg_qbytes; ··· 766 758 WRITE_ONCE(msr->r_msg, ERR_PTR(-E2BIG)); 767 759 } else { 768 760 ipc_update_pid(&msq->q_lrpid, task_pid(msr->r_tsk)); 769 - msq->q_rtime = get_seconds(); 761 + msq->q_rtime = ktime_get_real_seconds(); 770 762 771 763 wake_q_add(wake_q, msr->r_tsk); 772 764 WRITE_ONCE(msr->r_msg, msg); ··· 867 859 } 868 860 869 861 ipc_update_pid(&msq->q_lspid, task_tgid(current)); 870 - msq->q_stime = get_seconds(); 862 + msq->q_stime = ktime_get_real_seconds(); 871 863 872 864 if (!pipelined_send(msq, msg, &wake_q)) { 873 865 /* no one is waiting for this message, enqueue it */ ··· 1095 1087 1096 1088 list_del(&msg->m_list); 1097 1089 msq->q_qnum--; 1098 - msq->q_rtime = get_seconds(); 1090 + msq->q_rtime = ktime_get_real_seconds(); 1099 1091 ipc_update_pid(&msq->q_lrpid, task_tgid(current)); 1100 1092 msq->q_cbytes -= msg->m_ts; 1101 1093 atomic_sub(msg->m_ts, &ns->msg_bytes);
+18 -9
ipc/sem.c
··· 70 70 * The worst-case behavior is nevertheless O(N^2) for N wakeups. 71 71 */ 72 72 73 + #include <linux/compat.h> 73 74 #include <linux/slab.h> 74 75 #include <linux/spinlock.h> 75 76 #include <linux/init.h> ··· 105 104 /* that alter the semaphore */ 106 105 struct list_head pending_const; /* pending single-sop operations */ 107 106 /* that do not alter the semaphore*/ 108 - time_t sem_otime; /* candidate for sem_otime */ 107 + time64_t sem_otime; /* candidate for sem_otime */ 109 108 } ____cacheline_aligned_in_smp; 110 109 111 110 /* One sem_array data structure for each set of semaphores in the system. */ ··· 985 984 static void set_semotime(struct sem_array *sma, struct sembuf *sops) 986 985 { 987 986 if (sops == NULL) { 988 - sma->sems[0].sem_otime = get_seconds(); 987 + sma->sems[0].sem_otime = ktime_get_real_seconds(); 989 988 } else { 990 989 sma->sems[sops[0].sem_num].sem_otime = 991 - get_seconds(); 990 + ktime_get_real_seconds(); 992 991 } 993 992 } 994 993 ··· 1215 1214 int cmd, struct semid64_ds *semid64) 1216 1215 { 1217 1216 struct sem_array *sma; 1217 + time64_t semotime; 1218 1218 int id = 0; 1219 1219 int err; 1220 1220 ··· 1259 1257 } 1260 1258 1261 1259 kernel_to_ipc64_perm(&sma->sem_perm, &semid64->sem_perm); 1262 - semid64->sem_otime = get_semotime(sma); 1260 + semotime = get_semotime(sma); 1261 + semid64->sem_otime = semotime; 1263 1262 semid64->sem_ctime = sma->sem_ctime; 1263 + #ifndef CONFIG_64BIT 1264 + semid64->sem_otime_high = semotime >> 32; 1265 + semid64->sem_ctime_high = sma->sem_ctime >> 32; 1266 + #endif 1264 1267 semid64->sem_nsems = sma->sem_nsems; 1265 1268 1266 1269 ipc_unlock_object(&sma->sem_perm); ··· 1711 1704 struct compat_semid64_ds v; 1712 1705 memset(&v, 0, sizeof(v)); 1713 1706 to_compat_ipc64_perm(&v.sem_perm, &in->sem_perm); 1714 - v.sem_otime = in->sem_otime; 1715 - v.sem_ctime = in->sem_ctime; 1707 + v.sem_otime = lower_32_bits(in->sem_otime); 1708 + v.sem_otime_high = upper_32_bits(in->sem_otime); 1709 + v.sem_ctime = lower_32_bits(in->sem_ctime); 1710 + v.sem_ctime_high = upper_32_bits(in->sem_ctime); 1716 1711 v.sem_nsems = in->sem_nsems; 1717 1712 return copy_to_user(buf, &v, sizeof(v)); 1718 1713 } else { ··· 2177 2168 } 2178 2169 2179 2170 long ksys_semtimedop(int semid, struct sembuf __user *tsops, 2180 - unsigned int nsops, const struct timespec __user *timeout) 2171 + unsigned int nsops, const struct __kernel_timespec __user *timeout) 2181 2172 { 2182 2173 if (timeout) { 2183 2174 struct timespec64 ts; ··· 2189 2180 } 2190 2181 2191 2182 SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops, 2192 - unsigned int, nsops, const struct timespec __user *, timeout) 2183 + unsigned int, nsops, const struct __kernel_timespec __user *, timeout) 2193 2184 { 2194 2185 return ksys_semtimedop(semid, tsops, nsops, timeout); 2195 2186 } 2196 2187 2197 - #ifdef CONFIG_COMPAT 2188 + #ifdef CONFIG_COMPAT_32BIT_TIME 2198 2189 long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems, 2199 2190 unsigned int nsops, 2200 2191 const struct compat_timespec __user *timeout)
+11 -3
ipc/shm.c
··· 1002 1002 tbuf->shm_atime = shp->shm_atim; 1003 1003 tbuf->shm_dtime = shp->shm_dtim; 1004 1004 tbuf->shm_ctime = shp->shm_ctim; 1005 + #ifndef CONFIG_64BIT 1006 + tbuf->shm_atime_high = shp->shm_atim >> 32; 1007 + tbuf->shm_dtime_high = shp->shm_dtim >> 32; 1008 + tbuf->shm_ctime_high = shp->shm_ctim >> 32; 1009 + #endif 1005 1010 tbuf->shm_cpid = pid_vnr(shp->shm_cprid); 1006 1011 tbuf->shm_lpid = pid_vnr(shp->shm_lprid); 1007 1012 tbuf->shm_nattch = shp->shm_nattch; ··· 1238 1233 struct compat_shmid64_ds v; 1239 1234 memset(&v, 0, sizeof(v)); 1240 1235 to_compat_ipc64_perm(&v.shm_perm, &in->shm_perm); 1241 - v.shm_atime = in->shm_atime; 1242 - v.shm_dtime = in->shm_dtime; 1243 - v.shm_ctime = in->shm_ctime; 1236 + v.shm_atime = lower_32_bits(in->shm_atime); 1237 + v.shm_atime_high = upper_32_bits(in->shm_atime); 1238 + v.shm_dtime = lower_32_bits(in->shm_dtime); 1239 + v.shm_dtime_high = upper_32_bits(in->shm_dtime); 1240 + v.shm_ctime = lower_32_bits(in->shm_ctime); 1241 + v.shm_ctime_high = upper_32_bits(in->shm_ctime); 1244 1242 v.shm_segsz = in->shm_segsz; 1245 1243 v.shm_nattch = in->shm_nattch; 1246 1244 v.shm_cpid = in->shm_cpid;
+10 -3
ipc/syscall.c
··· 30 30 return ksys_semtimedop(first, (struct sembuf __user *)ptr, 31 31 second, NULL); 32 32 case SEMTIMEDOP: 33 - return ksys_semtimedop(first, (struct sembuf __user *)ptr, 34 - second, 35 - (const struct timespec __user *)fifth); 33 + if (IS_ENABLED(CONFIG_64BIT) || !IS_ENABLED(CONFIG_64BIT_TIME)) 34 + return ksys_semtimedop(first, ptr, second, 35 + (const struct __kernel_timespec __user *)fifth); 36 + else if (IS_ENABLED(CONFIG_COMPAT_32BIT_TIME)) 37 + return compat_ksys_semtimedop(first, ptr, second, 38 + (const struct compat_timespec __user *)fifth); 39 + else 40 + return -ENOSYS; 36 41 37 42 case SEMGET: 38 43 return ksys_semget(first, second, third); ··· 135 130 /* struct sembuf is the same on 32 and 64bit :)) */ 136 131 return ksys_semtimedop(first, compat_ptr(ptr), second, NULL); 137 132 case SEMTIMEDOP: 133 + if (!IS_ENABLED(CONFIG_COMPAT_32BIT_TIME)) 134 + return -ENOSYS; 138 135 return compat_ksys_semtimedop(first, compat_ptr(ptr), second, 139 136 compat_ptr(fifth)); 140 137 case SEMGET:
+2 -2
ipc/util.h
··· 251 251 /* for __ARCH_WANT_SYS_IPC */ 252 252 long ksys_semtimedop(int semid, struct sembuf __user *tsops, 253 253 unsigned int nsops, 254 - const struct timespec __user *timeout); 254 + const struct __kernel_timespec __user *timeout); 255 255 long ksys_semget(key_t key, int nsems, int semflg); 256 256 long ksys_semctl(int semid, int semnum, int cmd, unsigned long arg); 257 257 long ksys_msgget(key_t key, int msgflg); ··· 265 265 long ksys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); 266 266 267 267 /* for CONFIG_ARCH_WANT_OLD_COMPAT_IPC */ 268 - #ifdef CONFIG_COMPAT 269 268 long compat_ksys_semtimedop(int semid, struct sembuf __user *tsems, 270 269 unsigned int nsops, 271 270 const struct compat_timespec __user *timeout); 271 + #ifdef CONFIG_COMPAT 272 272 long compat_ksys_semctl(int semid, int semnum, int cmd, int arg); 273 273 long compat_ksys_msgctl(int msqid, int cmd, void __user *uptr); 274 274 long compat_ksys_msgrcv(int msqid, compat_uptr_t msgp, compat_ssize_t msgsz,
-2
kernel/time/time.c
··· 407 407 } 408 408 EXPORT_SYMBOL(mktime64); 409 409 410 - #if __BITS_PER_LONG == 32 411 410 /** 412 411 * set_normalized_timespec - set timespec sec and nsec parts and normalize 413 412 * ··· 467 468 return ts; 468 469 } 469 470 EXPORT_SYMBOL(ns_to_timespec); 470 - #endif 471 471 472 472 /** 473 473 * ns_to_timeval - Convert nanoseconds to timeval
+34 -39
kernel/time/timekeeping.c
··· 705 705 } 706 706 707 707 /** 708 - * __getnstimeofday64 - Returns the time of day in a timespec64. 708 + * ktime_get_real_ts64 - Returns the time of day in a timespec64. 709 709 * @ts: pointer to the timespec to be set 710 710 * 711 - * Updates the time of day in the timespec. 712 - * Returns 0 on success, or -ve when suspended (timespec will be undefined). 711 + * Returns the time of day in a timespec64 (WARN if suspended). 713 712 */ 714 - int __getnstimeofday64(struct timespec64 *ts) 713 + void ktime_get_real_ts64(struct timespec64 *ts) 715 714 { 716 715 struct timekeeper *tk = &tk_core.timekeeper; 717 716 unsigned long seq; 718 717 u64 nsecs; 718 + 719 + WARN_ON(timekeeping_suspended); 719 720 720 721 do { 721 722 seq = read_seqcount_begin(&tk_core.seq); ··· 728 727 729 728 ts->tv_nsec = 0; 730 729 timespec64_add_ns(ts, nsecs); 731 - 732 - /* 733 - * Do not bail out early, in case there were callers still using 734 - * the value, even in the face of the WARN_ON. 735 - */ 736 - if (unlikely(timekeeping_suspended)) 737 - return -EAGAIN; 738 - return 0; 739 730 } 740 - EXPORT_SYMBOL(__getnstimeofday64); 741 - 742 - /** 743 - * getnstimeofday64 - Returns the time of day in a timespec64. 744 - * @ts: pointer to the timespec64 to be set 745 - * 746 - * Returns the time of day in a timespec64 (WARN if suspended). 747 - */ 748 - void getnstimeofday64(struct timespec64 *ts) 749 - { 750 - WARN_ON(__getnstimeofday64(ts)); 751 - } 752 - EXPORT_SYMBOL(getnstimeofday64); 731 + EXPORT_SYMBOL(ktime_get_real_ts64); 753 732 754 733 ktime_t ktime_get(void) 755 734 { ··· 794 813 795 814 } 796 815 EXPORT_SYMBOL_GPL(ktime_get_with_offset); 816 + 817 + ktime_t ktime_get_coarse_with_offset(enum tk_offsets offs) 818 + { 819 + struct timekeeper *tk = &tk_core.timekeeper; 820 + unsigned int seq; 821 + ktime_t base, *offset = offsets[offs]; 822 + 823 + WARN_ON(timekeeping_suspended); 824 + 825 + do { 826 + seq = read_seqcount_begin(&tk_core.seq); 827 + base = ktime_add(tk->tkr_mono.base, *offset); 828 + 829 + } while (read_seqcount_retry(&tk_core.seq, seq)); 830 + 831 + return base; 832 + 833 + } 834 + EXPORT_SYMBOL_GPL(ktime_get_coarse_with_offset); 797 835 798 836 /** 799 837 * ktime_mono_to_any() - convert mononotic time to any other time ··· 1410 1410 } 1411 1411 1412 1412 /** 1413 - * getrawmonotonic64 - Returns the raw monotonic time in a timespec 1413 + * ktime_get_raw_ts64 - Returns the raw monotonic time in a timespec 1414 1414 * @ts: pointer to the timespec64 to be set 1415 1415 * 1416 1416 * Returns the raw monotonic time (completely un-modified by ntp) 1417 1417 */ 1418 - void getrawmonotonic64(struct timespec64 *ts) 1418 + void ktime_get_raw_ts64(struct timespec64 *ts) 1419 1419 { 1420 1420 struct timekeeper *tk = &tk_core.timekeeper; 1421 1421 unsigned long seq; ··· 1431 1431 ts->tv_nsec = 0; 1432 1432 timespec64_add_ns(ts, nsecs); 1433 1433 } 1434 - EXPORT_SYMBOL(getrawmonotonic64); 1434 + EXPORT_SYMBOL(ktime_get_raw_ts64); 1435 1435 1436 1436 1437 1437 /** ··· 2133 2133 } 2134 2134 EXPORT_SYMBOL(get_seconds); 2135 2135 2136 - struct timespec64 current_kernel_time64(void) 2136 + void ktime_get_coarse_real_ts64(struct timespec64 *ts) 2137 2137 { 2138 2138 struct timekeeper *tk = &tk_core.timekeeper; 2139 - struct timespec64 now; 2140 2139 unsigned long seq; 2141 2140 2142 2141 do { 2143 2142 seq = read_seqcount_begin(&tk_core.seq); 2144 2143 2145 - now = tk_xtime(tk); 2144 + *ts = tk_xtime(tk); 2146 2145 } while (read_seqcount_retry(&tk_core.seq, seq)); 2147 - 2148 - return now; 2149 2146 } 2150 - EXPORT_SYMBOL(current_kernel_time64); 2147 + EXPORT_SYMBOL(ktime_get_coarse_real_ts64); 2151 2148 2152 - struct timespec64 get_monotonic_coarse64(void) 2149 + void ktime_get_coarse_ts64(struct timespec64 *ts) 2153 2150 { 2154 2151 struct timekeeper *tk = &tk_core.timekeeper; 2155 2152 struct timespec64 now, mono; ··· 2159 2162 mono = tk->wall_to_monotonic; 2160 2163 } while (read_seqcount_retry(&tk_core.seq, seq)); 2161 2164 2162 - set_normalized_timespec64(&now, now.tv_sec + mono.tv_sec, 2165 + set_normalized_timespec64(ts, now.tv_sec + mono.tv_sec, 2163 2166 now.tv_nsec + mono.tv_nsec); 2164 - 2165 - return now; 2166 2167 } 2167 - EXPORT_SYMBOL(get_monotonic_coarse64); 2168 + EXPORT_SYMBOL(ktime_get_coarse_ts64); 2168 2169 2169 2170 /* 2170 2171 * Must hold jiffies_lock