aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepa Dinamani <deepa.kernel@gmail.com>2018-03-14 00:03:25 -0400
committerArnd Bergmann <arnd@arndb.de>2018-04-19 07:29:54 -0400
commit0d55303c51a4f35f674617e415632d492b596c26 (patch)
tree824f5359a6648da9824d06a77ef787e79d141580
parente4da0d6872db4aa12426057cb67059c4dee7df09 (diff)
compat: Move compat_timespec/ timeval to compat_time.h
All the current architecture specific defines for these are the same. Refactor these common defines to a common header file. The new common linux/compat_time.h is also useful as it will eventually be used to hold all the defines that are needed for compat time types that support non y2038 safe types. New architectures need not have to define these new types as they will only use new y2038 safe syscalls. This file can be deleted after y2038 when we stop supporting non y2038 safe syscalls. The patch also requires an operation similar to: git grep "asm/compat\.h" | cut -d ":" -f 1 | xargs -n 1 sed -i -e "s%asm/compat.h%linux/compat.h%g" Cc: acme@kernel.org Cc: benh@kernel.crashing.org Cc: borntraeger@de.ibm.com Cc: catalin.marinas@arm.com Cc: cmetcalf@mellanox.com Cc: cohuck@redhat.com Cc: davem@davemloft.net Cc: deller@gmx.de Cc: devel@driverdev.osuosl.org Cc: gerald.schaefer@de.ibm.com Cc: gregkh@linuxfoundation.org Cc: heiko.carstens@de.ibm.com Cc: hoeppner@linux.vnet.ibm.com Cc: hpa@zytor.com Cc: jejb@parisc-linux.org Cc: jwi@linux.vnet.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-parisc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-s390@vger.kernel.org Cc: mark.rutland@arm.com Cc: mingo@redhat.com Cc: mpe@ellerman.id.au Cc: oberpar@linux.vnet.ibm.com Cc: oprofile-list@lists.sf.net Cc: paulus@samba.org Cc: peterz@infradead.org Cc: ralf@linux-mips.org Cc: rostedt@goodmis.org Cc: rric@kernel.org Cc: schwidefsky@de.ibm.com Cc: sebott@linux.vnet.ibm.com Cc: sparclinux@vger.kernel.org Cc: sth@linux.vnet.ibm.com Cc: ubraun@linux.vnet.ibm.com Cc: will.deacon@arm.com Cc: x86@kernel.org Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: James Hogan <jhogan@kernel.org> Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/arm64/include/asm/compat.h11
-rw-r--r--arch/arm64/include/asm/stat.h1
-rw-r--r--arch/arm64/kernel/hw_breakpoint.c1
-rw-r--r--arch/arm64/kernel/perf_regs.c2
-rw-r--r--arch/mips/include/asm/compat.h11
-rw-r--r--arch/mips/kernel/signal32.c2
-rw-r--r--arch/parisc/include/asm/compat.h11
-rw-r--r--arch/powerpc/include/asm/compat.h11
-rw-r--r--arch/powerpc/kernel/asm-offsets.c2
-rw-r--r--arch/powerpc/oprofile/backtrace.c1
-rw-r--r--arch/s390/hypfs/hypfs_sprp.c1
-rw-r--r--arch/s390/include/asm/compat.h11
-rw-r--r--arch/s390/include/asm/elf.h4
-rw-r--r--arch/s390/kvm/priv.c1
-rw-r--r--arch/s390/pci/pci_clp.c1
-rw-r--r--arch/sparc/include/asm/compat.h11
-rw-r--r--arch/x86/events/core.c2
-rw-r--r--arch/x86/include/asm/compat.h11
-rw-r--r--arch/x86/include/asm/ftrace.h2
-rw-r--r--arch/x86/kernel/sys_x86_64.c2
-rw-r--r--drivers/s390/block/dasd_ioctl.c1
-rw-r--r--drivers/s390/char/fs3270.c1
-rw-r--r--drivers/s390/char/sclp_ctl.c1
-rw-r--r--drivers/s390/char/vmcp.c1
-rw-r--r--drivers/s390/cio/chsc_sch.c1
-rw-r--r--drivers/s390/net/qeth_core_main.c2
-rw-r--r--include/linux/compat.h1
-rw-r--r--include/linux/compat_time.h19
28 files changed, 31 insertions, 95 deletions
diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index c00c62e1a4a3..0030f79808b3 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -34,7 +34,6 @@
34 34
35typedef u32 compat_size_t; 35typedef u32 compat_size_t;
36typedef s32 compat_ssize_t; 36typedef s32 compat_ssize_t;
37typedef s32 compat_time_t;
38typedef s32 compat_clock_t; 37typedef s32 compat_clock_t;
39typedef s32 compat_pid_t; 38typedef s32 compat_pid_t;
40typedef u16 __compat_uid_t; 39typedef u16 __compat_uid_t;
@@ -66,16 +65,6 @@ typedef u32 compat_ulong_t;
66typedef u64 compat_u64; 65typedef u64 compat_u64;
67typedef u32 compat_uptr_t; 66typedef u32 compat_uptr_t;
68 67
69struct compat_timespec {
70 compat_time_t tv_sec;
71 s32 tv_nsec;
72};
73
74struct compat_timeval {
75 compat_time_t tv_sec;
76 s32 tv_usec;
77};
78
79struct compat_stat { 68struct compat_stat {
80#ifdef __AARCH64EB__ 69#ifdef __AARCH64EB__
81 short st_dev; 70 short st_dev;
diff --git a/arch/arm64/include/asm/stat.h b/arch/arm64/include/asm/stat.h
index 15e35598ac40..eab738019707 100644
--- a/arch/arm64/include/asm/stat.h
+++ b/arch/arm64/include/asm/stat.h
@@ -20,6 +20,7 @@
20 20
21#ifdef CONFIG_COMPAT 21#ifdef CONFIG_COMPAT
22 22
23#include <linux/compat_time.h>
23#include <asm/compat.h> 24#include <asm/compat.h>
24 25
25/* 26/*
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c
index 74bb56f656ef..413dbe530da8 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -30,7 +30,6 @@
30#include <linux/smp.h> 30#include <linux/smp.h>
31#include <linux/uaccess.h> 31#include <linux/uaccess.h>
32 32
33#include <asm/compat.h>
34#include <asm/current.h> 33#include <asm/current.h>
35#include <asm/debug-monitors.h> 34#include <asm/debug-monitors.h>
36#include <asm/hw_breakpoint.h> 35#include <asm/hw_breakpoint.h>
diff --git a/arch/arm64/kernel/perf_regs.c b/arch/arm64/kernel/perf_regs.c
index 1d091d048d04..0bbac612146e 100644
--- a/arch/arm64/kernel/perf_regs.c
+++ b/arch/arm64/kernel/perf_regs.c
@@ -1,11 +1,11 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include <linux/compat.h>
2#include <linux/errno.h> 3#include <linux/errno.h>
3#include <linux/kernel.h> 4#include <linux/kernel.h>
4#include <linux/perf_event.h> 5#include <linux/perf_event.h>
5#include <linux/bug.h> 6#include <linux/bug.h>
6#include <linux/sched/task_stack.h> 7#include <linux/sched/task_stack.h>
7 8
8#include <asm/compat.h>
9#include <asm/perf_regs.h> 9#include <asm/perf_regs.h>
10#include <asm/ptrace.h> 10#include <asm/ptrace.h>
11 11
diff --git a/arch/mips/include/asm/compat.h b/arch/mips/include/asm/compat.h
index 9a0fa66b81ac..3e548ee99a2f 100644
--- a/arch/mips/include/asm/compat.h
+++ b/arch/mips/include/asm/compat.h
@@ -14,7 +14,6 @@
14 14
15typedef u32 compat_size_t; 15typedef u32 compat_size_t;
16typedef s32 compat_ssize_t; 16typedef s32 compat_ssize_t;
17typedef s32 compat_time_t;
18typedef s32 compat_clock_t; 17typedef s32 compat_clock_t;
19typedef s32 compat_suseconds_t; 18typedef s32 compat_suseconds_t;
20 19
@@ -46,16 +45,6 @@ typedef u32 compat_ulong_t;
46typedef u64 compat_u64; 45typedef u64 compat_u64;
47typedef u32 compat_uptr_t; 46typedef u32 compat_uptr_t;
48 47
49struct compat_timespec {
50 compat_time_t tv_sec;
51 s32 tv_nsec;
52};
53
54struct compat_timeval {
55 compat_time_t tv_sec;
56 s32 tv_usec;
57};
58
59struct compat_stat { 48struct compat_stat {
60 compat_dev_t st_dev; 49 compat_dev_t st_dev;
61 s32 st_pad1[3]; 50 s32 st_pad1[3];
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index c4db910a8794..b5d9e1784aff 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -8,13 +8,13 @@
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc. 8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 * Copyright (C) 2016, Imagination Technologies Ltd. 9 * Copyright (C) 2016, Imagination Technologies Ltd.
10 */ 10 */
11#include <linux/compat.h>
11#include <linux/compiler.h> 12#include <linux/compiler.h>
12#include <linux/errno.h> 13#include <linux/errno.h>
13#include <linux/kernel.h> 14#include <linux/kernel.h>
14#include <linux/signal.h> 15#include <linux/signal.h>
15#include <linux/syscalls.h> 16#include <linux/syscalls.h>
16 17
17#include <asm/compat.h>
18#include <asm/compat-signal.h> 18#include <asm/compat-signal.h>
19#include <linux/uaccess.h> 19#include <linux/uaccess.h>
20#include <asm/unistd.h> 20#include <asm/unistd.h>
diff --git a/arch/parisc/include/asm/compat.h b/arch/parisc/include/asm/compat.h
index 57b8b2a2fd4e..0cdfec8857bd 100644
--- a/arch/parisc/include/asm/compat.h
+++ b/arch/parisc/include/asm/compat.h
@@ -13,7 +13,6 @@
13 13
14typedef u32 compat_size_t; 14typedef u32 compat_size_t;
15typedef s32 compat_ssize_t; 15typedef s32 compat_ssize_t;
16typedef s32 compat_time_t;
17typedef s32 compat_clock_t; 16typedef s32 compat_clock_t;
18typedef s32 compat_pid_t; 17typedef s32 compat_pid_t;
19typedef u32 __compat_uid_t; 18typedef u32 __compat_uid_t;
@@ -40,16 +39,6 @@ typedef u32 compat_ulong_t;
40typedef u64 compat_u64; 39typedef u64 compat_u64;
41typedef u32 compat_uptr_t; 40typedef u32 compat_uptr_t;
42 41
43struct compat_timespec {
44 compat_time_t tv_sec;
45 s32 tv_nsec;
46};
47
48struct compat_timeval {
49 compat_time_t tv_sec;
50 s32 tv_usec;
51};
52
53struct compat_stat { 42struct compat_stat {
54 compat_dev_t st_dev; /* dev_t is 32 bits on parisc */ 43 compat_dev_t st_dev; /* dev_t is 32 bits on parisc */
55 compat_ino_t st_ino; /* 32 bits */ 44 compat_ino_t st_ino; /* 32 bits */
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h
index 62168e1158f1..b4773c81f7d5 100644
--- a/arch/powerpc/include/asm/compat.h
+++ b/arch/powerpc/include/asm/compat.h
@@ -17,7 +17,6 @@
17 17
18typedef u32 compat_size_t; 18typedef u32 compat_size_t;
19typedef s32 compat_ssize_t; 19typedef s32 compat_ssize_t;
20typedef s32 compat_time_t;
21typedef s32 compat_clock_t; 20typedef s32 compat_clock_t;
22typedef s32 compat_pid_t; 21typedef s32 compat_pid_t;
23typedef u32 __compat_uid_t; 22typedef u32 __compat_uid_t;
@@ -45,16 +44,6 @@ typedef u32 compat_ulong_t;
45typedef u64 compat_u64; 44typedef u64 compat_u64;
46typedef u32 compat_uptr_t; 45typedef u32 compat_uptr_t;
47 46
48struct compat_timespec {
49 compat_time_t tv_sec;
50 s32 tv_nsec;
51};
52
53struct compat_timeval {
54 compat_time_t tv_sec;
55 s32 tv_usec;
56};
57
58struct compat_stat { 47struct compat_stat {
59 compat_dev_t st_dev; 48 compat_dev_t st_dev;
60 compat_ino_t st_ino; 49 compat_ino_t st_ino;
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 6bee65f3cfd3..a77528db474c 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -13,6 +13,7 @@
13 * 2 of the License, or (at your option) any later version. 13 * 2 of the License, or (at your option) any later version.
14 */ 14 */
15 15
16#include <linux/compat.h>
16#include <linux/signal.h> 17#include <linux/signal.h>
17#include <linux/sched.h> 18#include <linux/sched.h>
18#include <linux/kernel.h> 19#include <linux/kernel.h>
@@ -42,7 +43,6 @@
42#include <asm/paca.h> 43#include <asm/paca.h>
43#include <asm/lppaca.h> 44#include <asm/lppaca.h>
44#include <asm/cache.h> 45#include <asm/cache.h>
45#include <asm/compat.h>
46#include <asm/mmu.h> 46#include <asm/mmu.h>
47#include <asm/hvcall.h> 47#include <asm/hvcall.h>
48#include <asm/xics.h> 48#include <asm/xics.h>
diff --git a/arch/powerpc/oprofile/backtrace.c b/arch/powerpc/oprofile/backtrace.c
index ecc66d5f02c9..ad054dd0d666 100644
--- a/arch/powerpc/oprofile/backtrace.c
+++ b/arch/powerpc/oprofile/backtrace.c
@@ -7,6 +7,7 @@
7 * 2 of the License, or (at your option) any later version. 7 * 2 of the License, or (at your option) any later version.
8**/ 8**/
9 9
10#include <linux/compat_time.h>
10#include <linux/oprofile.h> 11#include <linux/oprofile.h>
11#include <linux/sched.h> 12#include <linux/sched.h>
12#include <asm/processor.h> 13#include <asm/processor.h>
diff --git a/arch/s390/hypfs/hypfs_sprp.c b/arch/s390/hypfs/hypfs_sprp.c
index ae0ed8dd5f1b..5d85a039391c 100644
--- a/arch/s390/hypfs/hypfs_sprp.c
+++ b/arch/s390/hypfs/hypfs_sprp.c
@@ -13,7 +13,6 @@
13#include <linux/string.h> 13#include <linux/string.h>
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/uaccess.h> 15#include <linux/uaccess.h>
16#include <asm/compat.h>
17#include <asm/diag.h> 16#include <asm/diag.h>
18#include <asm/sclp.h> 17#include <asm/sclp.h>
19#include "hypfs.h" 18#include "hypfs.h"
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index 9830fb6b076e..501aaff85304 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -53,7 +53,6 @@
53 53
54typedef u32 compat_size_t; 54typedef u32 compat_size_t;
55typedef s32 compat_ssize_t; 55typedef s32 compat_ssize_t;
56typedef s32 compat_time_t;
57typedef s32 compat_clock_t; 56typedef s32 compat_clock_t;
58typedef s32 compat_pid_t; 57typedef s32 compat_pid_t;
59typedef u16 __compat_uid_t; 58typedef u16 __compat_uid_t;
@@ -97,16 +96,6 @@ typedef struct {
97 u32 gprs_high[NUM_GPRS]; 96 u32 gprs_high[NUM_GPRS];
98} s390_compat_regs_high; 97} s390_compat_regs_high;
99 98
100struct compat_timespec {
101 compat_time_t tv_sec;
102 s32 tv_nsec;
103};
104
105struct compat_timeval {
106 compat_time_t tv_sec;
107 s32 tv_usec;
108};
109
110struct compat_stat { 99struct compat_stat {
111 compat_dev_t st_dev; 100 compat_dev_t st_dev;
112 u16 __pad1; 101 u16 __pad1;
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index 1a61b1b997f2..7d22a474a040 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -125,8 +125,9 @@
125 * ELF register definitions.. 125 * ELF register definitions..
126 */ 126 */
127 127
128#include <linux/compat.h>
129
128#include <asm/ptrace.h> 130#include <asm/ptrace.h>
129#include <asm/compat.h>
130#include <asm/syscall.h> 131#include <asm/syscall.h>
131#include <asm/user.h> 132#include <asm/user.h>
132 133
@@ -136,7 +137,6 @@ typedef s390_regs elf_gregset_t;
136typedef s390_fp_regs compat_elf_fpregset_t; 137typedef s390_fp_regs compat_elf_fpregset_t;
137typedef s390_compat_regs compat_elf_gregset_t; 138typedef s390_compat_regs compat_elf_gregset_t;
138 139
139#include <linux/compat.h>
140#include <linux/sched/mm.h> /* for task_struct */ 140#include <linux/sched/mm.h> /* for task_struct */
141#include <asm/mmu_context.h> 141#include <asm/mmu_context.h>
142 142
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index ebfa0442e569..a3bce0e84346 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -26,7 +26,6 @@
26#include <asm/gmap.h> 26#include <asm/gmap.h>
27#include <asm/io.h> 27#include <asm/io.h>
28#include <asm/ptrace.h> 28#include <asm/ptrace.h>
29#include <asm/compat.h>
30#include <asm/sclp.h> 29#include <asm/sclp.h>
31#include "gaccess.h" 30#include "gaccess.h"
32#include "kvm-s390.h" 31#include "kvm-s390.h"
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c
index 93cd0f1ca12b..19b2d2a9b43d 100644
--- a/arch/s390/pci/pci_clp.c
+++ b/arch/s390/pci/pci_clp.c
@@ -19,7 +19,6 @@
19#include <linux/uaccess.h> 19#include <linux/uaccess.h>
20#include <asm/pci_debug.h> 20#include <asm/pci_debug.h>
21#include <asm/pci_clp.h> 21#include <asm/pci_clp.h>
22#include <asm/compat.h>
23#include <asm/clp.h> 22#include <asm/clp.h>
24#include <uapi/asm/clp.h> 23#include <uapi/asm/clp.h>
25 24
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index 1898b6223160..1910c44521e3 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -11,7 +11,6 @@
11 11
12typedef u32 compat_size_t; 12typedef u32 compat_size_t;
13typedef s32 compat_ssize_t; 13typedef s32 compat_ssize_t;
14typedef s32 compat_time_t;
15typedef s32 compat_clock_t; 14typedef s32 compat_clock_t;
16typedef s32 compat_pid_t; 15typedef s32 compat_pid_t;
17typedef u16 __compat_uid_t; 16typedef u16 __compat_uid_t;
@@ -39,16 +38,6 @@ typedef u32 compat_ulong_t;
39typedef u64 compat_u64; 38typedef u64 compat_u64;
40typedef u32 compat_uptr_t; 39typedef u32 compat_uptr_t;
41 40
42struct compat_timespec {
43 compat_time_t tv_sec;
44 s32 tv_nsec;
45};
46
47struct compat_timeval {
48 compat_time_t tv_sec;
49 s32 tv_usec;
50};
51
52struct compat_stat { 41struct compat_stat {
53 compat_dev_t st_dev; 42 compat_dev_t st_dev;
54 compat_ino_t st_ino; 43 compat_ino_t st_ino;
diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
index a6006e7bb729..7a987e6c7c35 100644
--- a/arch/x86/events/core.c
+++ b/arch/x86/events/core.c
@@ -2391,7 +2391,7 @@ static unsigned long get_segment_base(unsigned int segment)
2391 2391
2392#ifdef CONFIG_IA32_EMULATION 2392#ifdef CONFIG_IA32_EMULATION
2393 2393
2394#include <asm/compat.h> 2394#include <linux/compat.h>
2395 2395
2396static inline int 2396static inline int
2397perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *entry) 2397perf_callchain_user32(struct pt_regs *regs, struct perf_callchain_entry_ctx *entry)
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index e1c8dab86670..7cd314b71c51 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -17,7 +17,6 @@
17 17
18typedef u32 compat_size_t; 18typedef u32 compat_size_t;
19typedef s32 compat_ssize_t; 19typedef s32 compat_ssize_t;
20typedef s32 compat_time_t;
21typedef s32 compat_clock_t; 20typedef s32 compat_clock_t;
22typedef s32 compat_pid_t; 21typedef s32 compat_pid_t;
23typedef u16 __compat_uid_t; 22typedef u16 __compat_uid_t;
@@ -46,16 +45,6 @@ typedef u32 compat_u32;
46typedef u64 __attribute__((aligned(4))) compat_u64; 45typedef u64 __attribute__((aligned(4))) compat_u64;
47typedef u32 compat_uptr_t; 46typedef u32 compat_uptr_t;
48 47
49struct compat_timespec {
50 compat_time_t tv_sec;
51 s32 tv_nsec;
52};
53
54struct compat_timeval {
55 compat_time_t tv_sec;
56 s32 tv_usec;
57};
58
59struct compat_stat { 48struct compat_stat {
60 compat_dev_t st_dev; 49 compat_dev_t st_dev;
61 u16 __pad1; 50 u16 __pad1;
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 09ad88572746..db25aa15b705 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -49,7 +49,7 @@ int ftrace_int3_handler(struct pt_regs *regs);
49#if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS) 49#if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
50 50
51#if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION) 51#if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
52#include <asm/compat.h> 52#include <linux/compat.h>
53 53
54/* 54/*
55 * Because ia32 syscalls do not map to x86_64 syscall numbers 55 * Because ia32 syscalls do not map to x86_64 syscall numbers
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c
index a3f15ed545b5..6a78d4b36a79 100644
--- a/arch/x86/kernel/sys_x86_64.c
+++ b/arch/x86/kernel/sys_x86_64.c
@@ -1,4 +1,5 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2#include <linux/compat.h>
2#include <linux/errno.h> 3#include <linux/errno.h>
3#include <linux/sched.h> 4#include <linux/sched.h>
4#include <linux/sched/mm.h> 5#include <linux/sched/mm.h>
@@ -19,7 +20,6 @@
19#include <linux/elf.h> 20#include <linux/elf.h>
20 21
21#include <asm/elf.h> 22#include <asm/elf.h>
22#include <asm/compat.h>
23#include <asm/ia32.h> 23#include <asm/ia32.h>
24#include <asm/syscalls.h> 24#include <asm/syscalls.h>
25#include <asm/mpx.h> 25#include <asm/mpx.h>
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 7bdc6aaa0ba3..2016e0ed5865 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -18,7 +18,6 @@
18#include <linux/fs.h> 18#include <linux/fs.h>
19#include <linux/blkpg.h> 19#include <linux/blkpg.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <asm/compat.h>
22#include <asm/ccwdev.h> 21#include <asm/ccwdev.h>
23#include <asm/schid.h> 22#include <asm/schid.h>
24#include <asm/cmb.h> 23#include <asm/cmb.h>
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index 61822480a2a0..16a4e8528bbc 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -19,7 +19,6 @@
19#include <linux/slab.h> 19#include <linux/slab.h>
20#include <linux/types.h> 20#include <linux/types.h>
21 21
22#include <asm/compat.h>
23#include <asm/ccwdev.h> 22#include <asm/ccwdev.h>
24#include <asm/cio.h> 23#include <asm/cio.h>
25#include <asm/ebcdic.h> 24#include <asm/ebcdic.h>
diff --git a/drivers/s390/char/sclp_ctl.c b/drivers/s390/char/sclp_ctl.c
index a78cea0c3a09..248b5db3eaa8 100644
--- a/drivers/s390/char/sclp_ctl.c
+++ b/drivers/s390/char/sclp_ctl.c
@@ -14,7 +14,6 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/ioctl.h> 15#include <linux/ioctl.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <asm/compat.h>
18#include <asm/sclp_ctl.h> 17#include <asm/sclp_ctl.h>
19#include <asm/sclp.h> 18#include <asm/sclp.h>
20 19
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 17e411c57576..948ce82a7725 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -23,7 +23,6 @@
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/cma.h> 24#include <linux/cma.h>
25#include <linux/mm.h> 25#include <linux/mm.h>
26#include <asm/compat.h>
27#include <asm/cpcmd.h> 26#include <asm/cpcmd.h>
28#include <asm/debug.h> 27#include <asm/debug.h>
29#include <asm/vmcp.h> 28#include <asm/vmcp.h>
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c
index 0015729d917d..8d9f36625ba5 100644
--- a/drivers/s390/cio/chsc_sch.c
+++ b/drivers/s390/cio/chsc_sch.c
@@ -16,7 +16,6 @@
16#include <linux/miscdevice.h> 16#include <linux/miscdevice.h>
17#include <linux/kernel_stat.h> 17#include <linux/kernel_stat.h>
18 18
19#include <asm/compat.h>
20#include <asm/cio.h> 19#include <asm/cio.h>
21#include <asm/chsc.h> 20#include <asm/chsc.h>
22#include <asm/isc.h> 21#include <asm/isc.h>
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 04fefa5bb08d..df5d8451a51a 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -10,6 +10,7 @@
10#define KMSG_COMPONENT "qeth" 10#define KMSG_COMPONENT "qeth"
11#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 11#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
12 12
13#include <linux/compat.h>
13#include <linux/module.h> 14#include <linux/module.h>
14#include <linux/moduleparam.h> 15#include <linux/moduleparam.h>
15#include <linux/string.h> 16#include <linux/string.h>
@@ -32,7 +33,6 @@
32#include <asm/chpid.h> 33#include <asm/chpid.h>
33#include <asm/io.h> 34#include <asm/io.h>
34#include <asm/sysinfo.h> 35#include <asm/sysinfo.h>
35#include <asm/compat.h>
36#include <asm/diag.h> 36#include <asm/diag.h>
37#include <asm/cio.h> 37#include <asm/cio.h>
38#include <asm/ccwdev.h> 38#include <asm/ccwdev.h>
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 48d29b1339be..cd50b00ef59a 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/compat_time.h>
10 11
11#include <linux/stat.h> 12#include <linux/stat.h>
12#include <linux/param.h> /* for HZ */ 13#include <linux/param.h> /* for HZ */
diff --git a/include/linux/compat_time.h b/include/linux/compat_time.h
new file mode 100644
index 000000000000..56a54a1e4355
--- /dev/null
+++ b/include/linux/compat_time.h
@@ -0,0 +1,19 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _LINUX_COMPAT_TIME_H
3#define _LINUX_COMPAT_TIME_H
4
5#include <linux/types.h>
6
7typedef s32 compat_time_t;
8
9struct compat_timespec {
10 compat_time_t tv_sec;
11 s32 tv_nsec;
12};
13
14struct compat_timeval {
15 compat_time_t tv_sec;
16 s32 tv_usec;
17};
18
19#endif /* _LINUX_COMPAT_TIME_H */