aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/crypto/crypt_s390.h1
-rw-r--r--arch/s390/include/asm/atomic.h2
-rw-r--r--arch/s390/include/asm/barrier.h35
-rw-r--r--arch/s390/include/asm/ctl_reg.h76
-rw-r--r--arch/s390/include/asm/elf.h1
-rw-r--r--arch/s390/include/asm/exec.h12
-rw-r--r--arch/s390/include/asm/facility.h63
-rw-r--r--arch/s390/include/asm/mmu.h14
-rw-r--r--arch/s390/include/asm/mmu_context.h1
-rw-r--r--arch/s390/include/asm/processor.h24
-rw-r--r--arch/s390/include/asm/setup.h14
-rw-r--r--arch/s390/include/asm/smp.h2
-rw-r--r--arch/s390/include/asm/switch_to.h100
-rw-r--r--arch/s390/include/asm/system.h320
-rw-r--r--arch/s390/include/asm/uaccess.h6
-rw-r--r--arch/s390/kernel/asm-offsets.c1
-rw-r--r--arch/s390/kernel/compat_signal.c1
-rw-r--r--arch/s390/kernel/cpcmd.c1
-rw-r--r--arch/s390/kernel/dis.c1
-rw-r--r--arch/s390/kernel/early.c2
-rw-r--r--arch/s390/kernel/lgr.c1
-rw-r--r--arch/s390/kernel/machine_kexec.c1
-rw-r--r--arch/s390/kernel/os_info.c1
-rw-r--r--arch/s390/kernel/process.c2
-rw-r--r--arch/s390/kernel/ptrace.c2
-rw-r--r--arch/s390/kernel/setup.c1
-rw-r--r--arch/s390/kernel/signal.c1
-rw-r--r--arch/s390/kernel/suspend.c2
-rw-r--r--arch/s390/kernel/traps.c1
-rw-r--r--arch/s390/kernel/vdso.c2
-rw-r--r--arch/s390/kvm/kvm-s390.c2
-rw-r--r--arch/s390/mm/fault.c2
-rw-r--r--arch/s390/mm/init.c2
-rw-r--r--arch/s390/mm/maccess.c2
-rw-r--r--arch/s390/mm/pgtable.c1
-rw-r--r--arch/s390/oprofile/hwsampler.c1
36 files changed, 366 insertions, 335 deletions
diff --git a/arch/s390/crypto/crypt_s390.h b/arch/s390/crypto/crypt_s390.h
index ffd1ac255f19..9178db6db0a5 100644
--- a/arch/s390/crypto/crypt_s390.h
+++ b/arch/s390/crypto/crypt_s390.h
@@ -17,6 +17,7 @@
17#define _CRYPTO_ARCH_S390_CRYPT_S390_H 17#define _CRYPTO_ARCH_S390_CRYPT_S390_H
18 18
19#include <asm/errno.h> 19#include <asm/errno.h>
20#include <asm/facility.h>
20 21
21#define CRYPT_S390_OP_MASK 0xFF00 22#define CRYPT_S390_OP_MASK 0xFF00
22#define CRYPT_S390_FUNC_MASK 0x00FF 23#define CRYPT_S390_FUNC_MASK 0x00FF
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index 8517d2ae3b5c..748347baecb8 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -15,7 +15,7 @@
15 15
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <asm/system.h> 18#include <asm/cmpxchg.h>
19 19
20#define ATOMIC_INIT(i) { (i) } 20#define ATOMIC_INIT(i) { (i) }
21 21
diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h
new file mode 100644
index 000000000000..451273ad4d34
--- /dev/null
+++ b/arch/s390/include/asm/barrier.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_BARRIER_H
8#define __ASM_BARRIER_H
9
10/*
11 * Force strict CPU ordering.
12 * And yes, this is required on UP too when we're talking
13 * to devices.
14 *
15 * This is very similar to the ppc eieio/sync instruction in that is
16 * does a checkpoint syncronisation & makes sure that
17 * all memory ops have completed wrt other CPU's ( see 7-15 POP DJB ).
18 */
19
20#define eieio() asm volatile("bcr 15,0" : : : "memory")
21#define SYNC_OTHER_CORES(x) eieio()
22#define mb() eieio()
23#define rmb() eieio()
24#define wmb() eieio()
25#define read_barrier_depends() do { } while(0)
26#define smp_mb() mb()
27#define smp_rmb() rmb()
28#define smp_wmb() wmb()
29#define smp_read_barrier_depends() read_barrier_depends()
30#define smp_mb__before_clear_bit() smp_mb()
31#define smp_mb__after_clear_bit() smp_mb()
32
33#define set_mb(var, value) do { var = value; mb(); } while (0)
34
35#endif /* __ASM_BARRIER_H */
diff --git a/arch/s390/include/asm/ctl_reg.h b/arch/s390/include/asm/ctl_reg.h
new file mode 100644
index 000000000000..ecde9417d669
--- /dev/null
+++ b/arch/s390/include/asm/ctl_reg.h
@@ -0,0 +1,76 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_CTL_REG_H
8#define __ASM_CTL_REG_H
9
10#ifdef __s390x__
11
12#define __ctl_load(array, low, high) ({ \
13 typedef struct { char _[sizeof(array)]; } addrtype; \
14 asm volatile( \
15 " lctlg %1,%2,%0\n" \
16 : : "Q" (*(addrtype *)(&array)), \
17 "i" (low), "i" (high)); \
18 })
19
20#define __ctl_store(array, low, high) ({ \
21 typedef struct { char _[sizeof(array)]; } addrtype; \
22 asm volatile( \
23 " stctg %1,%2,%0\n" \
24 : "=Q" (*(addrtype *)(&array)) \
25 : "i" (low), "i" (high)); \
26 })
27
28#else /* __s390x__ */
29
30#define __ctl_load(array, low, high) ({ \
31 typedef struct { char _[sizeof(array)]; } addrtype; \
32 asm volatile( \
33 " lctl %1,%2,%0\n" \
34 : : "Q" (*(addrtype *)(&array)), \
35 "i" (low), "i" (high)); \
36})
37
38#define __ctl_store(array, low, high) ({ \
39 typedef struct { char _[sizeof(array)]; } addrtype; \
40 asm volatile( \
41 " stctl %1,%2,%0\n" \
42 : "=Q" (*(addrtype *)(&array)) \
43 : "i" (low), "i" (high)); \
44 })
45
46#endif /* __s390x__ */
47
48#define __ctl_set_bit(cr, bit) ({ \
49 unsigned long __dummy; \
50 __ctl_store(__dummy, cr, cr); \
51 __dummy |= 1UL << (bit); \
52 __ctl_load(__dummy, cr, cr); \
53})
54
55#define __ctl_clear_bit(cr, bit) ({ \
56 unsigned long __dummy; \
57 __ctl_store(__dummy, cr, cr); \
58 __dummy &= ~(1UL << (bit)); \
59 __ctl_load(__dummy, cr, cr); \
60})
61
62#ifdef CONFIG_SMP
63
64extern void smp_ctl_set_bit(int cr, int bit);
65extern void smp_ctl_clear_bit(int cr, int bit);
66#define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
67#define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
68
69#else
70
71#define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit)
72#define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit)
73
74#endif /* CONFIG_SMP */
75
76#endif /* __ASM_CTL_REG_H */
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index 547f1a6a35d4..c4ee39f7a4d6 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -129,7 +129,6 @@ typedef s390_fp_regs compat_elf_fpregset_t;
129typedef s390_compat_regs compat_elf_gregset_t; 129typedef s390_compat_regs compat_elf_gregset_t;
130 130
131#include <linux/sched.h> /* for task_struct */ 131#include <linux/sched.h> /* for task_struct */
132#include <asm/system.h> /* for save_access_regs */
133#include <asm/mmu_context.h> 132#include <asm/mmu_context.h>
134 133
135#include <asm/vdso.h> 134#include <asm/vdso.h>
diff --git a/arch/s390/include/asm/exec.h b/arch/s390/include/asm/exec.h
new file mode 100644
index 000000000000..c4a93d6327fa
--- /dev/null
+++ b/arch/s390/include/asm/exec.h
@@ -0,0 +1,12 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_EXEC_H
8#define __ASM_EXEC_H
9
10extern unsigned long arch_align_stack(unsigned long sp);
11
12#endif /* __ASM_EXEC_H */
diff --git a/arch/s390/include/asm/facility.h b/arch/s390/include/asm/facility.h
new file mode 100644
index 000000000000..1e5b27edc0c9
--- /dev/null
+++ b/arch/s390/include/asm/facility.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_FACILITY_H
8#define __ASM_FACILITY_H
9
10#include <linux/string.h>
11#include <linux/preempt.h>
12#include <asm/lowcore.h>
13
14#define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */
15
16/*
17 * The test_facility function uses the bit odering where the MSB is bit 0.
18 * That makes it easier to query facility bits with the bit number as
19 * documented in the Principles of Operation.
20 */
21static inline int test_facility(unsigned long nr)
22{
23 unsigned char *ptr;
24
25 if (nr >= MAX_FACILITY_BIT)
26 return 0;
27 ptr = (unsigned char *) &S390_lowcore.stfle_fac_list + (nr >> 3);
28 return (*ptr & (0x80 >> (nr & 7))) != 0;
29}
30
31/**
32 * stfle - Store facility list extended
33 * @stfle_fac_list: array where facility list can be stored
34 * @size: size of passed in array in double words
35 */
36static inline void stfle(u64 *stfle_fac_list, int size)
37{
38 unsigned long nr;
39
40 preempt_disable();
41 S390_lowcore.stfl_fac_list = 0;
42 asm volatile(
43 " .insn s,0xb2b10000,0(0)\n" /* stfl */
44 "0:\n"
45 EX_TABLE(0b, 0b)
46 : "=m" (S390_lowcore.stfl_fac_list));
47 nr = 4; /* bytes stored by stfl */
48 memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
49 if (S390_lowcore.stfl_fac_list & 0x01000000) {
50 /* More facility bits available with stfle */
51 register unsigned long reg0 asm("0") = size - 1;
52
53 asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */
54 : "+d" (reg0)
55 : "a" (stfle_fac_list)
56 : "memory", "cc");
57 nr = (reg0 + 1) * 8; /* # bytes stored by stfle */
58 }
59 memset((char *) stfle_fac_list + nr, 0, size * 8 - nr);
60 preempt_enable();
61}
62
63#endif /* __ASM_FACILITY_H */
diff --git a/arch/s390/include/asm/mmu.h b/arch/s390/include/asm/mmu.h
index 4506791adcd5..1c7d6ce328bf 100644
--- a/arch/s390/include/asm/mmu.h
+++ b/arch/s390/include/asm/mmu.h
@@ -21,4 +21,18 @@ typedef struct {
21 .context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \ 21 .context.pgtable_list = LIST_HEAD_INIT(name.context.pgtable_list), \
22 .context.gmap_list = LIST_HEAD_INIT(name.context.gmap_list), 22 .context.gmap_list = LIST_HEAD_INIT(name.context.gmap_list),
23 23
24static inline int tprot(unsigned long addr)
25{
26 int rc = -EFAULT;
27
28 asm volatile(
29 " tprot 0(%1),0\n"
30 "0: ipm %0\n"
31 " srl %0,28\n"
32 "1:\n"
33 EX_TABLE(0b,1b)
34 : "+d" (rc) : "a" (addr) : "cc");
35 return rc;
36}
37
24#endif 38#endif
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
index 5682f160ff82..5d09e405c54d 100644
--- a/arch/s390/include/asm/mmu_context.h
+++ b/arch/s390/include/asm/mmu_context.h
@@ -12,6 +12,7 @@
12#include <asm/pgalloc.h> 12#include <asm/pgalloc.h>
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/tlbflush.h> 14#include <asm/tlbflush.h>
15#include <asm/ctl_reg.h>
15#include <asm-generic/mm_hooks.h> 16#include <asm-generic/mm_hooks.h>
16 17
17static inline int init_new_context(struct task_struct *tsk, 18static inline int init_new_context(struct task_struct *tsk,
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index d25843a6a915..d499b30ea487 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -14,6 +14,7 @@
14#define __ASM_S390_PROCESSOR_H 14#define __ASM_S390_PROCESSOR_H
15 15
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <linux/irqflags.h>
17#include <asm/cpu.h> 18#include <asm/cpu.h>
18#include <asm/page.h> 19#include <asm/page.h>
19#include <asm/ptrace.h> 20#include <asm/ptrace.h>
@@ -156,6 +157,14 @@ unsigned long get_wchan(struct task_struct *p);
156#define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr) 157#define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr)
157#define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15]) 158#define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15])
158 159
160static inline unsigned short stap(void)
161{
162 unsigned short cpu_address;
163
164 asm volatile("stap %0" : "=m" (cpu_address));
165 return cpu_address;
166}
167
159/* 168/*
160 * Give up the time slice of the virtual PU. 169 * Give up the time slice of the virtual PU.
161 */ 170 */
@@ -304,6 +313,21 @@ static inline void __noreturn disabled_wait(unsigned long code)
304} 313}
305 314
306/* 315/*
316 * Use to set psw mask except for the first byte which
317 * won't be changed by this function.
318 */
319static inline void
320__set_psw_mask(unsigned long mask)
321{
322 __load_psw_mask(mask | (arch_local_save_flags() & ~(-1UL >> 8)));
323}
324
325#define local_mcck_enable() \
326 __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_MCHECK)
327#define local_mcck_disable() \
328 __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT)
329
330/*
307 * Basic Machine Check/Program Check Handler. 331 * Basic Machine Check/Program Check Handler.
308 */ 332 */
309 333
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h
index 097183c70407..b21e46e5d4b8 100644
--- a/arch/s390/include/asm/setup.h
+++ b/arch/s390/include/asm/setup.h
@@ -140,6 +140,20 @@ extern char vmpoff_cmd[];
140#define NSS_NAME_SIZE 8 140#define NSS_NAME_SIZE 8
141extern char kernel_nss_name[]; 141extern char kernel_nss_name[];
142 142
143#ifdef CONFIG_PFAULT
144extern int pfault_init(void);
145extern void pfault_fini(void);
146#else /* CONFIG_PFAULT */
147#define pfault_init() ({-1;})
148#define pfault_fini() do { } while (0)
149#endif /* CONFIG_PFAULT */
150
151extern void cmma_init(void);
152
153extern void (*_machine_restart)(char *command);
154extern void (*_machine_halt)(void);
155extern void (*_machine_power_off)(void);
156
143#else /* __ASSEMBLY__ */ 157#else /* __ASSEMBLY__ */
144 158
145#ifndef __s390x__ 159#ifndef __s390x__
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h
index 797f78729680..c77c6de6f6c0 100644
--- a/arch/s390/include/asm/smp.h
+++ b/arch/s390/include/asm/smp.h
@@ -9,7 +9,7 @@
9 9
10#ifdef CONFIG_SMP 10#ifdef CONFIG_SMP
11 11
12#include <asm/system.h> 12#include <asm/lowcore.h>
13 13
14#define raw_smp_processor_id() (S390_lowcore.cpu_nr) 14#define raw_smp_processor_id() (S390_lowcore.cpu_nr)
15 15
diff --git a/arch/s390/include/asm/switch_to.h b/arch/s390/include/asm/switch_to.h
new file mode 100644
index 000000000000..f223068b7822
--- /dev/null
+++ b/arch/s390/include/asm/switch_to.h
@@ -0,0 +1,100 @@
1/*
2 * Copyright IBM Corp. 1999, 2009
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_SWITCH_TO_H
8#define __ASM_SWITCH_TO_H
9
10#include <linux/thread_info.h>
11
12extern struct task_struct *__switch_to(void *, void *);
13extern void update_per_regs(struct task_struct *task);
14
15static inline void save_fp_regs(s390_fp_regs *fpregs)
16{
17 asm volatile(
18 " std 0,%O0+8(%R0)\n"
19 " std 2,%O0+24(%R0)\n"
20 " std 4,%O0+40(%R0)\n"
21 " std 6,%O0+56(%R0)"
22 : "=Q" (*fpregs) : "Q" (*fpregs));
23 if (!MACHINE_HAS_IEEE)
24 return;
25 asm volatile(
26 " stfpc %0\n"
27 " std 1,%O0+16(%R0)\n"
28 " std 3,%O0+32(%R0)\n"
29 " std 5,%O0+48(%R0)\n"
30 " std 7,%O0+64(%R0)\n"
31 " std 8,%O0+72(%R0)\n"
32 " std 9,%O0+80(%R0)\n"
33 " std 10,%O0+88(%R0)\n"
34 " std 11,%O0+96(%R0)\n"
35 " std 12,%O0+104(%R0)\n"
36 " std 13,%O0+112(%R0)\n"
37 " std 14,%O0+120(%R0)\n"
38 " std 15,%O0+128(%R0)\n"
39 : "=Q" (*fpregs) : "Q" (*fpregs));
40}
41
42static inline void restore_fp_regs(s390_fp_regs *fpregs)
43{
44 asm volatile(
45 " ld 0,%O0+8(%R0)\n"
46 " ld 2,%O0+24(%R0)\n"
47 " ld 4,%O0+40(%R0)\n"
48 " ld 6,%O0+56(%R0)"
49 : : "Q" (*fpregs));
50 if (!MACHINE_HAS_IEEE)
51 return;
52 asm volatile(
53 " lfpc %0\n"
54 " ld 1,%O0+16(%R0)\n"
55 " ld 3,%O0+32(%R0)\n"
56 " ld 5,%O0+48(%R0)\n"
57 " ld 7,%O0+64(%R0)\n"
58 " ld 8,%O0+72(%R0)\n"
59 " ld 9,%O0+80(%R0)\n"
60 " ld 10,%O0+88(%R0)\n"
61 " ld 11,%O0+96(%R0)\n"
62 " ld 12,%O0+104(%R0)\n"
63 " ld 13,%O0+112(%R0)\n"
64 " ld 14,%O0+120(%R0)\n"
65 " ld 15,%O0+128(%R0)\n"
66 : : "Q" (*fpregs));
67}
68
69static inline void save_access_regs(unsigned int *acrs)
70{
71 asm volatile("stam 0,15,%0" : "=Q" (*acrs));
72}
73
74static inline void restore_access_regs(unsigned int *acrs)
75{
76 asm volatile("lam 0,15,%0" : : "Q" (*acrs));
77}
78
79#define switch_to(prev,next,last) do { \
80 if (prev->mm) { \
81 save_fp_regs(&prev->thread.fp_regs); \
82 save_access_regs(&prev->thread.acrs[0]); \
83 } \
84 if (next->mm) { \
85 restore_fp_regs(&next->thread.fp_regs); \
86 restore_access_regs(&next->thread.acrs[0]); \
87 update_per_regs(next); \
88 } \
89 prev = __switch_to(prev,next); \
90} while (0)
91
92extern void account_vtime(struct task_struct *, struct task_struct *);
93extern void account_tick_vtime(struct task_struct *);
94
95#define finish_arch_switch(prev) do { \
96 set_fs(current->thread.mm_segment); \
97 account_vtime(prev, current); \
98} while (0)
99
100#endif /* __ASM_SWITCH_TO_H */
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h
index 2e0bb7f0f9b2..641c72903277 100644
--- a/arch/s390/include/asm/system.h
+++ b/arch/s390/include/asm/system.h
@@ -1,315 +1,7 @@
1/* 1/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */
2 * Copyright IBM Corp. 1999, 2009 2#include <asm/barrier.h>
3 *
4 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
5 */
6
7#ifndef __ASM_SYSTEM_H
8#define __ASM_SYSTEM_H
9
10#include <linux/preempt.h>
11#include <linux/kernel.h>
12#include <linux/errno.h>
13#include <linux/string.h>
14#include <asm/types.h>
15#include <asm/ptrace.h>
16#include <asm/setup.h>
17#include <asm/processor.h>
18#include <asm/lowcore.h>
19#include <asm/cmpxchg.h> 3#include <asm/cmpxchg.h>
20 4#include <asm/ctl_reg.h>
21#ifdef __KERNEL__ 5#include <asm/exec.h>
22 6#include <asm/facility.h>
23struct task_struct; 7#include <asm/switch_to.h>
24
25extern struct task_struct *__switch_to(void *, void *);
26extern void update_per_regs(struct task_struct *task);
27
28static inline void save_fp_regs(s390_fp_regs *fpregs)
29{
30 asm volatile(
31 " std 0,%O0+8(%R0)\n"
32 " std 2,%O0+24(%R0)\n"
33 " std 4,%O0+40(%R0)\n"
34 " std 6,%O0+56(%R0)"
35 : "=Q" (*fpregs) : "Q" (*fpregs));
36 if (!MACHINE_HAS_IEEE)
37 return;
38 asm volatile(
39 " stfpc %0\n"
40 " std 1,%O0+16(%R0)\n"
41 " std 3,%O0+32(%R0)\n"
42 " std 5,%O0+48(%R0)\n"
43 " std 7,%O0+64(%R0)\n"
44 " std 8,%O0+72(%R0)\n"
45 " std 9,%O0+80(%R0)\n"
46 " std 10,%O0+88(%R0)\n"
47 " std 11,%O0+96(%R0)\n"
48 " std 12,%O0+104(%R0)\n"
49 " std 13,%O0+112(%R0)\n"
50 " std 14,%O0+120(%R0)\n"
51 " std 15,%O0+128(%R0)\n"
52 : "=Q" (*fpregs) : "Q" (*fpregs));
53}
54
55static inline void restore_fp_regs(s390_fp_regs *fpregs)
56{
57 asm volatile(
58 " ld 0,%O0+8(%R0)\n"
59 " ld 2,%O0+24(%R0)\n"
60 " ld 4,%O0+40(%R0)\n"
61 " ld 6,%O0+56(%R0)"
62 : : "Q" (*fpregs));
63 if (!MACHINE_HAS_IEEE)
64 return;
65 asm volatile(
66 " lfpc %0\n"
67 " ld 1,%O0+16(%R0)\n"
68 " ld 3,%O0+32(%R0)\n"
69 " ld 5,%O0+48(%R0)\n"
70 " ld 7,%O0+64(%R0)\n"
71 " ld 8,%O0+72(%R0)\n"
72 " ld 9,%O0+80(%R0)\n"
73 " ld 10,%O0+88(%R0)\n"
74 " ld 11,%O0+96(%R0)\n"
75 " ld 12,%O0+104(%R0)\n"
76 " ld 13,%O0+112(%R0)\n"
77 " ld 14,%O0+120(%R0)\n"
78 " ld 15,%O0+128(%R0)\n"
79 : : "Q" (*fpregs));
80}
81
82static inline void save_access_regs(unsigned int *acrs)
83{
84 asm volatile("stam 0,15,%0" : "=Q" (*acrs));
85}
86
87static inline void restore_access_regs(unsigned int *acrs)
88{
89 asm volatile("lam 0,15,%0" : : "Q" (*acrs));
90}
91
92#define switch_to(prev,next,last) do { \
93 if (prev->mm) { \
94 save_fp_regs(&prev->thread.fp_regs); \
95 save_access_regs(&prev->thread.acrs[0]); \
96 } \
97 if (next->mm) { \
98 restore_fp_regs(&next->thread.fp_regs); \
99 restore_access_regs(&next->thread.acrs[0]); \
100 update_per_regs(next); \
101 } \
102 prev = __switch_to(prev,next); \
103} while (0)
104
105extern void account_vtime(struct task_struct *, struct task_struct *);
106extern void account_tick_vtime(struct task_struct *);
107
108#ifdef CONFIG_PFAULT
109extern int pfault_init(void);
110extern void pfault_fini(void);
111#else /* CONFIG_PFAULT */
112#define pfault_init() ({-1;})
113#define pfault_fini() do { } while (0)
114#endif /* CONFIG_PFAULT */
115
116extern void cmma_init(void);
117extern int memcpy_real(void *, void *, size_t);
118extern void copy_to_absolute_zero(void *dest, void *src, size_t count);
119extern int copy_to_user_real(void __user *dest, void *src, size_t count);
120extern int copy_from_user_real(void *dest, void __user *src, size_t count);
121
122#define finish_arch_switch(prev) do { \
123 set_fs(current->thread.mm_segment); \
124 account_vtime(prev, current); \
125} while (0)
126
127#define nop() asm volatile("nop")
128
129/*
130 * Force strict CPU ordering.
131 * And yes, this is required on UP too when we're talking
132 * to devices.
133 *
134 * This is very similar to the ppc eieio/sync instruction in that is
135 * does a checkpoint syncronisation & makes sure that
136 * all memory ops have completed wrt other CPU's ( see 7-15 POP DJB ).
137 */
138
139#define eieio() asm volatile("bcr 15,0" : : : "memory")
140#define SYNC_OTHER_CORES(x) eieio()
141#define mb() eieio()
142#define rmb() eieio()
143#define wmb() eieio()
144#define read_barrier_depends() do { } while(0)
145#define smp_mb() mb()
146#define smp_rmb() rmb()
147#define smp_wmb() wmb()
148#define smp_read_barrier_depends() read_barrier_depends()
149#define smp_mb__before_clear_bit() smp_mb()
150#define smp_mb__after_clear_bit() smp_mb()
151
152
153#define set_mb(var, value) do { var = value; mb(); } while (0)
154
155#ifdef __s390x__
156
157#define __ctl_load(array, low, high) ({ \
158 typedef struct { char _[sizeof(array)]; } addrtype; \
159 asm volatile( \
160 " lctlg %1,%2,%0\n" \
161 : : "Q" (*(addrtype *)(&array)), \
162 "i" (low), "i" (high)); \
163 })
164
165#define __ctl_store(array, low, high) ({ \
166 typedef struct { char _[sizeof(array)]; } addrtype; \
167 asm volatile( \
168 " stctg %1,%2,%0\n" \
169 : "=Q" (*(addrtype *)(&array)) \
170 : "i" (low), "i" (high)); \
171 })
172
173#else /* __s390x__ */
174
175#define __ctl_load(array, low, high) ({ \
176 typedef struct { char _[sizeof(array)]; } addrtype; \
177 asm volatile( \
178 " lctl %1,%2,%0\n" \
179 : : "Q" (*(addrtype *)(&array)), \
180 "i" (low), "i" (high)); \
181})
182
183#define __ctl_store(array, low, high) ({ \
184 typedef struct { char _[sizeof(array)]; } addrtype; \
185 asm volatile( \
186 " stctl %1,%2,%0\n" \
187 : "=Q" (*(addrtype *)(&array)) \
188 : "i" (low), "i" (high)); \
189 })
190
191#endif /* __s390x__ */
192
193#define __ctl_set_bit(cr, bit) ({ \
194 unsigned long __dummy; \
195 __ctl_store(__dummy, cr, cr); \
196 __dummy |= 1UL << (bit); \
197 __ctl_load(__dummy, cr, cr); \
198})
199
200#define __ctl_clear_bit(cr, bit) ({ \
201 unsigned long __dummy; \
202 __ctl_store(__dummy, cr, cr); \
203 __dummy &= ~(1UL << (bit)); \
204 __ctl_load(__dummy, cr, cr); \
205})
206
207/*
208 * Use to set psw mask except for the first byte which
209 * won't be changed by this function.
210 */
211static inline void
212__set_psw_mask(unsigned long mask)
213{
214 __load_psw_mask(mask | (arch_local_save_flags() & ~(-1UL >> 8)));
215}
216
217#define local_mcck_enable() \
218 __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_MCHECK)
219#define local_mcck_disable() \
220 __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT)
221
222#ifdef CONFIG_SMP
223
224extern void smp_ctl_set_bit(int cr, int bit);
225extern void smp_ctl_clear_bit(int cr, int bit);
226#define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
227#define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
228
229#else
230
231#define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit)
232#define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit)
233
234#endif /* CONFIG_SMP */
235
236#define MAX_FACILITY_BIT (256*8) /* stfle_fac_list has 256 bytes */
237
238/*
239 * The test_facility function uses the bit odering where the MSB is bit 0.
240 * That makes it easier to query facility bits with the bit number as
241 * documented in the Principles of Operation.
242 */
243static inline int test_facility(unsigned long nr)
244{
245 unsigned char *ptr;
246
247 if (nr >= MAX_FACILITY_BIT)
248 return 0;
249 ptr = (unsigned char *) &S390_lowcore.stfle_fac_list + (nr >> 3);
250 return (*ptr & (0x80 >> (nr & 7))) != 0;
251}
252
253/**
254 * stfle - Store facility list extended
255 * @stfle_fac_list: array where facility list can be stored
256 * @size: size of passed in array in double words
257 */
258static inline void stfle(u64 *stfle_fac_list, int size)
259{
260 unsigned long nr;
261
262 preempt_disable();
263 S390_lowcore.stfl_fac_list = 0;
264 asm volatile(
265 " .insn s,0xb2b10000,0(0)\n" /* stfl */
266 "0:\n"
267 EX_TABLE(0b, 0b)
268 : "=m" (S390_lowcore.stfl_fac_list));
269 nr = 4; /* bytes stored by stfl */
270 memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
271 if (S390_lowcore.stfl_fac_list & 0x01000000) {
272 /* More facility bits available with stfle */
273 register unsigned long reg0 asm("0") = size - 1;
274
275 asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */
276 : "+d" (reg0)
277 : "a" (stfle_fac_list)
278 : "memory", "cc");
279 nr = (reg0 + 1) * 8; /* # bytes stored by stfle */
280 }
281 memset((char *) stfle_fac_list + nr, 0, size * 8 - nr);
282 preempt_enable();
283}
284
285static inline unsigned short stap(void)
286{
287 unsigned short cpu_address;
288
289 asm volatile("stap %0" : "=m" (cpu_address));
290 return cpu_address;
291}
292
293extern void (*_machine_restart)(char *command);
294extern void (*_machine_halt)(void);
295extern void (*_machine_power_off)(void);
296
297extern unsigned long arch_align_stack(unsigned long sp);
298
299static inline int tprot(unsigned long addr)
300{
301 int rc = -EFAULT;
302
303 asm volatile(
304 " tprot 0(%1),0\n"
305 "0: ipm %0\n"
306 " srl %0,28\n"
307 "1:\n"
308 EX_TABLE(0b,1b)
309 : "+d" (rc) : "a" (addr) : "cc");
310 return rc;
311}
312
313#endif /* __KERNEL__ */
314
315#endif
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h
index 2b23885e81e9..8f2cada4f7c9 100644
--- a/arch/s390/include/asm/uaccess.h
+++ b/arch/s390/include/asm/uaccess.h
@@ -16,6 +16,7 @@
16 */ 16 */
17#include <linux/sched.h> 17#include <linux/sched.h>
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <asm/ctl_reg.h>
19 20
20#define VERIFY_READ 0 21#define VERIFY_READ 0
21#define VERIFY_WRITE 1 22#define VERIFY_WRITE 1
@@ -375,4 +376,9 @@ clear_user(void __user *to, unsigned long n)
375 return n; 376 return n;
376} 377}
377 378
379extern int memcpy_real(void *, void *, size_t);
380extern void copy_to_absolute_zero(void *dest, void *src, size_t count);
381extern int copy_to_user_real(void __user *dest, void *src, size_t count);
382extern int copy_from_user_real(void *dest, void __user *src, size_t count);
383
378#endif /* __S390_UACCESS_H */ 384#endif /* __S390_UACCESS_H */
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index ed8c913db79e..83e6edf5cf17 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -12,7 +12,6 @@
12#include <asm/timer.h> 12#include <asm/timer.h>
13#include <asm/vdso.h> 13#include <asm/vdso.h>
14#include <asm/pgtable.h> 14#include <asm/pgtable.h>
15#include <asm/system.h>
16 15
17/* 16/*
18 * Make sure that the compiler is new enough. We want a compiler that 17 * Make sure that the compiler is new enough. We want a compiler that
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 53a82c8d50e9..28040fd5e8a2 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -27,6 +27,7 @@
27#include <asm/ucontext.h> 27#include <asm/ucontext.h>
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/lowcore.h> 29#include <asm/lowcore.h>
30#include <asm/switch_to.h>
30#include "compat_linux.h" 31#include "compat_linux.h"
31#include "compat_ptrace.h" 32#include "compat_ptrace.h"
32#include "entry.h" 33#include "entry.h"
diff --git a/arch/s390/kernel/cpcmd.c b/arch/s390/kernel/cpcmd.c
index 3e8b8816f309..e3dd886e1b32 100644
--- a/arch/s390/kernel/cpcmd.c
+++ b/arch/s390/kernel/cpcmd.c
@@ -18,7 +18,6 @@
18#include <linux/string.h> 18#include <linux/string.h>
19#include <asm/ebcdic.h> 19#include <asm/ebcdic.h>
20#include <asm/cpcmd.h> 20#include <asm/cpcmd.h>
21#include <asm/system.h>
22#include <asm/io.h> 21#include <asm/io.h>
23 22
24static DEFINE_SPINLOCK(cpcmd_lock); 23static DEFINE_SPINLOCK(cpcmd_lock);
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index e2f847599c8e..3221c6fca8bb 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -24,7 +24,6 @@
24#include <linux/kprobes.h> 24#include <linux/kprobes.h>
25#include <linux/kdebug.h> 25#include <linux/kdebug.h>
26 26
27#include <asm/system.h>
28#include <asm/uaccess.h> 27#include <asm/uaccess.h>
29#include <asm/io.h> 28#include <asm/io.h>
30#include <linux/atomic.h> 29#include <linux/atomic.h>
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 578eb4e6d157..9475e682727f 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -29,7 +29,7 @@
29#include <asm/sysinfo.h> 29#include <asm/sysinfo.h>
30#include <asm/cpcmd.h> 30#include <asm/cpcmd.h>
31#include <asm/sclp.h> 31#include <asm/sclp.h>
32#include <asm/system.h> 32#include <asm/facility.h>
33#include "entry.h" 33#include "entry.h"
34 34
35/* 35/*
diff --git a/arch/s390/kernel/lgr.c b/arch/s390/kernel/lgr.c
index 8431b92ca3ae..ac39e7a731fc 100644
--- a/arch/s390/kernel/lgr.c
+++ b/arch/s390/kernel/lgr.c
@@ -10,7 +10,6 @@
10#include <linux/slab.h> 10#include <linux/slab.h>
11#include <asm/sysinfo.h> 11#include <asm/sysinfo.h>
12#include <asm/ebcdic.h> 12#include <asm/ebcdic.h>
13#include <asm/system.h>
14#include <asm/debug.h> 13#include <asm/debug.h>
15#include <asm/ipl.h> 14#include <asm/ipl.h>
16 15
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
index 0f8cdf1268d0..bdad47d54478 100644
--- a/arch/s390/kernel/machine_kexec.c
+++ b/arch/s390/kernel/machine_kexec.c
@@ -19,7 +19,6 @@
19#include <asm/setup.h> 19#include <asm/setup.h>
20#include <asm/pgtable.h> 20#include <asm/pgtable.h>
21#include <asm/pgalloc.h> 21#include <asm/pgalloc.h>
22#include <asm/system.h>
23#include <asm/smp.h> 22#include <asm/smp.h>
24#include <asm/reset.h> 23#include <asm/reset.h>
25#include <asm/ipl.h> 24#include <asm/ipl.h>
diff --git a/arch/s390/kernel/os_info.c b/arch/s390/kernel/os_info.c
index bbe522672e06..e8d6c214d498 100644
--- a/arch/s390/kernel/os_info.c
+++ b/arch/s390/kernel/os_info.c
@@ -12,7 +12,6 @@
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <asm/checksum.h> 13#include <asm/checksum.h>
14#include <asm/lowcore.h> 14#include <asm/lowcore.h>
15#include <asm/system.h>
16#include <asm/os_info.h> 15#include <asm/os_info.h>
17 16
18/* 17/*
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 3732e4c09cbe..60055cefdd04 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -23,13 +23,13 @@
23#include <linux/kprobes.h> 23#include <linux/kprobes.h>
24#include <linux/random.h> 24#include <linux/random.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <asm/system.h>
27#include <asm/io.h> 26#include <asm/io.h>
28#include <asm/processor.h> 27#include <asm/processor.h>
29#include <asm/irq.h> 28#include <asm/irq.h>
30#include <asm/timer.h> 29#include <asm/timer.h>
31#include <asm/nmi.h> 30#include <asm/nmi.h>
32#include <asm/smp.h> 31#include <asm/smp.h>
32#include <asm/switch_to.h>
33#include "entry.h" 33#include "entry.h"
34 34
35asmlinkage void ret_from_fork(void) asm ("ret_from_fork"); 35asmlinkage void ret_from_fork(void) asm ("ret_from_fork");
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 61f95489d70c..02f300fbf070 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -26,9 +26,9 @@
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28#include <asm/pgalloc.h> 28#include <asm/pgalloc.h>
29#include <asm/system.h>
30#include <asm/uaccess.h> 29#include <asm/uaccess.h>
31#include <asm/unistd.h> 30#include <asm/unistd.h>
31#include <asm/switch_to.h>
32#include "entry.h" 32#include "entry.h"
33 33
34#ifdef CONFIG_COMPAT 34#ifdef CONFIG_COMPAT
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 38e751278bf7..1581ea2e027a 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -50,7 +50,6 @@
50 50
51#include <asm/ipl.h> 51#include <asm/ipl.h>
52#include <asm/uaccess.h> 52#include <asm/uaccess.h>
53#include <asm/system.h>
54#include <asm/smp.h> 53#include <asm/smp.h>
55#include <asm/mmu_context.h> 54#include <asm/mmu_context.h>
56#include <asm/cpcmd.h> 55#include <asm/cpcmd.h>
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index f29f5ef400e5..f7582b27f600 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -30,6 +30,7 @@
30#include <asm/ucontext.h> 30#include <asm/ucontext.h>
31#include <asm/uaccess.h> 31#include <asm/uaccess.h>
32#include <asm/lowcore.h> 32#include <asm/lowcore.h>
33#include <asm/switch_to.h>
33#include "entry.h" 34#include "entry.h"
34 35
35#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 36#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
diff --git a/arch/s390/kernel/suspend.c b/arch/s390/kernel/suspend.c
index 47df775c844d..aa1494d0e380 100644
--- a/arch/s390/kernel/suspend.c
+++ b/arch/s390/kernel/suspend.c
@@ -9,7 +9,7 @@
9#include <linux/pfn.h> 9#include <linux/pfn.h>
10#include <linux/suspend.h> 10#include <linux/suspend.h>
11#include <linux/mm.h> 11#include <linux/mm.h>
12#include <asm/system.h> 12#include <asm/ctl_reg.h>
13 13
14/* 14/*
15 * References to section boundaries 15 * References to section boundaries
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index cd6ebe12c481..77cdf4234ebc 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -33,7 +33,6 @@
33#include <linux/kprobes.h> 33#include <linux/kprobes.h>
34#include <linux/bug.h> 34#include <linux/bug.h>
35#include <linux/utsname.h> 35#include <linux/utsname.h>
36#include <asm/system.h>
37#include <asm/uaccess.h> 36#include <asm/uaccess.h>
38#include <asm/io.h> 37#include <asm/io.h>
39#include <linux/atomic.h> 38#include <linux/atomic.h>
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index e704a9965f90..d95427e32a56 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -25,12 +25,12 @@
25#include <linux/compat.h> 25#include <linux/compat.h>
26#include <asm/asm-offsets.h> 26#include <asm/asm-offsets.h>
27#include <asm/pgtable.h> 27#include <asm/pgtable.h>
28#include <asm/system.h>
29#include <asm/processor.h> 28#include <asm/processor.h>
30#include <asm/mmu.h> 29#include <asm/mmu.h>
31#include <asm/mmu_context.h> 30#include <asm/mmu_context.h>
32#include <asm/sections.h> 31#include <asm/sections.h>
33#include <asm/vdso.h> 32#include <asm/vdso.h>
33#include <asm/facility.h>
34 34
35#if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT) 35#if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT)
36extern char vdso32_start, vdso32_end; 36extern char vdso32_start, vdso32_end;
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index d1c445732451..d56de16a651a 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -27,7 +27,7 @@
27#include <asm/lowcore.h> 27#include <asm/lowcore.h>
28#include <asm/pgtable.h> 28#include <asm/pgtable.h>
29#include <asm/nmi.h> 29#include <asm/nmi.h>
30#include <asm/system.h> 30#include <asm/switch_to.h>
31#include "kvm-s390.h" 31#include "kvm-s390.h"
32#include "gaccess.h" 32#include "gaccess.h"
33 33
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index b17c42df61c9..46ef3fd0663b 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -32,10 +32,10 @@
32#include <linux/uaccess.h> 32#include <linux/uaccess.h>
33#include <linux/hugetlb.h> 33#include <linux/hugetlb.h>
34#include <asm/asm-offsets.h> 34#include <asm/asm-offsets.h>
35#include <asm/system.h>
36#include <asm/pgtable.h> 35#include <asm/pgtable.h>
37#include <asm/irq.h> 36#include <asm/irq.h>
38#include <asm/mmu_context.h> 37#include <asm/mmu_context.h>
38#include <asm/facility.h>
39#include "../kernel/entry.h" 39#include "../kernel/entry.h"
40 40
41#ifndef CONFIG_64BIT 41#ifndef CONFIG_64BIT
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 50236610de83..2bea0605856e 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -29,7 +29,6 @@
29#include <linux/export.h> 29#include <linux/export.h>
30#include <linux/gfp.h> 30#include <linux/gfp.h>
31#include <asm/processor.h> 31#include <asm/processor.h>
32#include <asm/system.h>
33#include <asm/uaccess.h> 32#include <asm/uaccess.h>
34#include <asm/pgtable.h> 33#include <asm/pgtable.h>
35#include <asm/pgalloc.h> 34#include <asm/pgalloc.h>
@@ -38,6 +37,7 @@
38#include <asm/tlb.h> 37#include <asm/tlb.h>
39#include <asm/tlbflush.h> 38#include <asm/tlbflush.h>
40#include <asm/sections.h> 39#include <asm/sections.h>
40#include <asm/ctl_reg.h>
41 41
42pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE))); 42pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
43 43
diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c
index 1cb8427bedfb..7bb15fcca75e 100644
--- a/arch/s390/mm/maccess.c
+++ b/arch/s390/mm/maccess.c
@@ -12,7 +12,7 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/errno.h> 13#include <linux/errno.h>
14#include <linux/gfp.h> 14#include <linux/gfp.h>
15#include <asm/system.h> 15#include <asm/ctl_reg.h>
16 16
17/* 17/*
18 * This function writes to kernel memory bypassing DAT and possible 18 * This function writes to kernel memory bypassing DAT and possible
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 51b0738e13d1..373adf69b01c 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -18,7 +18,6 @@
18#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20 20
21#include <asm/system.h>
22#include <asm/pgtable.h> 21#include <asm/pgtable.h>
23#include <asm/pgalloc.h> 22#include <asm/pgalloc.h>
24#include <asm/tlb.h> 23#include <asm/tlb.h>
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c
index 12bea05a0fc1..59c9278befc9 100644
--- a/arch/s390/oprofile/hwsampler.c
+++ b/arch/s390/oprofile/hwsampler.c
@@ -18,6 +18,7 @@
18#include <linux/oom.h> 18#include <linux/oom.h>
19#include <linux/oprofile.h> 19#include <linux/oprofile.h>
20 20
21#include <asm/facility.h>
21#include <asm/lowcore.h> 22#include <asm/lowcore.h>
22#include <asm/irq.h> 23#include <asm/irq.h>
23 24