diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 13:51:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 13:51:10 -0400 |
commit | 8ee78c6fb982b3a7343faf561e7937d4cfa955ff (patch) | |
tree | 93d9327018e648174fb83b4144eed89de72693dd /arch | |
parent | aac422afeffa9093544799c3257a96b55ba42044 (diff) | |
parent | 491af9903b858ee7c36735dc31708fe4074ce56f (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 patches from Heiko Carstens:
"A couple of s390 patches for the 3.5 merge window. Just a collection
of bug fixes and cleanups."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
s390/uaccess: fix access_ok compile warnings
s390/cmpxchg: select HAVE_CMPXCHG_LOCAL option
s390/cmpxchg: fix sign extension bugs
s390/cmpxchg: fix 1 and 2 byte memory accesses
s390/cmpxchg: fix compile warnings specific to s390
s390/cmpxchg: add missing memory barrier to cmpxchg64
s390/cpu: remove cpu "capabilities" sysfs attribute
s390/kernel: Fix smp_call_ipl_cpu() for offline CPUs
s390/kernel: Introduce memcpy_absolute() function
s390/headers: replace __s390x__ with CONFIG_64BIT where possible
s390/headers: remove #ifdef __KERNEL__ from not exported headers
s390/irq: split irq stats for cpu-measurement alert facilities
s390/kexec: Move early_pgm_check_handler() to text section
s390/kdump: Use real mode for PSW restart and kexec
s390/kdump: Account /sys/kernel/kexec_crash_size changes in OS info
s390/kernel: Remove OS info init function call and diag 308 for kdump
Diffstat (limited to 'arch')
48 files changed, 244 insertions, 306 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index b403c533432c..a39b4690c171 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -87,6 +87,7 @@ config S390 | |||
87 | select ARCH_SAVE_PAGE_KEYS if HIBERNATION | 87 | select ARCH_SAVE_PAGE_KEYS if HIBERNATION |
88 | select HAVE_MEMBLOCK | 88 | select HAVE_MEMBLOCK |
89 | select HAVE_MEMBLOCK_NODE_MAP | 89 | select HAVE_MEMBLOCK_NODE_MAP |
90 | select HAVE_CMPXCHG_LOCAL | ||
90 | select ARCH_DISCARD_MEMBLOCK | 91 | select ARCH_DISCARD_MEMBLOCK |
91 | select ARCH_INLINE_SPIN_TRYLOCK | 92 | select ARCH_INLINE_SPIN_TRYLOCK |
92 | select ARCH_INLINE_SPIN_TRYLOCK_BH | 93 | select ARCH_INLINE_SPIN_TRYLOCK_BH |
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index e5beb490959b..a6ff5a83e227 100644 --- a/arch/s390/include/asm/bitops.h +++ b/arch/s390/include/asm/bitops.h | |||
@@ -13,8 +13,6 @@ | |||
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #ifdef __KERNEL__ | ||
17 | |||
18 | #ifndef _LINUX_BITOPS_H | 16 | #ifndef _LINUX_BITOPS_H |
19 | #error only <linux/bitops.h> can be included directly | 17 | #error only <linux/bitops.h> can be included directly |
20 | #endif | 18 | #endif |
@@ -63,7 +61,7 @@ extern const char _ni_bitmap[]; | |||
63 | extern const char _zb_findmap[]; | 61 | extern const char _zb_findmap[]; |
64 | extern const char _sb_findmap[]; | 62 | extern const char _sb_findmap[]; |
65 | 63 | ||
66 | #ifndef __s390x__ | 64 | #ifndef CONFIG_64BIT |
67 | 65 | ||
68 | #define __BITOPS_ALIGN 3 | 66 | #define __BITOPS_ALIGN 3 |
69 | #define __BITOPS_WORDSIZE 32 | 67 | #define __BITOPS_WORDSIZE 32 |
@@ -83,7 +81,7 @@ extern const char _sb_findmap[]; | |||
83 | : "d" (__val), "Q" (*(unsigned long *) __addr) \ | 81 | : "d" (__val), "Q" (*(unsigned long *) __addr) \ |
84 | : "cc"); | 82 | : "cc"); |
85 | 83 | ||
86 | #else /* __s390x__ */ | 84 | #else /* CONFIG_64BIT */ |
87 | 85 | ||
88 | #define __BITOPS_ALIGN 7 | 86 | #define __BITOPS_ALIGN 7 |
89 | #define __BITOPS_WORDSIZE 64 | 87 | #define __BITOPS_WORDSIZE 64 |
@@ -103,7 +101,7 @@ extern const char _sb_findmap[]; | |||
103 | : "d" (__val), "Q" (*(unsigned long *) __addr) \ | 101 | : "d" (__val), "Q" (*(unsigned long *) __addr) \ |
104 | : "cc"); | 102 | : "cc"); |
105 | 103 | ||
106 | #endif /* __s390x__ */ | 104 | #endif /* CONFIG_64BIT */ |
107 | 105 | ||
108 | #define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE) | 106 | #define __BITOPS_WORDS(bits) (((bits)+__BITOPS_WORDSIZE-1)/__BITOPS_WORDSIZE) |
109 | #define __BITOPS_BARRIER() asm volatile("" : : : "memory") | 107 | #define __BITOPS_BARRIER() asm volatile("" : : : "memory") |
@@ -412,7 +410,7 @@ static inline unsigned long __ffz_word_loop(const unsigned long *addr, | |||
412 | unsigned long bytes = 0; | 410 | unsigned long bytes = 0; |
413 | 411 | ||
414 | asm volatile( | 412 | asm volatile( |
415 | #ifndef __s390x__ | 413 | #ifndef CONFIG_64BIT |
416 | " ahi %1,-1\n" | 414 | " ahi %1,-1\n" |
417 | " sra %1,5\n" | 415 | " sra %1,5\n" |
418 | " jz 1f\n" | 416 | " jz 1f\n" |
@@ -449,7 +447,7 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr, | |||
449 | unsigned long bytes = 0; | 447 | unsigned long bytes = 0; |
450 | 448 | ||
451 | asm volatile( | 449 | asm volatile( |
452 | #ifndef __s390x__ | 450 | #ifndef CONFIG_64BIT |
453 | " ahi %1,-1\n" | 451 | " ahi %1,-1\n" |
454 | " sra %1,5\n" | 452 | " sra %1,5\n" |
455 | " jz 1f\n" | 453 | " jz 1f\n" |
@@ -481,7 +479,7 @@ static inline unsigned long __ffs_word_loop(const unsigned long *addr, | |||
481 | */ | 479 | */ |
482 | static inline unsigned long __ffz_word(unsigned long nr, unsigned long word) | 480 | static inline unsigned long __ffz_word(unsigned long nr, unsigned long word) |
483 | { | 481 | { |
484 | #ifdef __s390x__ | 482 | #ifdef CONFIG_64BIT |
485 | if ((word & 0xffffffff) == 0xffffffff) { | 483 | if ((word & 0xffffffff) == 0xffffffff) { |
486 | word >>= 32; | 484 | word >>= 32; |
487 | nr += 32; | 485 | nr += 32; |
@@ -505,7 +503,7 @@ static inline unsigned long __ffz_word(unsigned long nr, unsigned long word) | |||
505 | */ | 503 | */ |
506 | static inline unsigned long __ffs_word(unsigned long nr, unsigned long word) | 504 | static inline unsigned long __ffs_word(unsigned long nr, unsigned long word) |
507 | { | 505 | { |
508 | #ifdef __s390x__ | 506 | #ifdef CONFIG_64BIT |
509 | if ((word & 0xffffffff) == 0) { | 507 | if ((word & 0xffffffff) == 0) { |
510 | word >>= 32; | 508 | word >>= 32; |
511 | nr += 32; | 509 | nr += 32; |
@@ -546,7 +544,7 @@ static inline unsigned long __load_ulong_le(const unsigned long *p, | |||
546 | unsigned long word; | 544 | unsigned long word; |
547 | 545 | ||
548 | p = (unsigned long *)((unsigned long) p + offset); | 546 | p = (unsigned long *)((unsigned long) p + offset); |
549 | #ifndef __s390x__ | 547 | #ifndef CONFIG_64BIT |
550 | asm volatile( | 548 | asm volatile( |
551 | " ic %0,%O1(%R1)\n" | 549 | " ic %0,%O1(%R1)\n" |
552 | " icm %0,2,%O1+1(%R1)\n" | 550 | " icm %0,2,%O1+1(%R1)\n" |
@@ -834,7 +832,4 @@ static inline int find_next_bit_le(void *vaddr, unsigned long size, | |||
834 | 832 | ||
835 | #include <asm-generic/bitops/ext2-atomic-setbit.h> | 833 | #include <asm-generic/bitops/ext2-atomic-setbit.h> |
836 | 834 | ||
837 | |||
838 | #endif /* __KERNEL__ */ | ||
839 | |||
840 | #endif /* _S390_BITOPS_H */ | 835 | #endif /* _S390_BITOPS_H */ |
diff --git a/arch/s390/include/asm/cio.h b/arch/s390/include/asm/cio.h index fc50a3342da3..4c8d4d5b8bd2 100644 --- a/arch/s390/include/asm/cio.h +++ b/arch/s390/include/asm/cio.h | |||
@@ -10,8 +10,6 @@ | |||
10 | #include <linux/spinlock.h> | 10 | #include <linux/spinlock.h> |
11 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | 12 | ||
13 | #ifdef __KERNEL__ | ||
14 | |||
15 | #define LPM_ANYPATH 0xff | 13 | #define LPM_ANYPATH 0xff |
16 | #define __MAX_CSSID 0 | 14 | #define __MAX_CSSID 0 |
17 | 15 | ||
@@ -291,5 +289,3 @@ int chsc_sstpc(void *page, unsigned int op, u16 ctrl); | |||
291 | int chsc_sstpi(void *page, void *result, size_t size); | 289 | int chsc_sstpi(void *page, void *result, size_t size); |
292 | 290 | ||
293 | #endif | 291 | #endif |
294 | |||
295 | #endif | ||
diff --git a/arch/s390/include/asm/cmpxchg.h b/arch/s390/include/asm/cmpxchg.h index 81d7908416cf..8d798e962b63 100644 --- a/arch/s390/include/asm/cmpxchg.h +++ b/arch/s390/include/asm/cmpxchg.h | |||
@@ -29,7 +29,7 @@ static inline unsigned long __xchg(unsigned long x, void *ptr, int size) | |||
29 | " cs %0,0,%4\n" | 29 | " cs %0,0,%4\n" |
30 | " jl 0b\n" | 30 | " jl 0b\n" |
31 | : "=&d" (old), "=Q" (*(int *) addr) | 31 | : "=&d" (old), "=Q" (*(int *) addr) |
32 | : "d" (x << shift), "d" (~(255 << shift)), | 32 | : "d" ((x & 0xff) << shift), "d" (~(0xff << shift)), |
33 | "Q" (*(int *) addr) : "memory", "cc", "0"); | 33 | "Q" (*(int *) addr) : "memory", "cc", "0"); |
34 | return old >> shift; | 34 | return old >> shift; |
35 | case 2: | 35 | case 2: |
@@ -44,7 +44,7 @@ static inline unsigned long __xchg(unsigned long x, void *ptr, int size) | |||
44 | " cs %0,0,%4\n" | 44 | " cs %0,0,%4\n" |
45 | " jl 0b\n" | 45 | " jl 0b\n" |
46 | : "=&d" (old), "=Q" (*(int *) addr) | 46 | : "=&d" (old), "=Q" (*(int *) addr) |
47 | : "d" (x << shift), "d" (~(65535 << shift)), | 47 | : "d" ((x & 0xffff) << shift), "d" (~(0xffff << shift)), |
48 | "Q" (*(int *) addr) : "memory", "cc", "0"); | 48 | "Q" (*(int *) addr) : "memory", "cc", "0"); |
49 | return old >> shift; | 49 | return old >> shift; |
50 | case 4: | 50 | case 4: |
@@ -113,9 +113,10 @@ static inline unsigned long __cmpxchg(void *ptr, unsigned long old, | |||
113 | " nr %1,%5\n" | 113 | " nr %1,%5\n" |
114 | " jnz 0b\n" | 114 | " jnz 0b\n" |
115 | "1:" | 115 | "1:" |
116 | : "=&d" (prev), "=&d" (tmp), "=Q" (*(int *) ptr) | 116 | : "=&d" (prev), "=&d" (tmp), "+Q" (*(int *) addr) |
117 | : "d" (old << shift), "d" (new << shift), | 117 | : "d" ((old & 0xff) << shift), |
118 | "d" (~(255 << shift)), "Q" (*(int *) ptr) | 118 | "d" ((new & 0xff) << shift), |
119 | "d" (~(0xff << shift)) | ||
119 | : "memory", "cc"); | 120 | : "memory", "cc"); |
120 | return prev >> shift; | 121 | return prev >> shift; |
121 | case 2: | 122 | case 2: |
@@ -134,9 +135,10 @@ static inline unsigned long __cmpxchg(void *ptr, unsigned long old, | |||
134 | " nr %1,%5\n" | 135 | " nr %1,%5\n" |
135 | " jnz 0b\n" | 136 | " jnz 0b\n" |
136 | "1:" | 137 | "1:" |
137 | : "=&d" (prev), "=&d" (tmp), "=Q" (*(int *) ptr) | 138 | : "=&d" (prev), "=&d" (tmp), "+Q" (*(int *) addr) |
138 | : "d" (old << shift), "d" (new << shift), | 139 | : "d" ((old & 0xffff) << shift), |
139 | "d" (~(65535 << shift)), "Q" (*(int *) ptr) | 140 | "d" ((new & 0xffff) << shift), |
141 | "d" (~(0xffff << shift)) | ||
140 | : "memory", "cc"); | 142 | : "memory", "cc"); |
141 | return prev >> shift; | 143 | return prev >> shift; |
142 | case 4: | 144 | case 4: |
@@ -160,9 +162,14 @@ static inline unsigned long __cmpxchg(void *ptr, unsigned long old, | |||
160 | return old; | 162 | return old; |
161 | } | 163 | } |
162 | 164 | ||
163 | #define cmpxchg(ptr, o, n) \ | 165 | #define cmpxchg(ptr, o, n) \ |
164 | ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ | 166 | ({ \ |
165 | (unsigned long)(n), sizeof(*(ptr)))) | 167 | __typeof__(*(ptr)) __ret; \ |
168 | __ret = (__typeof__(*(ptr))) \ | ||
169 | __cmpxchg((ptr), (unsigned long)(o), (unsigned long)(n), \ | ||
170 | sizeof(*(ptr))); \ | ||
171 | __ret; \ | ||
172 | }) | ||
166 | 173 | ||
167 | #ifdef CONFIG_64BIT | 174 | #ifdef CONFIG_64BIT |
168 | #define cmpxchg64(ptr, o, n) \ | 175 | #define cmpxchg64(ptr, o, n) \ |
@@ -181,13 +188,19 @@ static inline unsigned long long __cmpxchg64(void *ptr, | |||
181 | " cds %0,%2,%1" | 188 | " cds %0,%2,%1" |
182 | : "+&d" (rp_old), "=Q" (ptr) | 189 | : "+&d" (rp_old), "=Q" (ptr) |
183 | : "d" (rp_new), "Q" (ptr) | 190 | : "d" (rp_new), "Q" (ptr) |
184 | : "cc"); | 191 | : "memory", "cc"); |
185 | return rp_old.pair; | 192 | return rp_old.pair; |
186 | } | 193 | } |
187 | #define cmpxchg64(ptr, o, n) \ | 194 | |
188 | ((__typeof__(*(ptr)))__cmpxchg64((ptr), \ | 195 | #define cmpxchg64(ptr, o, n) \ |
189 | (unsigned long long)(o), \ | 196 | ({ \ |
190 | (unsigned long long)(n))) | 197 | __typeof__(*(ptr)) __ret; \ |
198 | __ret = (__typeof__(*(ptr))) \ | ||
199 | __cmpxchg64((ptr), \ | ||
200 | (unsigned long long)(o), \ | ||
201 | (unsigned long long)(n)); \ | ||
202 | __ret; \ | ||
203 | }) | ||
191 | #endif /* CONFIG_64BIT */ | 204 | #endif /* CONFIG_64BIT */ |
192 | 205 | ||
193 | #include <asm-generic/cmpxchg-local.h> | 206 | #include <asm-generic/cmpxchg-local.h> |
@@ -216,8 +229,13 @@ static inline unsigned long __cmpxchg_local(void *ptr, | |||
216 | * them available. | 229 | * them available. |
217 | */ | 230 | */ |
218 | #define cmpxchg_local(ptr, o, n) \ | 231 | #define cmpxchg_local(ptr, o, n) \ |
219 | ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ | 232 | ({ \ |
220 | (unsigned long)(n), sizeof(*(ptr)))) | 233 | __typeof__(*(ptr)) __ret; \ |
234 | __ret = (__typeof__(*(ptr))) \ | ||
235 | __cmpxchg_local((ptr), (unsigned long)(o), \ | ||
236 | (unsigned long)(n), sizeof(*(ptr))); \ | ||
237 | __ret; \ | ||
238 | }) | ||
221 | 239 | ||
222 | #define cmpxchg64_local(ptr, o, n) cmpxchg64((ptr), (o), (n)) | 240 | #define cmpxchg64_local(ptr, o, n) cmpxchg64((ptr), (o), (n)) |
223 | 241 | ||
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 24ef186a1c4f..718374de9c7f 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
@@ -21,15 +21,15 @@ typedef unsigned long long __nocast cputime64_t; | |||
21 | 21 | ||
22 | static inline unsigned long __div(unsigned long long n, unsigned long base) | 22 | static inline unsigned long __div(unsigned long long n, unsigned long base) |
23 | { | 23 | { |
24 | #ifndef __s390x__ | 24 | #ifndef CONFIG_64BIT |
25 | register_pair rp; | 25 | register_pair rp; |
26 | 26 | ||
27 | rp.pair = n >> 1; | 27 | rp.pair = n >> 1; |
28 | asm ("dr %0,%1" : "+d" (rp) : "d" (base >> 1)); | 28 | asm ("dr %0,%1" : "+d" (rp) : "d" (base >> 1)); |
29 | return rp.subreg.odd; | 29 | return rp.subreg.odd; |
30 | #else /* __s390x__ */ | 30 | #else /* CONFIG_64BIT */ |
31 | return n / base; | 31 | return n / base; |
32 | #endif /* __s390x__ */ | 32 | #endif /* CONFIG_64BIT */ |
33 | } | 33 | } |
34 | 34 | ||
35 | #define cputime_one_jiffy jiffies_to_cputime(1) | 35 | #define cputime_one_jiffy jiffies_to_cputime(1) |
@@ -100,7 +100,7 @@ static inline void cputime_to_timespec(const cputime_t cputime, | |||
100 | struct timespec *value) | 100 | struct timespec *value) |
101 | { | 101 | { |
102 | unsigned long long __cputime = (__force unsigned long long) cputime; | 102 | unsigned long long __cputime = (__force unsigned long long) cputime; |
103 | #ifndef __s390x__ | 103 | #ifndef CONFIG_64BIT |
104 | register_pair rp; | 104 | register_pair rp; |
105 | 105 | ||
106 | rp.pair = __cputime >> 1; | 106 | rp.pair = __cputime >> 1; |
@@ -128,7 +128,7 @@ static inline void cputime_to_timeval(const cputime_t cputime, | |||
128 | struct timeval *value) | 128 | struct timeval *value) |
129 | { | 129 | { |
130 | unsigned long long __cputime = (__force unsigned long long) cputime; | 130 | unsigned long long __cputime = (__force unsigned long long) cputime; |
131 | #ifndef __s390x__ | 131 | #ifndef CONFIG_64BIT |
132 | register_pair rp; | 132 | register_pair rp; |
133 | 133 | ||
134 | rp.pair = __cputime >> 1; | 134 | rp.pair = __cputime >> 1; |
diff --git a/arch/s390/include/asm/ctl_reg.h b/arch/s390/include/asm/ctl_reg.h index ecde9417d669..debfda33d1f8 100644 --- a/arch/s390/include/asm/ctl_reg.h +++ b/arch/s390/include/asm/ctl_reg.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #ifndef __ASM_CTL_REG_H | 7 | #ifndef __ASM_CTL_REG_H |
8 | #define __ASM_CTL_REG_H | 8 | #define __ASM_CTL_REG_H |
9 | 9 | ||
10 | #ifdef __s390x__ | 10 | #ifdef CONFIG_64BIT |
11 | 11 | ||
12 | #define __ctl_load(array, low, high) ({ \ | 12 | #define __ctl_load(array, low, high) ({ \ |
13 | typedef struct { char _[sizeof(array)]; } addrtype; \ | 13 | typedef struct { char _[sizeof(array)]; } addrtype; \ |
@@ -25,7 +25,7 @@ | |||
25 | : "i" (low), "i" (high)); \ | 25 | : "i" (low), "i" (high)); \ |
26 | }) | 26 | }) |
27 | 27 | ||
28 | #else /* __s390x__ */ | 28 | #else /* CONFIG_64BIT */ |
29 | 29 | ||
30 | #define __ctl_load(array, low, high) ({ \ | 30 | #define __ctl_load(array, low, high) ({ \ |
31 | typedef struct { char _[sizeof(array)]; } addrtype; \ | 31 | typedef struct { char _[sizeof(array)]; } addrtype; \ |
@@ -43,7 +43,7 @@ | |||
43 | : "i" (low), "i" (high)); \ | 43 | : "i" (low), "i" (high)); \ |
44 | }) | 44 | }) |
45 | 45 | ||
46 | #endif /* __s390x__ */ | 46 | #endif /* CONFIG_64BIT */ |
47 | 47 | ||
48 | #define __ctl_set_bit(cr, bit) ({ \ | 48 | #define __ctl_set_bit(cr, bit) ({ \ |
49 | unsigned long __dummy; \ | 49 | unsigned long __dummy; \ |
diff --git a/arch/s390/include/asm/current.h b/arch/s390/include/asm/current.h index 83cf36cde2da..7a68084ec2f0 100644 --- a/arch/s390/include/asm/current.h +++ b/arch/s390/include/asm/current.h | |||
@@ -11,13 +11,10 @@ | |||
11 | #ifndef _S390_CURRENT_H | 11 | #ifndef _S390_CURRENT_H |
12 | #define _S390_CURRENT_H | 12 | #define _S390_CURRENT_H |
13 | 13 | ||
14 | #ifdef __KERNEL__ | ||
15 | #include <asm/lowcore.h> | 14 | #include <asm/lowcore.h> |
16 | 15 | ||
17 | struct task_struct; | 16 | struct task_struct; |
18 | 17 | ||
19 | #define current ((struct task_struct *const)S390_lowcore.current_task) | 18 | #define current ((struct task_struct *const)S390_lowcore.current_task) |
20 | 19 | ||
21 | #endif | ||
22 | |||
23 | #endif /* !(_S390_CURRENT_H) */ | 20 | #endif /* !(_S390_CURRENT_H) */ |
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h index c4ee39f7a4d6..06151e6a3098 100644 --- a/arch/s390/include/asm/elf.h +++ b/arch/s390/include/asm/elf.h | |||
@@ -107,11 +107,11 @@ | |||
107 | /* | 107 | /* |
108 | * These are used to set parameters in the core dumps. | 108 | * These are used to set parameters in the core dumps. |
109 | */ | 109 | */ |
110 | #ifndef __s390x__ | 110 | #ifndef CONFIG_64BIT |
111 | #define ELF_CLASS ELFCLASS32 | 111 | #define ELF_CLASS ELFCLASS32 |
112 | #else /* __s390x__ */ | 112 | #else /* CONFIG_64BIT */ |
113 | #define ELF_CLASS ELFCLASS64 | 113 | #define ELF_CLASS ELFCLASS64 |
114 | #endif /* __s390x__ */ | 114 | #endif /* CONFIG_64BIT */ |
115 | #define ELF_DATA ELFDATA2MSB | 115 | #define ELF_DATA ELFDATA2MSB |
116 | #define ELF_ARCH EM_S390 | 116 | #define ELF_ARCH EM_S390 |
117 | 117 | ||
@@ -181,9 +181,9 @@ extern unsigned long elf_hwcap; | |||
181 | extern char elf_platform[]; | 181 | extern char elf_platform[]; |
182 | #define ELF_PLATFORM (elf_platform) | 182 | #define ELF_PLATFORM (elf_platform) |
183 | 183 | ||
184 | #ifndef __s390x__ | 184 | #ifndef CONFIG_64BIT |
185 | #define SET_PERSONALITY(ex) set_personality(PER_LINUX) | 185 | #define SET_PERSONALITY(ex) set_personality(PER_LINUX) |
186 | #else /* __s390x__ */ | 186 | #else /* CONFIG_64BIT */ |
187 | #define SET_PERSONALITY(ex) \ | 187 | #define SET_PERSONALITY(ex) \ |
188 | do { \ | 188 | do { \ |
189 | if (personality(current->personality) != PER_LINUX32) \ | 189 | if (personality(current->personality) != PER_LINUX32) \ |
@@ -194,7 +194,7 @@ do { \ | |||
194 | else \ | 194 | else \ |
195 | clear_thread_flag(TIF_31BIT); \ | 195 | clear_thread_flag(TIF_31BIT); \ |
196 | } while (0) | 196 | } while (0) |
197 | #endif /* __s390x__ */ | 197 | #endif /* CONFIG_64BIT */ |
198 | 198 | ||
199 | #define STACK_RND_MASK 0x7ffUL | 199 | #define STACK_RND_MASK 0x7ffUL |
200 | 200 | ||
diff --git a/arch/s390/include/asm/futex.h b/arch/s390/include/asm/futex.h index 81cf36b691f1..96bc83ea5c90 100644 --- a/arch/s390/include/asm/futex.h +++ b/arch/s390/include/asm/futex.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _ASM_S390_FUTEX_H | 1 | #ifndef _ASM_S390_FUTEX_H |
2 | #define _ASM_S390_FUTEX_H | 2 | #define _ASM_S390_FUTEX_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <linux/futex.h> | 4 | #include <linux/futex.h> |
7 | #include <linux/uaccess.h> | 5 | #include <linux/uaccess.h> |
8 | #include <asm/errno.h> | 6 | #include <asm/errno.h> |
@@ -48,5 +46,4 @@ static inline int futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | |||
48 | return uaccess.futex_atomic_cmpxchg(uval, uaddr, oldval, newval); | 46 | return uaccess.futex_atomic_cmpxchg(uval, uaddr, oldval, newval); |
49 | } | 47 | } |
50 | 48 | ||
51 | #endif /* __KERNEL__ */ | ||
52 | #endif /* _ASM_S390_FUTEX_H */ | 49 | #endif /* _ASM_S390_FUTEX_H */ |
diff --git a/arch/s390/include/asm/idals.h b/arch/s390/include/asm/idals.h index aae276d00383..aef0dde340d1 100644 --- a/arch/s390/include/asm/idals.h +++ b/arch/s390/include/asm/idals.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <asm/cio.h> | 20 | #include <asm/cio.h> |
21 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
22 | 22 | ||
23 | #ifdef __s390x__ | 23 | #ifdef CONFIG_64BIT |
24 | #define IDA_SIZE_LOG 12 /* 11 for 2k , 12 for 4k */ | 24 | #define IDA_SIZE_LOG 12 /* 11 for 2k , 12 for 4k */ |
25 | #else | 25 | #else |
26 | #define IDA_SIZE_LOG 11 /* 11 for 2k , 12 for 4k */ | 26 | #define IDA_SIZE_LOG 11 /* 11 for 2k , 12 for 4k */ |
@@ -33,7 +33,7 @@ | |||
33 | static inline int | 33 | static inline int |
34 | idal_is_needed(void *vaddr, unsigned int length) | 34 | idal_is_needed(void *vaddr, unsigned int length) |
35 | { | 35 | { |
36 | #ifdef __s390x__ | 36 | #ifdef CONFIG_64BIT |
37 | return ((__pa(vaddr) + length - 1) >> 31) != 0; | 37 | return ((__pa(vaddr) + length - 1) >> 31) != 0; |
38 | #else | 38 | #else |
39 | return 0; | 39 | return 0; |
@@ -78,7 +78,7 @@ static inline unsigned long *idal_create_words(unsigned long *idaws, | |||
78 | static inline int | 78 | static inline int |
79 | set_normalized_cda(struct ccw1 * ccw, void *vaddr) | 79 | set_normalized_cda(struct ccw1 * ccw, void *vaddr) |
80 | { | 80 | { |
81 | #ifdef __s390x__ | 81 | #ifdef CONFIG_64BIT |
82 | unsigned int nridaws; | 82 | unsigned int nridaws; |
83 | unsigned long *idal; | 83 | unsigned long *idal; |
84 | 84 | ||
@@ -105,7 +105,7 @@ set_normalized_cda(struct ccw1 * ccw, void *vaddr) | |||
105 | static inline void | 105 | static inline void |
106 | clear_normalized_cda(struct ccw1 * ccw) | 106 | clear_normalized_cda(struct ccw1 * ccw) |
107 | { | 107 | { |
108 | #ifdef __s390x__ | 108 | #ifdef CONFIG_64BIT |
109 | if (ccw->flags & CCW_FLAG_IDA) { | 109 | if (ccw->flags & CCW_FLAG_IDA) { |
110 | kfree((void *)(unsigned long) ccw->cda); | 110 | kfree((void *)(unsigned long) ccw->cda); |
111 | ccw->flags &= ~CCW_FLAG_IDA; | 111 | ccw->flags &= ~CCW_FLAG_IDA; |
@@ -182,7 +182,7 @@ idal_buffer_free(struct idal_buffer *ib) | |||
182 | static inline int | 182 | static inline int |
183 | __idal_buffer_is_needed(struct idal_buffer *ib) | 183 | __idal_buffer_is_needed(struct idal_buffer *ib) |
184 | { | 184 | { |
185 | #ifdef __s390x__ | 185 | #ifdef CONFIG_64BIT |
186 | return ib->size > (4096ul << ib->page_order) || | 186 | return ib->size > (4096ul << ib->page_order) || |
187 | idal_is_needed(ib->data[0], ib->size); | 187 | idal_is_needed(ib->data[0], ib->size); |
188 | #else | 188 | #else |
diff --git a/arch/s390/include/asm/io.h b/arch/s390/include/asm/io.h index 27216d317991..f81a0975cbea 100644 --- a/arch/s390/include/asm/io.h +++ b/arch/s390/include/asm/io.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #ifndef _S390_IO_H | 11 | #ifndef _S390_IO_H |
12 | #define _S390_IO_H | 12 | #define _S390_IO_H |
13 | 13 | ||
14 | #ifdef __KERNEL__ | ||
15 | |||
16 | #include <asm/page.h> | 14 | #include <asm/page.h> |
17 | 15 | ||
18 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
@@ -46,6 +44,4 @@ void unxlate_dev_mem_ptr(unsigned long phys, void *addr); | |||
46 | */ | 44 | */ |
47 | #define xlate_dev_kmem_ptr(p) p | 45 | #define xlate_dev_kmem_ptr(p) p |
48 | 46 | ||
49 | #endif /* __KERNEL__ */ | ||
50 | |||
51 | #endif | 47 | #endif |
diff --git a/arch/s390/include/asm/irq.h b/arch/s390/include/asm/irq.h index 5289cacd4861..2b9d41899d21 100644 --- a/arch/s390/include/asm/irq.h +++ b/arch/s390/include/asm/irq.h | |||
@@ -17,7 +17,8 @@ enum interruption_class { | |||
17 | EXTINT_VRT, | 17 | EXTINT_VRT, |
18 | EXTINT_SCP, | 18 | EXTINT_SCP, |
19 | EXTINT_IUC, | 19 | EXTINT_IUC, |
20 | EXTINT_CPM, | 20 | EXTINT_CMS, |
21 | EXTINT_CMC, | ||
21 | IOINT_CIO, | 22 | IOINT_CIO, |
22 | IOINT_QAI, | 23 | IOINT_QAI, |
23 | IOINT_DAS, | 24 | IOINT_DAS, |
diff --git a/arch/s390/include/asm/kexec.h b/arch/s390/include/asm/kexec.h index 3f30dac804ea..f4f38826eebb 100644 --- a/arch/s390/include/asm/kexec.h +++ b/arch/s390/include/asm/kexec.h | |||
@@ -10,10 +10,8 @@ | |||
10 | #ifndef _S390_KEXEC_H | 10 | #ifndef _S390_KEXEC_H |
11 | #define _S390_KEXEC_H | 11 | #define _S390_KEXEC_H |
12 | 12 | ||
13 | #ifdef __KERNEL__ | ||
14 | #include <asm/page.h> | ||
15 | #endif | ||
16 | #include <asm/processor.h> | 13 | #include <asm/processor.h> |
14 | #include <asm/page.h> | ||
17 | /* | 15 | /* |
18 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. | 16 | * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return. |
19 | * I.e. Maximum page that is mapped directly into kernel memory, | 17 | * I.e. Maximum page that is mapped directly into kernel memory, |
diff --git a/arch/s390/include/asm/kmap_types.h b/arch/s390/include/asm/kmap_types.h index 94ec3ee07983..0a88622339ee 100644 --- a/arch/s390/include/asm/kmap_types.h +++ b/arch/s390/include/asm/kmap_types.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifdef __KERNEL__ | ||
2 | #ifndef _ASM_KMAP_TYPES_H | 1 | #ifndef _ASM_KMAP_TYPES_H |
3 | #define _ASM_KMAP_TYPES_H | 2 | #define _ASM_KMAP_TYPES_H |
4 | 3 | ||
5 | #include <asm-generic/kmap_types.h> | 4 | #include <asm-generic/kmap_types.h> |
6 | 5 | ||
7 | #endif | 6 | #endif |
8 | #endif /* __KERNEL__ */ | ||
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h index 5d09e405c54d..69bdf72e95ec 100644 --- a/arch/s390/include/asm/mmu_context.h +++ b/arch/s390/include/asm/mmu_context.h | |||
@@ -49,7 +49,7 @@ static inline int init_new_context(struct task_struct *tsk, | |||
49 | 49 | ||
50 | #define destroy_context(mm) do { } while (0) | 50 | #define destroy_context(mm) do { } while (0) |
51 | 51 | ||
52 | #ifndef __s390x__ | 52 | #ifndef CONFIG_64BIT |
53 | #define LCTL_OPCODE "lctl" | 53 | #define LCTL_OPCODE "lctl" |
54 | #else | 54 | #else |
55 | #define LCTL_OPCODE "lctlg" | 55 | #define LCTL_OPCODE "lctlg" |
diff --git a/arch/s390/include/asm/module.h b/arch/s390/include/asm/module.h index 1cc1c5af705a..f0b6b26b6e59 100644 --- a/arch/s390/include/asm/module.h +++ b/arch/s390/include/asm/module.h | |||
@@ -28,7 +28,7 @@ struct mod_arch_specific | |||
28 | struct mod_arch_syminfo *syminfo; | 28 | struct mod_arch_syminfo *syminfo; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | #ifdef __s390x__ | 31 | #ifdef CONFIG_64BIT |
32 | #define ElfW(x) Elf64_ ## x | 32 | #define ElfW(x) Elf64_ ## x |
33 | #define ELFW(x) ELF64_ ## x | 33 | #define ELFW(x) ELF64_ ## x |
34 | #else | 34 | #else |
diff --git a/arch/s390/include/asm/os_info.h b/arch/s390/include/asm/os_info.h index d07518af09ea..295f2c4f1c96 100644 --- a/arch/s390/include/asm/os_info.h +++ b/arch/s390/include/asm/os_info.h | |||
@@ -13,7 +13,6 @@ | |||
13 | 13 | ||
14 | #define OS_INFO_VMCOREINFO 0 | 14 | #define OS_INFO_VMCOREINFO 0 |
15 | #define OS_INFO_REIPL_BLOCK 1 | 15 | #define OS_INFO_REIPL_BLOCK 1 |
16 | #define OS_INFO_INIT_FN 2 | ||
17 | 16 | ||
18 | struct os_info_entry { | 17 | struct os_info_entry { |
19 | u64 addr; | 18 | u64 addr; |
@@ -28,8 +27,8 @@ struct os_info { | |||
28 | u16 version_minor; | 27 | u16 version_minor; |
29 | u64 crashkernel_addr; | 28 | u64 crashkernel_addr; |
30 | u64 crashkernel_size; | 29 | u64 crashkernel_size; |
31 | struct os_info_entry entry[3]; | 30 | struct os_info_entry entry[2]; |
32 | u8 reserved[4004]; | 31 | u8 reserved[4024]; |
33 | } __packed; | 32 | } __packed; |
34 | 33 | ||
35 | void os_info_init(void); | 34 | void os_info_init(void); |
diff --git a/arch/s390/include/asm/percpu.h b/arch/s390/include/asm/percpu.h index 0fbd1899c7b0..6537e72e0853 100644 --- a/arch/s390/include/asm/percpu.h +++ b/arch/s390/include/asm/percpu.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * per cpu area, use weak definitions to force the compiler to | 15 | * per cpu area, use weak definitions to force the compiler to |
16 | * generate external references. | 16 | * generate external references. |
17 | */ | 17 | */ |
18 | #if defined(CONFIG_SMP) && defined(__s390x__) && defined(MODULE) | 18 | #if defined(CONFIG_SMP) && defined(CONFIG_64BIT) && defined(MODULE) |
19 | #define ARCH_NEEDS_WEAK_PER_CPU | 19 | #define ARCH_NEEDS_WEAK_PER_CPU |
20 | #endif | 20 | #endif |
21 | 21 | ||
diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h index 78e3041919de..43078c194394 100644 --- a/arch/s390/include/asm/pgalloc.h +++ b/arch/s390/include/asm/pgalloc.h | |||
@@ -48,7 +48,7 @@ static inline void crst_table_init(unsigned long *crst, unsigned long entry) | |||
48 | clear_table(crst, entry, sizeof(unsigned long)*2048); | 48 | clear_table(crst, entry, sizeof(unsigned long)*2048); |
49 | } | 49 | } |
50 | 50 | ||
51 | #ifndef __s390x__ | 51 | #ifndef CONFIG_64BIT |
52 | 52 | ||
53 | static inline unsigned long pgd_entry_type(struct mm_struct *mm) | 53 | static inline unsigned long pgd_entry_type(struct mm_struct *mm) |
54 | { | 54 | { |
@@ -64,7 +64,7 @@ static inline unsigned long pgd_entry_type(struct mm_struct *mm) | |||
64 | #define pgd_populate(mm, pgd, pud) BUG() | 64 | #define pgd_populate(mm, pgd, pud) BUG() |
65 | #define pud_populate(mm, pud, pmd) BUG() | 65 | #define pud_populate(mm, pud, pmd) BUG() |
66 | 66 | ||
67 | #else /* __s390x__ */ | 67 | #else /* CONFIG_64BIT */ |
68 | 68 | ||
69 | static inline unsigned long pgd_entry_type(struct mm_struct *mm) | 69 | static inline unsigned long pgd_entry_type(struct mm_struct *mm) |
70 | { | 70 | { |
@@ -106,7 +106,7 @@ static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) | |||
106 | pud_val(*pud) = _REGION3_ENTRY | __pa(pmd); | 106 | pud_val(*pud) = _REGION3_ENTRY | __pa(pmd); |
107 | } | 107 | } |
108 | 108 | ||
109 | #endif /* __s390x__ */ | 109 | #endif /* CONFIG_64BIT */ |
110 | 110 | ||
111 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) | 111 | static inline pgd_t *pgd_alloc(struct mm_struct *mm) |
112 | { | 112 | { |
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 011358c1b18e..b3227415abda 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
@@ -74,15 +74,15 @@ static inline int is_zero_pfn(unsigned long pfn) | |||
74 | * table can map | 74 | * table can map |
75 | * PGDIR_SHIFT determines what a third-level page table entry can map | 75 | * PGDIR_SHIFT determines what a third-level page table entry can map |
76 | */ | 76 | */ |
77 | #ifndef __s390x__ | 77 | #ifndef CONFIG_64BIT |
78 | # define PMD_SHIFT 20 | 78 | # define PMD_SHIFT 20 |
79 | # define PUD_SHIFT 20 | 79 | # define PUD_SHIFT 20 |
80 | # define PGDIR_SHIFT 20 | 80 | # define PGDIR_SHIFT 20 |
81 | #else /* __s390x__ */ | 81 | #else /* CONFIG_64BIT */ |
82 | # define PMD_SHIFT 20 | 82 | # define PMD_SHIFT 20 |
83 | # define PUD_SHIFT 31 | 83 | # define PUD_SHIFT 31 |
84 | # define PGDIR_SHIFT 42 | 84 | # define PGDIR_SHIFT 42 |
85 | #endif /* __s390x__ */ | 85 | #endif /* CONFIG_64BIT */ |
86 | 86 | ||
87 | #define PMD_SIZE (1UL << PMD_SHIFT) | 87 | #define PMD_SIZE (1UL << PMD_SHIFT) |
88 | #define PMD_MASK (~(PMD_SIZE-1)) | 88 | #define PMD_MASK (~(PMD_SIZE-1)) |
@@ -98,13 +98,13 @@ static inline int is_zero_pfn(unsigned long pfn) | |||
98 | * that leads to 1024 pte per pgd | 98 | * that leads to 1024 pte per pgd |
99 | */ | 99 | */ |
100 | #define PTRS_PER_PTE 256 | 100 | #define PTRS_PER_PTE 256 |
101 | #ifndef __s390x__ | 101 | #ifndef CONFIG_64BIT |
102 | #define PTRS_PER_PMD 1 | 102 | #define PTRS_PER_PMD 1 |
103 | #define PTRS_PER_PUD 1 | 103 | #define PTRS_PER_PUD 1 |
104 | #else /* __s390x__ */ | 104 | #else /* CONFIG_64BIT */ |
105 | #define PTRS_PER_PMD 2048 | 105 | #define PTRS_PER_PMD 2048 |
106 | #define PTRS_PER_PUD 2048 | 106 | #define PTRS_PER_PUD 2048 |
107 | #endif /* __s390x__ */ | 107 | #endif /* CONFIG_64BIT */ |
108 | #define PTRS_PER_PGD 2048 | 108 | #define PTRS_PER_PGD 2048 |
109 | 109 | ||
110 | #define FIRST_USER_ADDRESS 0 | 110 | #define FIRST_USER_ADDRESS 0 |
@@ -276,7 +276,7 @@ extern struct page *vmemmap; | |||
276 | * swap pte is 1011 and 0001, 0011, 0101, 0111 are invalid. | 276 | * swap pte is 1011 and 0001, 0011, 0101, 0111 are invalid. |
277 | */ | 277 | */ |
278 | 278 | ||
279 | #ifndef __s390x__ | 279 | #ifndef CONFIG_64BIT |
280 | 280 | ||
281 | /* Bits in the segment table address-space-control-element */ | 281 | /* Bits in the segment table address-space-control-element */ |
282 | #define _ASCE_SPACE_SWITCH 0x80000000UL /* space switch event */ | 282 | #define _ASCE_SPACE_SWITCH 0x80000000UL /* space switch event */ |
@@ -308,7 +308,7 @@ extern struct page *vmemmap; | |||
308 | #define KVM_UR_BIT 0x00008000UL | 308 | #define KVM_UR_BIT 0x00008000UL |
309 | #define KVM_UC_BIT 0x00004000UL | 309 | #define KVM_UC_BIT 0x00004000UL |
310 | 310 | ||
311 | #else /* __s390x__ */ | 311 | #else /* CONFIG_64BIT */ |
312 | 312 | ||
313 | /* Bits in the segment/region table address-space-control-element */ | 313 | /* Bits in the segment/region table address-space-control-element */ |
314 | #define _ASCE_ORIGIN ~0xfffUL/* segment table origin */ | 314 | #define _ASCE_ORIGIN ~0xfffUL/* segment table origin */ |
@@ -363,7 +363,7 @@ extern struct page *vmemmap; | |||
363 | #define KVM_UR_BIT 0x0000800000000000UL | 363 | #define KVM_UR_BIT 0x0000800000000000UL |
364 | #define KVM_UC_BIT 0x0000400000000000UL | 364 | #define KVM_UC_BIT 0x0000400000000000UL |
365 | 365 | ||
366 | #endif /* __s390x__ */ | 366 | #endif /* CONFIG_64BIT */ |
367 | 367 | ||
368 | /* | 368 | /* |
369 | * A user page table pointer has the space-switch-event bit, the | 369 | * A user page table pointer has the space-switch-event bit, the |
@@ -424,7 +424,7 @@ static inline int mm_has_pgste(struct mm_struct *mm) | |||
424 | /* | 424 | /* |
425 | * pgd/pmd/pte query functions | 425 | * pgd/pmd/pte query functions |
426 | */ | 426 | */ |
427 | #ifndef __s390x__ | 427 | #ifndef CONFIG_64BIT |
428 | 428 | ||
429 | static inline int pgd_present(pgd_t pgd) { return 1; } | 429 | static inline int pgd_present(pgd_t pgd) { return 1; } |
430 | static inline int pgd_none(pgd_t pgd) { return 0; } | 430 | static inline int pgd_none(pgd_t pgd) { return 0; } |
@@ -434,7 +434,7 @@ static inline int pud_present(pud_t pud) { return 1; } | |||
434 | static inline int pud_none(pud_t pud) { return 0; } | 434 | static inline int pud_none(pud_t pud) { return 0; } |
435 | static inline int pud_bad(pud_t pud) { return 0; } | 435 | static inline int pud_bad(pud_t pud) { return 0; } |
436 | 436 | ||
437 | #else /* __s390x__ */ | 437 | #else /* CONFIG_64BIT */ |
438 | 438 | ||
439 | static inline int pgd_present(pgd_t pgd) | 439 | static inline int pgd_present(pgd_t pgd) |
440 | { | 440 | { |
@@ -490,7 +490,7 @@ static inline int pud_bad(pud_t pud) | |||
490 | return (pud_val(pud) & mask) != 0; | 490 | return (pud_val(pud) & mask) != 0; |
491 | } | 491 | } |
492 | 492 | ||
493 | #endif /* __s390x__ */ | 493 | #endif /* CONFIG_64BIT */ |
494 | 494 | ||
495 | static inline int pmd_present(pmd_t pmd) | 495 | static inline int pmd_present(pmd_t pmd) |
496 | { | 496 | { |
@@ -741,7 +741,7 @@ static inline int pte_young(pte_t pte) | |||
741 | 741 | ||
742 | static inline void pgd_clear(pgd_t *pgd) | 742 | static inline void pgd_clear(pgd_t *pgd) |
743 | { | 743 | { |
744 | #ifdef __s390x__ | 744 | #ifdef CONFIG_64BIT |
745 | if ((pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R2) | 745 | if ((pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R2) |
746 | pgd_val(*pgd) = _REGION2_ENTRY_EMPTY; | 746 | pgd_val(*pgd) = _REGION2_ENTRY_EMPTY; |
747 | #endif | 747 | #endif |
@@ -749,7 +749,7 @@ static inline void pgd_clear(pgd_t *pgd) | |||
749 | 749 | ||
750 | static inline void pud_clear(pud_t *pud) | 750 | static inline void pud_clear(pud_t *pud) |
751 | { | 751 | { |
752 | #ifdef __s390x__ | 752 | #ifdef CONFIG_64BIT |
753 | if ((pud_val(*pud) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3) | 753 | if ((pud_val(*pud) & _REGION_ENTRY_TYPE_MASK) == _REGION_ENTRY_TYPE_R3) |
754 | pud_val(*pud) = _REGION3_ENTRY_EMPTY; | 754 | pud_val(*pud) = _REGION3_ENTRY_EMPTY; |
755 | #endif | 755 | #endif |
@@ -921,7 +921,7 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma, | |||
921 | static inline void __ptep_ipte(unsigned long address, pte_t *ptep) | 921 | static inline void __ptep_ipte(unsigned long address, pte_t *ptep) |
922 | { | 922 | { |
923 | if (!(pte_val(*ptep) & _PAGE_INVALID)) { | 923 | if (!(pte_val(*ptep) & _PAGE_INVALID)) { |
924 | #ifndef __s390x__ | 924 | #ifndef CONFIG_64BIT |
925 | /* pto must point to the start of the segment table */ | 925 | /* pto must point to the start of the segment table */ |
926 | pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00); | 926 | pte_t *pto = (pte_t *) (((unsigned long) ptep) & 0x7ffffc00); |
927 | #else | 927 | #else |
@@ -1116,7 +1116,7 @@ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot) | |||
1116 | #define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) | 1116 | #define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) |
1117 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) | 1117 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) |
1118 | 1118 | ||
1119 | #ifndef __s390x__ | 1119 | #ifndef CONFIG_64BIT |
1120 | 1120 | ||
1121 | #define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) | 1121 | #define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) |
1122 | #define pud_deref(pmd) ({ BUG(); 0UL; }) | 1122 | #define pud_deref(pmd) ({ BUG(); 0UL; }) |
@@ -1125,7 +1125,7 @@ static inline pte_t mk_pte(struct page *page, pgprot_t pgprot) | |||
1125 | #define pud_offset(pgd, address) ((pud_t *) pgd) | 1125 | #define pud_offset(pgd, address) ((pud_t *) pgd) |
1126 | #define pmd_offset(pud, address) ((pmd_t *) pud + pmd_index(address)) | 1126 | #define pmd_offset(pud, address) ((pmd_t *) pud + pmd_index(address)) |
1127 | 1127 | ||
1128 | #else /* __s390x__ */ | 1128 | #else /* CONFIG_64BIT */ |
1129 | 1129 | ||
1130 | #define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) | 1130 | #define pmd_deref(pmd) (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) |
1131 | #define pud_deref(pud) (pud_val(pud) & _REGION_ENTRY_ORIGIN) | 1131 | #define pud_deref(pud) (pud_val(pud) & _REGION_ENTRY_ORIGIN) |
@@ -1147,7 +1147,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) | |||
1147 | return pmd + pmd_index(address); | 1147 | return pmd + pmd_index(address); |
1148 | } | 1148 | } |
1149 | 1149 | ||
1150 | #endif /* __s390x__ */ | 1150 | #endif /* CONFIG_64BIT */ |
1151 | 1151 | ||
1152 | #define pfn_pte(pfn,pgprot) mk_pte_phys(__pa((pfn) << PAGE_SHIFT),(pgprot)) | 1152 | #define pfn_pte(pfn,pgprot) mk_pte_phys(__pa((pfn) << PAGE_SHIFT),(pgprot)) |
1153 | #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) | 1153 | #define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT) |
@@ -1196,7 +1196,7 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) | |||
1196 | * 0000000000111111111122222222223333333333444444444455 5555 5 55566 66 | 1196 | * 0000000000111111111122222222223333333333444444444455 5555 5 55566 66 |
1197 | * 0123456789012345678901234567890123456789012345678901 2345 6 78901 23 | 1197 | * 0123456789012345678901234567890123456789012345678901 2345 6 78901 23 |
1198 | */ | 1198 | */ |
1199 | #ifndef __s390x__ | 1199 | #ifndef CONFIG_64BIT |
1200 | #define __SWP_OFFSET_MASK (~0UL >> 12) | 1200 | #define __SWP_OFFSET_MASK (~0UL >> 12) |
1201 | #else | 1201 | #else |
1202 | #define __SWP_OFFSET_MASK (~0UL >> 11) | 1202 | #define __SWP_OFFSET_MASK (~0UL >> 11) |
@@ -1217,11 +1217,11 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset) | |||
1217 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) | 1217 | #define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) |
1218 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) | 1218 | #define __swp_entry_to_pte(x) ((pte_t) { (x).val }) |
1219 | 1219 | ||
1220 | #ifndef __s390x__ | 1220 | #ifndef CONFIG_64BIT |
1221 | # define PTE_FILE_MAX_BITS 26 | 1221 | # define PTE_FILE_MAX_BITS 26 |
1222 | #else /* __s390x__ */ | 1222 | #else /* CONFIG_64BIT */ |
1223 | # define PTE_FILE_MAX_BITS 59 | 1223 | # define PTE_FILE_MAX_BITS 59 |
1224 | #endif /* __s390x__ */ | 1224 | #endif /* CONFIG_64BIT */ |
1225 | 1225 | ||
1226 | #define pte_to_pgoff(__pte) \ | 1226 | #define pte_to_pgoff(__pte) \ |
1227 | ((((__pte).pte >> 12) << 7) + (((__pte).pte >> 1) & 0x7f)) | 1227 | ((((__pte).pte >> 12) << 7) + (((__pte).pte >> 1) & 0x7f)) |
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index 6cbf31311673..20d0585cf905 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <asm/ptrace.h> | 20 | #include <asm/ptrace.h> |
21 | #include <asm/setup.h> | 21 | #include <asm/setup.h> |
22 | 22 | ||
23 | #ifdef __KERNEL__ | ||
24 | /* | 23 | /* |
25 | * Default implementation of macro that returns current | 24 | * Default implementation of macro that returns current |
26 | * instruction pointer ("program counter"). | 25 | * instruction pointer ("program counter"). |
@@ -33,39 +32,33 @@ static inline void get_cpu_id(struct cpuid *ptr) | |||
33 | } | 32 | } |
34 | 33 | ||
35 | extern void s390_adjust_jiffies(void); | 34 | extern void s390_adjust_jiffies(void); |
36 | extern int get_cpu_capability(unsigned int *); | ||
37 | extern const struct seq_operations cpuinfo_op; | 35 | extern const struct seq_operations cpuinfo_op; |
38 | extern int sysctl_ieee_emulation_warnings; | 36 | extern int sysctl_ieee_emulation_warnings; |
39 | 37 | ||
40 | /* | 38 | /* |
41 | * User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit. | 39 | * User space process size: 2GB for 31 bit, 4TB or 8PT for 64 bit. |
42 | */ | 40 | */ |
43 | #ifndef __s390x__ | 41 | #ifndef CONFIG_64BIT |
44 | 42 | ||
45 | #define TASK_SIZE (1UL << 31) | 43 | #define TASK_SIZE (1UL << 31) |
46 | #define TASK_UNMAPPED_BASE (1UL << 30) | 44 | #define TASK_UNMAPPED_BASE (1UL << 30) |
47 | 45 | ||
48 | #else /* __s390x__ */ | 46 | #else /* CONFIG_64BIT */ |
49 | 47 | ||
50 | #define TASK_SIZE_OF(tsk) ((tsk)->mm->context.asce_limit) | 48 | #define TASK_SIZE_OF(tsk) ((tsk)->mm->context.asce_limit) |
51 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \ | 49 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \ |
52 | (1UL << 30) : (1UL << 41)) | 50 | (1UL << 30) : (1UL << 41)) |
53 | #define TASK_SIZE TASK_SIZE_OF(current) | 51 | #define TASK_SIZE TASK_SIZE_OF(current) |
54 | 52 | ||
55 | #endif /* __s390x__ */ | 53 | #endif /* CONFIG_64BIT */ |
56 | 54 | ||
57 | #ifdef __KERNEL__ | 55 | #ifndef CONFIG_64BIT |
58 | |||
59 | #ifndef __s390x__ | ||
60 | #define STACK_TOP (1UL << 31) | 56 | #define STACK_TOP (1UL << 31) |
61 | #define STACK_TOP_MAX (1UL << 31) | 57 | #define STACK_TOP_MAX (1UL << 31) |
62 | #else /* __s390x__ */ | 58 | #else /* CONFIG_64BIT */ |
63 | #define STACK_TOP (1UL << (test_thread_flag(TIF_31BIT) ? 31:42)) | 59 | #define STACK_TOP (1UL << (test_thread_flag(TIF_31BIT) ? 31:42)) |
64 | #define STACK_TOP_MAX (1UL << 42) | 60 | #define STACK_TOP_MAX (1UL << 42) |
65 | #endif /* __s390x__ */ | 61 | #endif /* CONFIG_64BIT */ |
66 | |||
67 | |||
68 | #endif | ||
69 | 62 | ||
70 | #define HAVE_ARCH_PICK_MMAP_LAYOUT | 63 | #define HAVE_ARCH_PICK_MMAP_LAYOUT |
71 | 64 | ||
@@ -182,7 +175,7 @@ static inline void psw_set_key(unsigned int key) | |||
182 | */ | 175 | */ |
183 | static inline void __load_psw(psw_t psw) | 176 | static inline void __load_psw(psw_t psw) |
184 | { | 177 | { |
185 | #ifndef __s390x__ | 178 | #ifndef CONFIG_64BIT |
186 | asm volatile("lpsw %0" : : "Q" (psw) : "cc"); | 179 | asm volatile("lpsw %0" : : "Q" (psw) : "cc"); |
187 | #else | 180 | #else |
188 | asm volatile("lpswe %0" : : "Q" (psw) : "cc"); | 181 | asm volatile("lpswe %0" : : "Q" (psw) : "cc"); |
@@ -200,7 +193,7 @@ static inline void __load_psw_mask (unsigned long mask) | |||
200 | 193 | ||
201 | psw.mask = mask; | 194 | psw.mask = mask; |
202 | 195 | ||
203 | #ifndef __s390x__ | 196 | #ifndef CONFIG_64BIT |
204 | asm volatile( | 197 | asm volatile( |
205 | " basr %0,0\n" | 198 | " basr %0,0\n" |
206 | "0: ahi %0,1f-0b\n" | 199 | "0: ahi %0,1f-0b\n" |
@@ -208,14 +201,14 @@ static inline void __load_psw_mask (unsigned long mask) | |||
208 | " lpsw %1\n" | 201 | " lpsw %1\n" |
209 | "1:" | 202 | "1:" |
210 | : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc"); | 203 | : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc"); |
211 | #else /* __s390x__ */ | 204 | #else /* CONFIG_64BIT */ |
212 | asm volatile( | 205 | asm volatile( |
213 | " larl %0,1f\n" | 206 | " larl %0,1f\n" |
214 | " stg %0,%O1+8(%R1)\n" | 207 | " stg %0,%O1+8(%R1)\n" |
215 | " lpswe %1\n" | 208 | " lpswe %1\n" |
216 | "1:" | 209 | "1:" |
217 | : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc"); | 210 | : "=&d" (addr), "=Q" (psw) : "Q" (psw) : "memory", "cc"); |
218 | #endif /* __s390x__ */ | 211 | #endif /* CONFIG_64BIT */ |
219 | } | 212 | } |
220 | 213 | ||
221 | /* | 214 | /* |
@@ -223,7 +216,7 @@ static inline void __load_psw_mask (unsigned long mask) | |||
223 | */ | 216 | */ |
224 | static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc) | 217 | static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc) |
225 | { | 218 | { |
226 | #ifndef __s390x__ | 219 | #ifndef CONFIG_64BIT |
227 | if (psw.addr & PSW_ADDR_AMODE) | 220 | if (psw.addr & PSW_ADDR_AMODE) |
228 | /* 31 bit mode */ | 221 | /* 31 bit mode */ |
229 | return (psw.addr - ilc) | PSW_ADDR_AMODE; | 222 | return (psw.addr - ilc) | PSW_ADDR_AMODE; |
@@ -253,7 +246,7 @@ static inline void __noreturn disabled_wait(unsigned long code) | |||
253 | * Store status and then load disabled wait psw, | 246 | * Store status and then load disabled wait psw, |
254 | * the processor is dead afterwards | 247 | * the processor is dead afterwards |
255 | */ | 248 | */ |
256 | #ifndef __s390x__ | 249 | #ifndef CONFIG_64BIT |
257 | asm volatile( | 250 | asm volatile( |
258 | " stctl 0,0,0(%2)\n" | 251 | " stctl 0,0,0(%2)\n" |
259 | " ni 0(%2),0xef\n" /* switch off protection */ | 252 | " ni 0(%2),0xef\n" /* switch off protection */ |
@@ -272,7 +265,7 @@ static inline void __noreturn disabled_wait(unsigned long code) | |||
272 | " lpsw 0(%1)" | 265 | " lpsw 0(%1)" |
273 | : "=m" (ctl_buf) | 266 | : "=m" (ctl_buf) |
274 | : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc"); | 267 | : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc"); |
275 | #else /* __s390x__ */ | 268 | #else /* CONFIG_64BIT */ |
276 | asm volatile( | 269 | asm volatile( |
277 | " stctg 0,0,0(%2)\n" | 270 | " stctg 0,0,0(%2)\n" |
278 | " ni 4(%2),0xef\n" /* switch off protection */ | 271 | " ni 4(%2),0xef\n" /* switch off protection */ |
@@ -305,7 +298,7 @@ static inline void __noreturn disabled_wait(unsigned long code) | |||
305 | " lpswe 0(%1)" | 298 | " lpswe 0(%1)" |
306 | : "=m" (ctl_buf) | 299 | : "=m" (ctl_buf) |
307 | : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc", "0", "1"); | 300 | : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc", "0", "1"); |
308 | #endif /* __s390x__ */ | 301 | #endif /* CONFIG_64BIT */ |
309 | while (1); | 302 | while (1); |
310 | } | 303 | } |
311 | 304 | ||
@@ -338,12 +331,10 @@ extern void (*s390_base_ext_handler_fn)(void); | |||
338 | 331 | ||
339 | #define ARCH_LOW_ADDRESS_LIMIT 0x7fffffffUL | 332 | #define ARCH_LOW_ADDRESS_LIMIT 0x7fffffffUL |
340 | 333 | ||
341 | #endif | ||
342 | |||
343 | /* | 334 | /* |
344 | * Helper macro for exception table entries | 335 | * Helper macro for exception table entries |
345 | */ | 336 | */ |
346 | #ifndef __s390x__ | 337 | #ifndef CONFIG_64BIT |
347 | #define EX_TABLE(_fault,_target) \ | 338 | #define EX_TABLE(_fault,_target) \ |
348 | ".section __ex_table,\"a\"\n" \ | 339 | ".section __ex_table,\"a\"\n" \ |
349 | " .align 4\n" \ | 340 | " .align 4\n" \ |
diff --git a/arch/s390/include/asm/rwsem.h b/arch/s390/include/asm/rwsem.h index d0eb4653cebd..1ceee10264c3 100644 --- a/arch/s390/include/asm/rwsem.h +++ b/arch/s390/include/asm/rwsem.h | |||
@@ -41,19 +41,17 @@ | |||
41 | #error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" | 41 | #error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | #ifdef __KERNEL__ | 44 | #ifndef CONFIG_64BIT |
45 | |||
46 | #ifndef __s390x__ | ||
47 | #define RWSEM_UNLOCKED_VALUE 0x00000000 | 45 | #define RWSEM_UNLOCKED_VALUE 0x00000000 |
48 | #define RWSEM_ACTIVE_BIAS 0x00000001 | 46 | #define RWSEM_ACTIVE_BIAS 0x00000001 |
49 | #define RWSEM_ACTIVE_MASK 0x0000ffff | 47 | #define RWSEM_ACTIVE_MASK 0x0000ffff |
50 | #define RWSEM_WAITING_BIAS (-0x00010000) | 48 | #define RWSEM_WAITING_BIAS (-0x00010000) |
51 | #else /* __s390x__ */ | 49 | #else /* CONFIG_64BIT */ |
52 | #define RWSEM_UNLOCKED_VALUE 0x0000000000000000L | 50 | #define RWSEM_UNLOCKED_VALUE 0x0000000000000000L |
53 | #define RWSEM_ACTIVE_BIAS 0x0000000000000001L | 51 | #define RWSEM_ACTIVE_BIAS 0x0000000000000001L |
54 | #define RWSEM_ACTIVE_MASK 0x00000000ffffffffL | 52 | #define RWSEM_ACTIVE_MASK 0x00000000ffffffffL |
55 | #define RWSEM_WAITING_BIAS (-0x0000000100000000L) | 53 | #define RWSEM_WAITING_BIAS (-0x0000000100000000L) |
56 | #endif /* __s390x__ */ | 54 | #endif /* CONFIG_64BIT */ |
57 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS | 55 | #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS |
58 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 56 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
59 | 57 | ||
@@ -65,19 +63,19 @@ static inline void __down_read(struct rw_semaphore *sem) | |||
65 | signed long old, new; | 63 | signed long old, new; |
66 | 64 | ||
67 | asm volatile( | 65 | asm volatile( |
68 | #ifndef __s390x__ | 66 | #ifndef CONFIG_64BIT |
69 | " l %0,%2\n" | 67 | " l %0,%2\n" |
70 | "0: lr %1,%0\n" | 68 | "0: lr %1,%0\n" |
71 | " ahi %1,%4\n" | 69 | " ahi %1,%4\n" |
72 | " cs %0,%1,%2\n" | 70 | " cs %0,%1,%2\n" |
73 | " jl 0b" | 71 | " jl 0b" |
74 | #else /* __s390x__ */ | 72 | #else /* CONFIG_64BIT */ |
75 | " lg %0,%2\n" | 73 | " lg %0,%2\n" |
76 | "0: lgr %1,%0\n" | 74 | "0: lgr %1,%0\n" |
77 | " aghi %1,%4\n" | 75 | " aghi %1,%4\n" |
78 | " csg %0,%1,%2\n" | 76 | " csg %0,%1,%2\n" |
79 | " jl 0b" | 77 | " jl 0b" |
80 | #endif /* __s390x__ */ | 78 | #endif /* CONFIG_64BIT */ |
81 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) | 79 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) |
82 | : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS) | 80 | : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS) |
83 | : "cc", "memory"); | 81 | : "cc", "memory"); |
@@ -93,7 +91,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem) | |||
93 | signed long old, new; | 91 | signed long old, new; |
94 | 92 | ||
95 | asm volatile( | 93 | asm volatile( |
96 | #ifndef __s390x__ | 94 | #ifndef CONFIG_64BIT |
97 | " l %0,%2\n" | 95 | " l %0,%2\n" |
98 | "0: ltr %1,%0\n" | 96 | "0: ltr %1,%0\n" |
99 | " jm 1f\n" | 97 | " jm 1f\n" |
@@ -101,7 +99,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem) | |||
101 | " cs %0,%1,%2\n" | 99 | " cs %0,%1,%2\n" |
102 | " jl 0b\n" | 100 | " jl 0b\n" |
103 | "1:" | 101 | "1:" |
104 | #else /* __s390x__ */ | 102 | #else /* CONFIG_64BIT */ |
105 | " lg %0,%2\n" | 103 | " lg %0,%2\n" |
106 | "0: ltgr %1,%0\n" | 104 | "0: ltgr %1,%0\n" |
107 | " jm 1f\n" | 105 | " jm 1f\n" |
@@ -109,7 +107,7 @@ static inline int __down_read_trylock(struct rw_semaphore *sem) | |||
109 | " csg %0,%1,%2\n" | 107 | " csg %0,%1,%2\n" |
110 | " jl 0b\n" | 108 | " jl 0b\n" |
111 | "1:" | 109 | "1:" |
112 | #endif /* __s390x__ */ | 110 | #endif /* CONFIG_64BIT */ |
113 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) | 111 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) |
114 | : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS) | 112 | : "Q" (sem->count), "i" (RWSEM_ACTIVE_READ_BIAS) |
115 | : "cc", "memory"); | 113 | : "cc", "memory"); |
@@ -125,19 +123,19 @@ static inline void __down_write_nested(struct rw_semaphore *sem, int subclass) | |||
125 | 123 | ||
126 | tmp = RWSEM_ACTIVE_WRITE_BIAS; | 124 | tmp = RWSEM_ACTIVE_WRITE_BIAS; |
127 | asm volatile( | 125 | asm volatile( |
128 | #ifndef __s390x__ | 126 | #ifndef CONFIG_64BIT |
129 | " l %0,%2\n" | 127 | " l %0,%2\n" |
130 | "0: lr %1,%0\n" | 128 | "0: lr %1,%0\n" |
131 | " a %1,%4\n" | 129 | " a %1,%4\n" |
132 | " cs %0,%1,%2\n" | 130 | " cs %0,%1,%2\n" |
133 | " jl 0b" | 131 | " jl 0b" |
134 | #else /* __s390x__ */ | 132 | #else /* CONFIG_64BIT */ |
135 | " lg %0,%2\n" | 133 | " lg %0,%2\n" |
136 | "0: lgr %1,%0\n" | 134 | "0: lgr %1,%0\n" |
137 | " ag %1,%4\n" | 135 | " ag %1,%4\n" |
138 | " csg %0,%1,%2\n" | 136 | " csg %0,%1,%2\n" |
139 | " jl 0b" | 137 | " jl 0b" |
140 | #endif /* __s390x__ */ | 138 | #endif /* CONFIG_64BIT */ |
141 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) | 139 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) |
142 | : "Q" (sem->count), "m" (tmp) | 140 | : "Q" (sem->count), "m" (tmp) |
143 | : "cc", "memory"); | 141 | : "cc", "memory"); |
@@ -158,19 +156,19 @@ static inline int __down_write_trylock(struct rw_semaphore *sem) | |||
158 | signed long old; | 156 | signed long old; |
159 | 157 | ||
160 | asm volatile( | 158 | asm volatile( |
161 | #ifndef __s390x__ | 159 | #ifndef CONFIG_64BIT |
162 | " l %0,%1\n" | 160 | " l %0,%1\n" |
163 | "0: ltr %0,%0\n" | 161 | "0: ltr %0,%0\n" |
164 | " jnz 1f\n" | 162 | " jnz 1f\n" |
165 | " cs %0,%3,%1\n" | 163 | " cs %0,%3,%1\n" |
166 | " jl 0b\n" | 164 | " jl 0b\n" |
167 | #else /* __s390x__ */ | 165 | #else /* CONFIG_64BIT */ |
168 | " lg %0,%1\n" | 166 | " lg %0,%1\n" |
169 | "0: ltgr %0,%0\n" | 167 | "0: ltgr %0,%0\n" |
170 | " jnz 1f\n" | 168 | " jnz 1f\n" |
171 | " csg %0,%3,%1\n" | 169 | " csg %0,%3,%1\n" |
172 | " jl 0b\n" | 170 | " jl 0b\n" |
173 | #endif /* __s390x__ */ | 171 | #endif /* CONFIG_64BIT */ |
174 | "1:" | 172 | "1:" |
175 | : "=&d" (old), "=Q" (sem->count) | 173 | : "=&d" (old), "=Q" (sem->count) |
176 | : "Q" (sem->count), "d" (RWSEM_ACTIVE_WRITE_BIAS) | 174 | : "Q" (sem->count), "d" (RWSEM_ACTIVE_WRITE_BIAS) |
@@ -186,19 +184,19 @@ static inline void __up_read(struct rw_semaphore *sem) | |||
186 | signed long old, new; | 184 | signed long old, new; |
187 | 185 | ||
188 | asm volatile( | 186 | asm volatile( |
189 | #ifndef __s390x__ | 187 | #ifndef CONFIG_64BIT |
190 | " l %0,%2\n" | 188 | " l %0,%2\n" |
191 | "0: lr %1,%0\n" | 189 | "0: lr %1,%0\n" |
192 | " ahi %1,%4\n" | 190 | " ahi %1,%4\n" |
193 | " cs %0,%1,%2\n" | 191 | " cs %0,%1,%2\n" |
194 | " jl 0b" | 192 | " jl 0b" |
195 | #else /* __s390x__ */ | 193 | #else /* CONFIG_64BIT */ |
196 | " lg %0,%2\n" | 194 | " lg %0,%2\n" |
197 | "0: lgr %1,%0\n" | 195 | "0: lgr %1,%0\n" |
198 | " aghi %1,%4\n" | 196 | " aghi %1,%4\n" |
199 | " csg %0,%1,%2\n" | 197 | " csg %0,%1,%2\n" |
200 | " jl 0b" | 198 | " jl 0b" |
201 | #endif /* __s390x__ */ | 199 | #endif /* CONFIG_64BIT */ |
202 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) | 200 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) |
203 | : "Q" (sem->count), "i" (-RWSEM_ACTIVE_READ_BIAS) | 201 | : "Q" (sem->count), "i" (-RWSEM_ACTIVE_READ_BIAS) |
204 | : "cc", "memory"); | 202 | : "cc", "memory"); |
@@ -216,19 +214,19 @@ static inline void __up_write(struct rw_semaphore *sem) | |||
216 | 214 | ||
217 | tmp = -RWSEM_ACTIVE_WRITE_BIAS; | 215 | tmp = -RWSEM_ACTIVE_WRITE_BIAS; |
218 | asm volatile( | 216 | asm volatile( |
219 | #ifndef __s390x__ | 217 | #ifndef CONFIG_64BIT |
220 | " l %0,%2\n" | 218 | " l %0,%2\n" |
221 | "0: lr %1,%0\n" | 219 | "0: lr %1,%0\n" |
222 | " a %1,%4\n" | 220 | " a %1,%4\n" |
223 | " cs %0,%1,%2\n" | 221 | " cs %0,%1,%2\n" |
224 | " jl 0b" | 222 | " jl 0b" |
225 | #else /* __s390x__ */ | 223 | #else /* CONFIG_64BIT */ |
226 | " lg %0,%2\n" | 224 | " lg %0,%2\n" |
227 | "0: lgr %1,%0\n" | 225 | "0: lgr %1,%0\n" |
228 | " ag %1,%4\n" | 226 | " ag %1,%4\n" |
229 | " csg %0,%1,%2\n" | 227 | " csg %0,%1,%2\n" |
230 | " jl 0b" | 228 | " jl 0b" |
231 | #endif /* __s390x__ */ | 229 | #endif /* CONFIG_64BIT */ |
232 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) | 230 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) |
233 | : "Q" (sem->count), "m" (tmp) | 231 | : "Q" (sem->count), "m" (tmp) |
234 | : "cc", "memory"); | 232 | : "cc", "memory"); |
@@ -246,19 +244,19 @@ static inline void __downgrade_write(struct rw_semaphore *sem) | |||
246 | 244 | ||
247 | tmp = -RWSEM_WAITING_BIAS; | 245 | tmp = -RWSEM_WAITING_BIAS; |
248 | asm volatile( | 246 | asm volatile( |
249 | #ifndef __s390x__ | 247 | #ifndef CONFIG_64BIT |
250 | " l %0,%2\n" | 248 | " l %0,%2\n" |
251 | "0: lr %1,%0\n" | 249 | "0: lr %1,%0\n" |
252 | " a %1,%4\n" | 250 | " a %1,%4\n" |
253 | " cs %0,%1,%2\n" | 251 | " cs %0,%1,%2\n" |
254 | " jl 0b" | 252 | " jl 0b" |
255 | #else /* __s390x__ */ | 253 | #else /* CONFIG_64BIT */ |
256 | " lg %0,%2\n" | 254 | " lg %0,%2\n" |
257 | "0: lgr %1,%0\n" | 255 | "0: lgr %1,%0\n" |
258 | " ag %1,%4\n" | 256 | " ag %1,%4\n" |
259 | " csg %0,%1,%2\n" | 257 | " csg %0,%1,%2\n" |
260 | " jl 0b" | 258 | " jl 0b" |
261 | #endif /* __s390x__ */ | 259 | #endif /* CONFIG_64BIT */ |
262 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) | 260 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) |
263 | : "Q" (sem->count), "m" (tmp) | 261 | : "Q" (sem->count), "m" (tmp) |
264 | : "cc", "memory"); | 262 | : "cc", "memory"); |
@@ -274,19 +272,19 @@ static inline void rwsem_atomic_add(long delta, struct rw_semaphore *sem) | |||
274 | signed long old, new; | 272 | signed long old, new; |
275 | 273 | ||
276 | asm volatile( | 274 | asm volatile( |
277 | #ifndef __s390x__ | 275 | #ifndef CONFIG_64BIT |
278 | " l %0,%2\n" | 276 | " l %0,%2\n" |
279 | "0: lr %1,%0\n" | 277 | "0: lr %1,%0\n" |
280 | " ar %1,%4\n" | 278 | " ar %1,%4\n" |
281 | " cs %0,%1,%2\n" | 279 | " cs %0,%1,%2\n" |
282 | " jl 0b" | 280 | " jl 0b" |
283 | #else /* __s390x__ */ | 281 | #else /* CONFIG_64BIT */ |
284 | " lg %0,%2\n" | 282 | " lg %0,%2\n" |
285 | "0: lgr %1,%0\n" | 283 | "0: lgr %1,%0\n" |
286 | " agr %1,%4\n" | 284 | " agr %1,%4\n" |
287 | " csg %0,%1,%2\n" | 285 | " csg %0,%1,%2\n" |
288 | " jl 0b" | 286 | " jl 0b" |
289 | #endif /* __s390x__ */ | 287 | #endif /* CONFIG_64BIT */ |
290 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) | 288 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) |
291 | : "Q" (sem->count), "d" (delta) | 289 | : "Q" (sem->count), "d" (delta) |
292 | : "cc", "memory"); | 290 | : "cc", "memory"); |
@@ -300,24 +298,23 @@ static inline long rwsem_atomic_update(long delta, struct rw_semaphore *sem) | |||
300 | signed long old, new; | 298 | signed long old, new; |
301 | 299 | ||
302 | asm volatile( | 300 | asm volatile( |
303 | #ifndef __s390x__ | 301 | #ifndef CONFIG_64BIT |
304 | " l %0,%2\n" | 302 | " l %0,%2\n" |
305 | "0: lr %1,%0\n" | 303 | "0: lr %1,%0\n" |
306 | " ar %1,%4\n" | 304 | " ar %1,%4\n" |
307 | " cs %0,%1,%2\n" | 305 | " cs %0,%1,%2\n" |
308 | " jl 0b" | 306 | " jl 0b" |
309 | #else /* __s390x__ */ | 307 | #else /* CONFIG_64BIT */ |
310 | " lg %0,%2\n" | 308 | " lg %0,%2\n" |
311 | "0: lgr %1,%0\n" | 309 | "0: lgr %1,%0\n" |
312 | " agr %1,%4\n" | 310 | " agr %1,%4\n" |
313 | " csg %0,%1,%2\n" | 311 | " csg %0,%1,%2\n" |
314 | " jl 0b" | 312 | " jl 0b" |
315 | #endif /* __s390x__ */ | 313 | #endif /* CONFIG_64BIT */ |
316 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) | 314 | : "=&d" (old), "=&d" (new), "=Q" (sem->count) |
317 | : "Q" (sem->count), "d" (delta) | 315 | : "Q" (sem->count), "d" (delta) |
318 | : "cc", "memory"); | 316 | : "cc", "memory"); |
319 | return new; | 317 | return new; |
320 | } | 318 | } |
321 | 319 | ||
322 | #endif /* __KERNEL__ */ | ||
323 | #endif /* _S390_RWSEM_H */ | 320 | #endif /* _S390_RWSEM_H */ |
diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h index 7244e1f64126..40eb2ff88e9e 100644 --- a/arch/s390/include/asm/setup.h +++ b/arch/s390/include/asm/setup.h | |||
@@ -22,19 +22,19 @@ | |||
22 | #include <asm/lowcore.h> | 22 | #include <asm/lowcore.h> |
23 | #include <asm/types.h> | 23 | #include <asm/types.h> |
24 | 24 | ||
25 | #ifndef __s390x__ | 25 | #ifndef CONFIG_64BIT |
26 | #define IPL_DEVICE (*(unsigned long *) (0x10404)) | 26 | #define IPL_DEVICE (*(unsigned long *) (0x10404)) |
27 | #define INITRD_START (*(unsigned long *) (0x1040C)) | 27 | #define INITRD_START (*(unsigned long *) (0x1040C)) |
28 | #define INITRD_SIZE (*(unsigned long *) (0x10414)) | 28 | #define INITRD_SIZE (*(unsigned long *) (0x10414)) |
29 | #define OLDMEM_BASE (*(unsigned long *) (0x1041C)) | 29 | #define OLDMEM_BASE (*(unsigned long *) (0x1041C)) |
30 | #define OLDMEM_SIZE (*(unsigned long *) (0x10424)) | 30 | #define OLDMEM_SIZE (*(unsigned long *) (0x10424)) |
31 | #else /* __s390x__ */ | 31 | #else /* CONFIG_64BIT */ |
32 | #define IPL_DEVICE (*(unsigned long *) (0x10400)) | 32 | #define IPL_DEVICE (*(unsigned long *) (0x10400)) |
33 | #define INITRD_START (*(unsigned long *) (0x10408)) | 33 | #define INITRD_START (*(unsigned long *) (0x10408)) |
34 | #define INITRD_SIZE (*(unsigned long *) (0x10410)) | 34 | #define INITRD_SIZE (*(unsigned long *) (0x10410)) |
35 | #define OLDMEM_BASE (*(unsigned long *) (0x10418)) | 35 | #define OLDMEM_BASE (*(unsigned long *) (0x10418)) |
36 | #define OLDMEM_SIZE (*(unsigned long *) (0x10420)) | 36 | #define OLDMEM_SIZE (*(unsigned long *) (0x10420)) |
37 | #endif /* __s390x__ */ | 37 | #endif /* CONFIG_64BIT */ |
38 | #define COMMAND_LINE ((char *) (0x10480)) | 38 | #define COMMAND_LINE ((char *) (0x10480)) |
39 | 39 | ||
40 | #define CHUNK_READ_WRITE 0 | 40 | #define CHUNK_READ_WRITE 0 |
@@ -89,7 +89,7 @@ extern unsigned int user_mode; | |||
89 | 89 | ||
90 | #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C) | 90 | #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C) |
91 | 91 | ||
92 | #ifndef __s390x__ | 92 | #ifndef CONFIG_64BIT |
93 | #define MACHINE_HAS_IEEE (S390_lowcore.machine_flags & MACHINE_FLAG_IEEE) | 93 | #define MACHINE_HAS_IEEE (S390_lowcore.machine_flags & MACHINE_FLAG_IEEE) |
94 | #define MACHINE_HAS_CSP (S390_lowcore.machine_flags & MACHINE_FLAG_CSP) | 94 | #define MACHINE_HAS_CSP (S390_lowcore.machine_flags & MACHINE_FLAG_CSP) |
95 | #define MACHINE_HAS_IDTE (0) | 95 | #define MACHINE_HAS_IDTE (0) |
@@ -100,7 +100,7 @@ extern unsigned int user_mode; | |||
100 | #define MACHINE_HAS_PFMF (0) | 100 | #define MACHINE_HAS_PFMF (0) |
101 | #define MACHINE_HAS_SPP (0) | 101 | #define MACHINE_HAS_SPP (0) |
102 | #define MACHINE_HAS_TOPOLOGY (0) | 102 | #define MACHINE_HAS_TOPOLOGY (0) |
103 | #else /* __s390x__ */ | 103 | #else /* CONFIG_64BIT */ |
104 | #define MACHINE_HAS_IEEE (1) | 104 | #define MACHINE_HAS_IEEE (1) |
105 | #define MACHINE_HAS_CSP (1) | 105 | #define MACHINE_HAS_CSP (1) |
106 | #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE) | 106 | #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE) |
@@ -111,7 +111,7 @@ extern unsigned int user_mode; | |||
111 | #define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF) | 111 | #define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF) |
112 | #define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP) | 112 | #define MACHINE_HAS_SPP (S390_lowcore.machine_flags & MACHINE_FLAG_SPP) |
113 | #define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY) | 113 | #define MACHINE_HAS_TOPOLOGY (S390_lowcore.machine_flags & MACHINE_FLAG_TOPOLOGY) |
114 | #endif /* __s390x__ */ | 114 | #endif /* CONFIG_64BIT */ |
115 | 115 | ||
116 | #define ZFCPDUMP_HSA_SIZE (32UL<<20) | 116 | #define ZFCPDUMP_HSA_SIZE (32UL<<20) |
117 | #define ZFCPDUMP_HSA_SIZE_MAX (64UL<<20) | 117 | #define ZFCPDUMP_HSA_SIZE_MAX (64UL<<20) |
@@ -153,19 +153,19 @@ extern void (*_machine_power_off)(void); | |||
153 | 153 | ||
154 | #else /* __ASSEMBLY__ */ | 154 | #else /* __ASSEMBLY__ */ |
155 | 155 | ||
156 | #ifndef __s390x__ | 156 | #ifndef CONFIG_64BIT |
157 | #define IPL_DEVICE 0x10404 | 157 | #define IPL_DEVICE 0x10404 |
158 | #define INITRD_START 0x1040C | 158 | #define INITRD_START 0x1040C |
159 | #define INITRD_SIZE 0x10414 | 159 | #define INITRD_SIZE 0x10414 |
160 | #define OLDMEM_BASE 0x1041C | 160 | #define OLDMEM_BASE 0x1041C |
161 | #define OLDMEM_SIZE 0x10424 | 161 | #define OLDMEM_SIZE 0x10424 |
162 | #else /* __s390x__ */ | 162 | #else /* CONFIG_64BIT */ |
163 | #define IPL_DEVICE 0x10400 | 163 | #define IPL_DEVICE 0x10400 |
164 | #define INITRD_START 0x10408 | 164 | #define INITRD_START 0x10408 |
165 | #define INITRD_SIZE 0x10410 | 165 | #define INITRD_SIZE 0x10410 |
166 | #define OLDMEM_BASE 0x10418 | 166 | #define OLDMEM_BASE 0x10418 |
167 | #define OLDMEM_SIZE 0x10420 | 167 | #define OLDMEM_SIZE 0x10420 |
168 | #endif /* __s390x__ */ | 168 | #endif /* CONFIG_64BIT */ |
169 | #define COMMAND_LINE 0x10480 | 169 | #define COMMAND_LINE 0x10480 |
170 | 170 | ||
171 | #endif /* __ASSEMBLY__ */ | 171 | #endif /* __ASSEMBLY__ */ |
diff --git a/arch/s390/include/asm/sfp-util.h b/arch/s390/include/asm/sfp-util.h index ca3f8814e361..5959bfb3b693 100644 --- a/arch/s390/include/asm/sfp-util.h +++ b/arch/s390/include/asm/sfp-util.h | |||
@@ -51,7 +51,7 @@ | |||
51 | wl = __wl; \ | 51 | wl = __wl; \ |
52 | }) | 52 | }) |
53 | 53 | ||
54 | #ifdef __s390x__ | 54 | #ifdef CONFIG_64BIT |
55 | #define udiv_qrnnd(q, r, n1, n0, d) \ | 55 | #define udiv_qrnnd(q, r, n1, n0, d) \ |
56 | do { unsigned long __n; \ | 56 | do { unsigned long __n; \ |
57 | unsigned int __r, __d; \ | 57 | unsigned int __r, __d; \ |
diff --git a/arch/s390/include/asm/string.h b/arch/s390/include/asm/string.h index cd0241db5a46..8cc160c9e1cb 100644 --- a/arch/s390/include/asm/string.h +++ b/arch/s390/include/asm/string.h | |||
@@ -9,8 +9,6 @@ | |||
9 | #ifndef _S390_STRING_H_ | 9 | #ifndef _S390_STRING_H_ |
10 | #define _S390_STRING_H_ | 10 | #define _S390_STRING_H_ |
11 | 11 | ||
12 | #ifdef __KERNEL__ | ||
13 | |||
14 | #ifndef _LINUX_TYPES_H | 12 | #ifndef _LINUX_TYPES_H |
15 | #include <linux/types.h> | 13 | #include <linux/types.h> |
16 | #endif | 14 | #endif |
@@ -152,6 +150,4 @@ size_t strlen(const char *s); | |||
152 | size_t strnlen(const char * s, size_t n); | 150 | size_t strnlen(const char * s, size_t n); |
153 | #endif /* !IN_ARCH_STRING_C */ | 151 | #endif /* !IN_ARCH_STRING_C */ |
154 | 152 | ||
155 | #endif /* __KERNEL__ */ | ||
156 | |||
157 | #endif /* __S390_STRING_H_ */ | 153 | #endif /* __S390_STRING_H_ */ |
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h index 003b04edcff6..4e40b25cd060 100644 --- a/arch/s390/include/asm/thread_info.h +++ b/arch/s390/include/asm/thread_info.h | |||
@@ -9,15 +9,13 @@ | |||
9 | #ifndef _ASM_THREAD_INFO_H | 9 | #ifndef _ASM_THREAD_INFO_H |
10 | #define _ASM_THREAD_INFO_H | 10 | #define _ASM_THREAD_INFO_H |
11 | 11 | ||
12 | #ifdef __KERNEL__ | ||
13 | |||
14 | /* | 12 | /* |
15 | * Size of kernel stack for each process | 13 | * Size of kernel stack for each process |
16 | */ | 14 | */ |
17 | #ifndef __s390x__ | 15 | #ifndef CONFIG_64BIT |
18 | #define THREAD_ORDER 1 | 16 | #define THREAD_ORDER 1 |
19 | #define ASYNC_ORDER 1 | 17 | #define ASYNC_ORDER 1 |
20 | #else /* __s390x__ */ | 18 | #else /* CONFIG_64BIT */ |
21 | #ifndef __SMALL_STACK | 19 | #ifndef __SMALL_STACK |
22 | #define THREAD_ORDER 2 | 20 | #define THREAD_ORDER 2 |
23 | #define ASYNC_ORDER 2 | 21 | #define ASYNC_ORDER 2 |
@@ -25,7 +23,7 @@ | |||
25 | #define THREAD_ORDER 1 | 23 | #define THREAD_ORDER 1 |
26 | #define ASYNC_ORDER 1 | 24 | #define ASYNC_ORDER 1 |
27 | #endif | 25 | #endif |
28 | #endif /* __s390x__ */ | 26 | #endif /* CONFIG_64BIT */ |
29 | 27 | ||
30 | #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) | 28 | #define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) |
31 | #define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER) | 29 | #define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER) |
@@ -123,8 +121,6 @@ static inline struct thread_info *current_thread_info(void) | |||
123 | #define is_32bit_task() (1) | 121 | #define is_32bit_task() (1) |
124 | #endif | 122 | #endif |
125 | 123 | ||
126 | #endif /* __KERNEL__ */ | ||
127 | |||
128 | #define PREEMPT_ACTIVE 0x4000000 | 124 | #define PREEMPT_ACTIVE 0x4000000 |
129 | 125 | ||
130 | #endif /* _ASM_THREAD_INFO_H */ | 126 | #endif /* _ASM_THREAD_INFO_H */ |
diff --git a/arch/s390/include/asm/timer.h b/arch/s390/include/asm/timer.h index e63069ba39e3..15d647901e5c 100644 --- a/arch/s390/include/asm/timer.h +++ b/arch/s390/include/asm/timer.h | |||
@@ -10,8 +10,6 @@ | |||
10 | #ifndef _ASM_S390_TIMER_H | 10 | #ifndef _ASM_S390_TIMER_H |
11 | #define _ASM_S390_TIMER_H | 11 | #define _ASM_S390_TIMER_H |
12 | 12 | ||
13 | #ifdef __KERNEL__ | ||
14 | |||
15 | #include <linux/timer.h> | 13 | #include <linux/timer.h> |
16 | 14 | ||
17 | #define VTIMER_MAX_SLICE (0x7ffffffffffff000LL) | 15 | #define VTIMER_MAX_SLICE (0x7ffffffffffff000LL) |
@@ -50,6 +48,4 @@ extern void vtime_init(void); | |||
50 | extern void vtime_stop_cpu(void); | 48 | extern void vtime_stop_cpu(void); |
51 | extern void vtime_start_leave(void); | 49 | extern void vtime_start_leave(void); |
52 | 50 | ||
53 | #endif /* __KERNEL__ */ | ||
54 | |||
55 | #endif /* _ASM_S390_TIMER_H */ | 51 | #endif /* _ASM_S390_TIMER_H */ |
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h index 775a5eea8f9e..06e5acbc84bd 100644 --- a/arch/s390/include/asm/tlb.h +++ b/arch/s390/include/asm/tlb.h | |||
@@ -106,7 +106,7 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte, | |||
106 | static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd, | 106 | static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd, |
107 | unsigned long address) | 107 | unsigned long address) |
108 | { | 108 | { |
109 | #ifdef __s390x__ | 109 | #ifdef CONFIG_64BIT |
110 | if (tlb->mm->context.asce_limit <= (1UL << 31)) | 110 | if (tlb->mm->context.asce_limit <= (1UL << 31)) |
111 | return; | 111 | return; |
112 | if (!tlb->fullmm) | 112 | if (!tlb->fullmm) |
@@ -125,7 +125,7 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd, | |||
125 | static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud, | 125 | static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud, |
126 | unsigned long address) | 126 | unsigned long address) |
127 | { | 127 | { |
128 | #ifdef __s390x__ | 128 | #ifdef CONFIG_64BIT |
129 | if (tlb->mm->context.asce_limit <= (1UL << 42)) | 129 | if (tlb->mm->context.asce_limit <= (1UL << 42)) |
130 | return; | 130 | return; |
131 | if (!tlb->fullmm) | 131 | if (!tlb->fullmm) |
diff --git a/arch/s390/include/asm/tlbflush.h b/arch/s390/include/asm/tlbflush.h index 1d8648cf2fea..9fde315f3a7c 100644 --- a/arch/s390/include/asm/tlbflush.h +++ b/arch/s390/include/asm/tlbflush.h | |||
@@ -27,12 +27,12 @@ static inline void __tlb_flush_global(void) | |||
27 | register unsigned long reg4 asm("4"); | 27 | register unsigned long reg4 asm("4"); |
28 | long dummy; | 28 | long dummy; |
29 | 29 | ||
30 | #ifndef __s390x__ | 30 | #ifndef CONFIG_64BIT |
31 | if (!MACHINE_HAS_CSP) { | 31 | if (!MACHINE_HAS_CSP) { |
32 | smp_ptlb_all(); | 32 | smp_ptlb_all(); |
33 | return; | 33 | return; |
34 | } | 34 | } |
35 | #endif /* __s390x__ */ | 35 | #endif /* CONFIG_64BIT */ |
36 | 36 | ||
37 | dummy = 0; | 37 | dummy = 0; |
38 | reg2 = reg3 = 0; | 38 | reg2 = reg3 = 0; |
diff --git a/arch/s390/include/asm/types.h b/arch/s390/include/asm/types.h index 05ebbcdbbf6b..6c8c35f8df14 100644 --- a/arch/s390/include/asm/types.h +++ b/arch/s390/include/asm/types.h | |||
@@ -28,7 +28,7 @@ typedef __signed__ long saddr_t; | |||
28 | 28 | ||
29 | #ifndef __ASSEMBLY__ | 29 | #ifndef __ASSEMBLY__ |
30 | 30 | ||
31 | #ifndef __s390x__ | 31 | #ifndef CONFIG_64BIT |
32 | typedef union { | 32 | typedef union { |
33 | unsigned long long pair; | 33 | unsigned long long pair; |
34 | struct { | 34 | struct { |
@@ -37,7 +37,7 @@ typedef union { | |||
37 | } subreg; | 37 | } subreg; |
38 | } register_pair; | 38 | } register_pair; |
39 | 39 | ||
40 | #endif /* ! __s390x__ */ | 40 | #endif /* ! CONFIG_64BIT */ |
41 | #endif /* __ASSEMBLY__ */ | 41 | #endif /* __ASSEMBLY__ */ |
42 | #endif /* __KERNEL__ */ | 42 | #endif /* __KERNEL__ */ |
43 | #endif /* _S390_TYPES_H */ | 43 | #endif /* _S390_TYPES_H */ |
diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h index 8f2cada4f7c9..1f3a79bcd262 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h | |||
@@ -50,10 +50,15 @@ | |||
50 | 50 | ||
51 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) | 51 | #define segment_eq(a,b) ((a).ar4 == (b).ar4) |
52 | 52 | ||
53 | #define __access_ok(addr, size) \ | 53 | static inline int __range_ok(unsigned long addr, unsigned long size) |
54 | ({ \ | 54 | { |
55 | __chk_user_ptr(addr); \ | 55 | return 1; |
56 | 1; \ | 56 | } |
57 | |||
58 | #define __access_ok(addr, size) \ | ||
59 | ({ \ | ||
60 | __chk_user_ptr(addr); \ | ||
61 | __range_ok((unsigned long)(addr), (size)); \ | ||
57 | }) | 62 | }) |
58 | 63 | ||
59 | #define access_ok(type, addr, size) __access_ok(addr, size) | 64 | #define access_ok(type, addr, size) __access_ok(addr, size) |
@@ -377,7 +382,7 @@ clear_user(void __user *to, unsigned long n) | |||
377 | } | 382 | } |
378 | 383 | ||
379 | extern int memcpy_real(void *, void *, size_t); | 384 | extern int memcpy_real(void *, void *, size_t); |
380 | extern void copy_to_absolute_zero(void *dest, void *src, size_t count); | 385 | extern void memcpy_absolute(void *, void *, size_t); |
381 | extern int copy_to_user_real(void __user *dest, void *src, size_t count); | 386 | extern int copy_to_user_real(void __user *dest, void *src, size_t count); |
382 | extern int copy_from_user_real(void *dest, void __user *src, size_t count); | 387 | extern int copy_from_user_real(void *dest, void __user *src, size_t count); |
383 | 388 | ||
diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h index c4a11cfad3c8..a73eb2e1e918 100644 --- a/arch/s390/include/asm/vdso.h +++ b/arch/s390/include/asm/vdso.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef __S390_VDSO_H__ | 1 | #ifndef __S390_VDSO_H__ |
2 | #define __S390_VDSO_H__ | 2 | #define __S390_VDSO_H__ |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | /* Default link addresses for the vDSOs */ | 4 | /* Default link addresses for the vDSOs */ |
7 | #define VDSO32_LBASE 0 | 5 | #define VDSO32_LBASE 0 |
8 | #define VDSO64_LBASE 0 | 6 | #define VDSO64_LBASE 0 |
@@ -45,7 +43,4 @@ void vdso_free_per_cpu(struct _lowcore *lowcore); | |||
45 | #endif | 43 | #endif |
46 | 44 | ||
47 | #endif /* __ASSEMBLY__ */ | 45 | #endif /* __ASSEMBLY__ */ |
48 | |||
49 | #endif /* __KERNEL__ */ | ||
50 | |||
51 | #endif /* __S390_VDSO_H__ */ | 46 | #endif /* __S390_VDSO_H__ */ |
diff --git a/arch/s390/kernel/base.S b/arch/s390/kernel/base.S index 3aa4d00aaf50..c880ff72db44 100644 --- a/arch/s390/kernel/base.S +++ b/arch/s390/kernel/base.S | |||
@@ -88,6 +88,9 @@ ENTRY(diag308_reset) | |||
88 | stctg %c0,%c15,0(%r4) | 88 | stctg %c0,%c15,0(%r4) |
89 | larl %r4,.Lfpctl # Floating point control register | 89 | larl %r4,.Lfpctl # Floating point control register |
90 | stfpc 0(%r4) | 90 | stfpc 0(%r4) |
91 | larl %r4,.Lcontinue_psw # Save PSW flags | ||
92 | epsw %r2,%r3 | ||
93 | stm %r2,%r3,0(%r4) | ||
91 | larl %r4,.Lrestart_psw # Setup restart PSW at absolute 0 | 94 | larl %r4,.Lrestart_psw # Setup restart PSW at absolute 0 |
92 | lghi %r3,0 | 95 | lghi %r3,0 |
93 | lg %r4,0(%r4) # Save PSW | 96 | lg %r4,0(%r4) # Save PSW |
@@ -103,11 +106,20 @@ ENTRY(diag308_reset) | |||
103 | lctlg %c0,%c15,0(%r4) | 106 | lctlg %c0,%c15,0(%r4) |
104 | larl %r4,.Lfpctl # Restore floating point ctl register | 107 | larl %r4,.Lfpctl # Restore floating point ctl register |
105 | lfpc 0(%r4) | 108 | lfpc 0(%r4) |
109 | larl %r4,.Lcontinue_psw # Restore PSW flags | ||
110 | lpswe 0(%r4) | ||
111 | .Lcontinue: | ||
106 | br %r14 | 112 | br %r14 |
107 | .align 16 | 113 | .align 16 |
108 | .Lrestart_psw: | 114 | .Lrestart_psw: |
109 | .long 0x00080000,0x80000000 + .Lrestart_part2 | 115 | .long 0x00080000,0x80000000 + .Lrestart_part2 |
110 | 116 | ||
117 | .section .data..nosave,"aw",@progbits | ||
118 | .align 8 | ||
119 | .Lcontinue_psw: | ||
120 | .quad 0,.Lcontinue | ||
121 | .previous | ||
122 | |||
111 | .section .bss | 123 | .section .bss |
112 | .align 8 | 124 | .align 8 |
113 | .Lctlregs: | 125 | .Lctlregs: |
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index d84181f1f5e8..6684fff17558 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -237,7 +237,7 @@ static noinline __init void detect_machine_type(void) | |||
237 | S390_lowcore.machine_flags |= MACHINE_FLAG_VM; | 237 | S390_lowcore.machine_flags |= MACHINE_FLAG_VM; |
238 | } | 238 | } |
239 | 239 | ||
240 | static __init void early_pgm_check_handler(void) | 240 | static void early_pgm_check_handler(void) |
241 | { | 241 | { |
242 | unsigned long addr; | 242 | unsigned long addr; |
243 | const struct exception_table_entry *fixup; | 243 | const struct exception_table_entry *fixup; |
diff --git a/arch/s390/kernel/head_kdump.S b/arch/s390/kernel/head_kdump.S index e1ac3893e972..796c976b5fdc 100644 --- a/arch/s390/kernel/head_kdump.S +++ b/arch/s390/kernel/head_kdump.S | |||
@@ -85,11 +85,6 @@ startup_kdump_relocated: | |||
85 | basr %r13,0 | 85 | basr %r13,0 |
86 | 0: | 86 | 0: |
87 | mvc 0(8,%r0),.Lrestart_psw-0b(%r13) # Setup restart PSW | 87 | mvc 0(8,%r0),.Lrestart_psw-0b(%r13) # Setup restart PSW |
88 | mvc 464(16,%r0),.Lpgm_psw-0b(%r13) # Setup pgm check PSW | ||
89 | lhi %r1,1 # Start new kernel | ||
90 | diag %r1,%r1,0x308 # with diag 308 | ||
91 | |||
92 | .Lno_diag308: # No diag 308 | ||
93 | sam31 # Switch to 31 bit addr mode | 88 | sam31 # Switch to 31 bit addr mode |
94 | sr %r1,%r1 # Erase register r1 | 89 | sr %r1,%r1 # Erase register r1 |
95 | sr %r2,%r2 # Erase register r2 | 90 | sr %r2,%r2 # Erase register r2 |
@@ -98,8 +93,6 @@ startup_kdump_relocated: | |||
98 | .align 8 | 93 | .align 8 |
99 | .Lrestart_psw: | 94 | .Lrestart_psw: |
100 | .long 0x00080000,0x80000000 + startup | 95 | .long 0x00080000,0x80000000 + startup |
101 | .Lpgm_psw: | ||
102 | .quad 0x0000000180000000,0x0000000000000000 + .Lno_diag308 | ||
103 | #else | 96 | #else |
104 | .align 2 | 97 | .align 2 |
105 | .Lep_startup_kdump: | 98 | .Lep_startup_kdump: |
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 8342e65a140d..2f6cfd460cb6 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -1528,12 +1528,15 @@ static struct shutdown_action __refdata dump_action = { | |||
1528 | 1528 | ||
1529 | static void dump_reipl_run(struct shutdown_trigger *trigger) | 1529 | static void dump_reipl_run(struct shutdown_trigger *trigger) |
1530 | { | 1530 | { |
1531 | u32 csum; | 1531 | struct { |
1532 | 1532 | void *addr; | |
1533 | csum = csum_partial(reipl_block_actual, reipl_block_actual->hdr.len, 0); | 1533 | __u32 csum; |
1534 | copy_to_absolute_zero(&S390_lowcore.ipib_checksum, &csum, sizeof(csum)); | 1534 | } __packed ipib; |
1535 | copy_to_absolute_zero(&S390_lowcore.ipib, &reipl_block_actual, | 1535 | |
1536 | sizeof(reipl_block_actual)); | 1536 | ipib.csum = csum_partial(reipl_block_actual, |
1537 | reipl_block_actual->hdr.len, 0); | ||
1538 | ipib.addr = reipl_block_actual; | ||
1539 | memcpy_absolute(&S390_lowcore.ipib, &ipib, sizeof(ipib)); | ||
1537 | dump_run(trigger); | 1540 | dump_run(trigger); |
1538 | } | 1541 | } |
1539 | 1542 | ||
@@ -1750,6 +1753,7 @@ static struct kobj_attribute on_restart_attr = | |||
1750 | 1753 | ||
1751 | static void __do_restart(void *ignore) | 1754 | static void __do_restart(void *ignore) |
1752 | { | 1755 | { |
1756 | __arch_local_irq_stosm(0x04); /* enable DAT */ | ||
1753 | smp_send_stop(); | 1757 | smp_send_stop(); |
1754 | #ifdef CONFIG_CRASH_DUMP | 1758 | #ifdef CONFIG_CRASH_DUMP |
1755 | crash_kexec(NULL); | 1759 | crash_kexec(NULL); |
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index 8a22c27219dd..b4f4a7133fa1 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c | |||
@@ -42,7 +42,8 @@ static const struct irq_class intrclass_names[] = { | |||
42 | {.name = "VRT", .desc = "[EXT] Virtio" }, | 42 | {.name = "VRT", .desc = "[EXT] Virtio" }, |
43 | {.name = "SCP", .desc = "[EXT] Service Call" }, | 43 | {.name = "SCP", .desc = "[EXT] Service Call" }, |
44 | {.name = "IUC", .desc = "[EXT] IUCV" }, | 44 | {.name = "IUC", .desc = "[EXT] IUCV" }, |
45 | {.name = "CPM", .desc = "[EXT] CPU Measurement" }, | 45 | {.name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling" }, |
46 | {.name = "CMC", .desc = "[EXT] CPU-Measurement: Counter" }, | ||
46 | {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt" }, | 47 | {.name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt" }, |
47 | {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt" }, | 48 | {.name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt" }, |
48 | {.name = "DAS", .desc = "[I/O] DASD" }, | 49 | {.name = "DAS", .desc = "[I/O] DASD" }, |
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c index bdad47d54478..cdacf8f91b2d 100644 --- a/arch/s390/kernel/machine_kexec.c +++ b/arch/s390/kernel/machine_kexec.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/ipl.h> | 24 | #include <asm/ipl.h> |
25 | #include <asm/diag.h> | 25 | #include <asm/diag.h> |
26 | #include <asm/asm-offsets.h> | 26 | #include <asm/asm-offsets.h> |
27 | #include <asm/os_info.h> | ||
27 | 28 | ||
28 | typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long); | 29 | typedef void (*relocate_kernel_t)(kimage_entry_t *, unsigned long); |
29 | 30 | ||
@@ -79,8 +80,8 @@ static void __do_machine_kdump(void *image) | |||
79 | #ifdef CONFIG_CRASH_DUMP | 80 | #ifdef CONFIG_CRASH_DUMP |
80 | int (*start_kdump)(int) = (void *)((struct kimage *) image)->start; | 81 | int (*start_kdump)(int) = (void *)((struct kimage *) image)->start; |
81 | 82 | ||
82 | __load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA); | ||
83 | setup_regs(); | 83 | setup_regs(); |
84 | __load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA); | ||
84 | start_kdump(1); | 85 | start_kdump(1); |
85 | #endif | 86 | #endif |
86 | } | 87 | } |
@@ -114,8 +115,13 @@ static void crash_map_pages(int enable) | |||
114 | size % KEXEC_CRASH_MEM_ALIGN); | 115 | size % KEXEC_CRASH_MEM_ALIGN); |
115 | if (enable) | 116 | if (enable) |
116 | vmem_add_mapping(crashk_res.start, size); | 117 | vmem_add_mapping(crashk_res.start, size); |
117 | else | 118 | else { |
118 | vmem_remove_mapping(crashk_res.start, size); | 119 | vmem_remove_mapping(crashk_res.start, size); |
120 | if (size) | ||
121 | os_info_crashkernel_add(crashk_res.start, size); | ||
122 | else | ||
123 | os_info_crashkernel_add(0, 0); | ||
124 | } | ||
119 | } | 125 | } |
120 | 126 | ||
121 | /* | 127 | /* |
@@ -208,6 +214,7 @@ static void __machine_kexec(void *data) | |||
208 | { | 214 | { |
209 | struct kimage *image = data; | 215 | struct kimage *image = data; |
210 | 216 | ||
217 | __arch_local_irq_stosm(0x04); /* enable DAT */ | ||
211 | pfault_fini(); | 218 | pfault_fini(); |
212 | tracing_off(); | 219 | tracing_off(); |
213 | debug_locks_off(); | 220 | debug_locks_off(); |
diff --git a/arch/s390/kernel/os_info.c b/arch/s390/kernel/os_info.c index e8d6c214d498..95fa5ac6c4ce 100644 --- a/arch/s390/kernel/os_info.c +++ b/arch/s390/kernel/os_info.c | |||
@@ -60,7 +60,7 @@ void __init os_info_init(void) | |||
60 | os_info.version_minor = OS_INFO_VERSION_MINOR; | 60 | os_info.version_minor = OS_INFO_VERSION_MINOR; |
61 | os_info.magic = OS_INFO_MAGIC; | 61 | os_info.magic = OS_INFO_MAGIC; |
62 | os_info.csum = os_info_csum(&os_info); | 62 | os_info.csum = os_info_csum(&os_info); |
63 | copy_to_absolute_zero(&S390_lowcore.os_info, &ptr, sizeof(ptr)); | 63 | memcpy_absolute(&S390_lowcore.os_info, &ptr, sizeof(ptr)); |
64 | } | 64 | } |
65 | 65 | ||
66 | #ifdef CONFIG_CRASH_DUMP | 66 | #ifdef CONFIG_CRASH_DUMP |
@@ -138,7 +138,6 @@ static void os_info_old_init(void) | |||
138 | goto fail_free; | 138 | goto fail_free; |
139 | os_info_old_alloc(OS_INFO_VMCOREINFO, 1); | 139 | os_info_old_alloc(OS_INFO_VMCOREINFO, 1); |
140 | os_info_old_alloc(OS_INFO_REIPL_BLOCK, 1); | 140 | os_info_old_alloc(OS_INFO_REIPL_BLOCK, 1); |
141 | os_info_old_alloc(OS_INFO_INIT_FN, PAGE_SIZE); | ||
142 | pr_info("crashkernel: addr=0x%lx size=%lu\n", | 141 | pr_info("crashkernel: addr=0x%lx size=%lu\n", |
143 | (unsigned long) os_info_old->crashkernel_addr, | 142 | (unsigned long) os_info_old->crashkernel_addr, |
144 | (unsigned long) os_info_old->crashkernel_size); | 143 | (unsigned long) os_info_old->crashkernel_size); |
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index cb019f429e88..9871b1971ed7 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c | |||
@@ -225,7 +225,7 @@ static void cpumf_measurement_alert(struct ext_code ext_code, | |||
225 | if (!(alert & CPU_MF_INT_CF_MASK)) | 225 | if (!(alert & CPU_MF_INT_CF_MASK)) |
226 | return; | 226 | return; |
227 | 227 | ||
228 | kstat_cpu(smp_processor_id()).irqs[EXTINT_CPM]++; | 228 | kstat_cpu(smp_processor_id()).irqs[EXTINT_CMC]++; |
229 | cpuhw = &__get_cpu_var(cpu_hw_events); | 229 | cpuhw = &__get_cpu_var(cpu_hw_events); |
230 | 230 | ||
231 | /* Measurement alerts are shared and might happen when the PMU | 231 | /* Measurement alerts are shared and might happen when the PMU |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 06264ae8ccd9..489d1d8d96b0 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -428,10 +428,12 @@ static void __init setup_lowcore(void) | |||
428 | lc->restart_fn = (unsigned long) do_restart; | 428 | lc->restart_fn = (unsigned long) do_restart; |
429 | lc->restart_data = 0; | 429 | lc->restart_data = 0; |
430 | lc->restart_source = -1UL; | 430 | lc->restart_source = -1UL; |
431 | memcpy(&S390_lowcore.restart_stack, &lc->restart_stack, | 431 | |
432 | 4*sizeof(unsigned long)); | 432 | /* Setup absolute zero lowcore */ |
433 | copy_to_absolute_zero(&S390_lowcore.restart_psw, | 433 | memcpy_absolute(&S390_lowcore.restart_stack, &lc->restart_stack, |
434 | &lc->restart_psw, sizeof(psw_t)); | 434 | 4 * sizeof(unsigned long)); |
435 | memcpy_absolute(&S390_lowcore.restart_psw, &lc->restart_psw, | ||
436 | sizeof(lc->restart_psw)); | ||
435 | 437 | ||
436 | set_prefix((u32)(unsigned long) lc); | 438 | set_prefix((u32)(unsigned long) lc); |
437 | lowcore_ptr[0] = lc; | 439 | lowcore_ptr[0] = lc; |
@@ -598,7 +600,7 @@ static void __init setup_vmcoreinfo(void) | |||
598 | #ifdef CONFIG_KEXEC | 600 | #ifdef CONFIG_KEXEC |
599 | unsigned long ptr = paddr_vmcoreinfo_note(); | 601 | unsigned long ptr = paddr_vmcoreinfo_note(); |
600 | 602 | ||
601 | copy_to_absolute_zero(&S390_lowcore.vmcore_info, &ptr, sizeof(ptr)); | 603 | memcpy_absolute(&S390_lowcore.vmcore_info, &ptr, sizeof(ptr)); |
602 | #endif | 604 | #endif |
603 | } | 605 | } |
604 | 606 | ||
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 647ba9425893..15cca26ccb6c 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -297,26 +297,27 @@ static void pcpu_start_fn(struct pcpu *pcpu, void (*func)(void *), void *data) | |||
297 | static void pcpu_delegate(struct pcpu *pcpu, void (*func)(void *), | 297 | static void pcpu_delegate(struct pcpu *pcpu, void (*func)(void *), |
298 | void *data, unsigned long stack) | 298 | void *data, unsigned long stack) |
299 | { | 299 | { |
300 | struct _lowcore *lc = pcpu->lowcore; | 300 | struct _lowcore *lc = lowcore_ptr[pcpu - pcpu_devices]; |
301 | unsigned short this_cpu; | 301 | struct { |
302 | unsigned long stack; | ||
303 | void *func; | ||
304 | void *data; | ||
305 | unsigned long source; | ||
306 | } restart = { stack, func, data, stap() }; | ||
302 | 307 | ||
303 | __load_psw_mask(psw_kernel_bits); | 308 | __load_psw_mask(psw_kernel_bits); |
304 | this_cpu = stap(); | 309 | if (pcpu->address == restart.source) |
305 | if (pcpu->address == this_cpu) | ||
306 | func(data); /* should not return */ | 310 | func(data); /* should not return */ |
307 | /* Stop target cpu (if func returns this stops the current cpu). */ | 311 | /* Stop target cpu (if func returns this stops the current cpu). */ |
308 | pcpu_sigp_retry(pcpu, sigp_stop, 0); | 312 | pcpu_sigp_retry(pcpu, sigp_stop, 0); |
309 | /* Restart func on the target cpu and stop the current cpu. */ | 313 | /* Restart func on the target cpu and stop the current cpu. */ |
310 | lc->restart_stack = stack; | 314 | memcpy_absolute(&lc->restart_stack, &restart, sizeof(restart)); |
311 | lc->restart_fn = (unsigned long) func; | ||
312 | lc->restart_data = (unsigned long) data; | ||
313 | lc->restart_source = (unsigned long) this_cpu; | ||
314 | asm volatile( | 315 | asm volatile( |
315 | "0: sigp 0,%0,6 # sigp restart to target cpu\n" | 316 | "0: sigp 0,%0,6 # sigp restart to target cpu\n" |
316 | " brc 2,0b # busy, try again\n" | 317 | " brc 2,0b # busy, try again\n" |
317 | "1: sigp 0,%1,5 # sigp stop to current cpu\n" | 318 | "1: sigp 0,%1,5 # sigp stop to current cpu\n" |
318 | " brc 2,1b # busy, try again\n" | 319 | " brc 2,1b # busy, try again\n" |
319 | : : "d" (pcpu->address), "d" (this_cpu) : "0", "1", "cc"); | 320 | : : "d" (pcpu->address), "d" (restart.source) : "0", "1", "cc"); |
320 | for (;;) ; | 321 | for (;;) ; |
321 | } | 322 | } |
322 | 323 | ||
@@ -800,17 +801,6 @@ void __noreturn cpu_die(void) | |||
800 | 801 | ||
801 | #endif /* CONFIG_HOTPLUG_CPU */ | 802 | #endif /* CONFIG_HOTPLUG_CPU */ |
802 | 803 | ||
803 | static void smp_call_os_info_init_fn(void) | ||
804 | { | ||
805 | int (*init_fn)(void); | ||
806 | unsigned long size; | ||
807 | |||
808 | init_fn = os_info_old_entry(OS_INFO_INIT_FN, &size); | ||
809 | if (!init_fn) | ||
810 | return; | ||
811 | init_fn(); | ||
812 | } | ||
813 | |||
814 | void __init smp_prepare_cpus(unsigned int max_cpus) | 804 | void __init smp_prepare_cpus(unsigned int max_cpus) |
815 | { | 805 | { |
816 | /* request the 0x1201 emergency signal external interrupt */ | 806 | /* request the 0x1201 emergency signal external interrupt */ |
@@ -819,7 +809,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
819 | /* request the 0x1202 external call external interrupt */ | 809 | /* request the 0x1202 external call external interrupt */ |
820 | if (register_external_interrupt(0x1202, do_ext_call_interrupt) != 0) | 810 | if (register_external_interrupt(0x1202, do_ext_call_interrupt) != 0) |
821 | panic("Couldn't request external interrupt 0x1202"); | 811 | panic("Couldn't request external interrupt 0x1202"); |
822 | smp_call_os_info_init_fn(); | ||
823 | smp_detect_cpus(); | 812 | smp_detect_cpus(); |
824 | } | 813 | } |
825 | 814 | ||
@@ -943,19 +932,6 @@ static struct attribute_group cpu_common_attr_group = { | |||
943 | .attrs = cpu_common_attrs, | 932 | .attrs = cpu_common_attrs, |
944 | }; | 933 | }; |
945 | 934 | ||
946 | static ssize_t show_capability(struct device *dev, | ||
947 | struct device_attribute *attr, char *buf) | ||
948 | { | ||
949 | unsigned int capability; | ||
950 | int rc; | ||
951 | |||
952 | rc = get_cpu_capability(&capability); | ||
953 | if (rc) | ||
954 | return rc; | ||
955 | return sprintf(buf, "%u\n", capability); | ||
956 | } | ||
957 | static DEVICE_ATTR(capability, 0444, show_capability, NULL); | ||
958 | |||
959 | static ssize_t show_idle_count(struct device *dev, | 935 | static ssize_t show_idle_count(struct device *dev, |
960 | struct device_attribute *attr, char *buf) | 936 | struct device_attribute *attr, char *buf) |
961 | { | 937 | { |
@@ -993,7 +969,6 @@ static ssize_t show_idle_time(struct device *dev, | |||
993 | static DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL); | 969 | static DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL); |
994 | 970 | ||
995 | static struct attribute *cpu_online_attrs[] = { | 971 | static struct attribute *cpu_online_attrs[] = { |
996 | &dev_attr_capability.attr, | ||
997 | &dev_attr_idle_count.attr, | 972 | &dev_attr_idle_count.attr, |
998 | &dev_attr_idle_time_us.attr, | 973 | &dev_attr_idle_time_us.attr, |
999 | NULL, | 974 | NULL, |
diff --git a/arch/s390/kernel/sysinfo.c b/arch/s390/kernel/sysinfo.c index 2a94b774695c..fa0eb238dac7 100644 --- a/arch/s390/kernel/sysinfo.c +++ b/arch/s390/kernel/sysinfo.c | |||
@@ -393,27 +393,6 @@ static __init int create_proc_service_level(void) | |||
393 | subsys_initcall(create_proc_service_level); | 393 | subsys_initcall(create_proc_service_level); |
394 | 394 | ||
395 | /* | 395 | /* |
396 | * Bogomips calculation based on cpu capability. | ||
397 | */ | ||
398 | int get_cpu_capability(unsigned int *capability) | ||
399 | { | ||
400 | struct sysinfo_1_2_2 *info; | ||
401 | int rc; | ||
402 | |||
403 | info = (void *) get_zeroed_page(GFP_KERNEL); | ||
404 | if (!info) | ||
405 | return -ENOMEM; | ||
406 | rc = stsi(info, 1, 2, 2); | ||
407 | if (rc == -ENOSYS) | ||
408 | goto out; | ||
409 | rc = 0; | ||
410 | *capability = info->capability; | ||
411 | out: | ||
412 | free_page((unsigned long) info); | ||
413 | return rc; | ||
414 | } | ||
415 | |||
416 | /* | ||
417 | * CPU capability might have changed. Therefore recalculate loops_per_jiffy. | 396 | * CPU capability might have changed. Therefore recalculate loops_per_jiffy. |
418 | */ | 397 | */ |
419 | void s390_adjust_jiffies(void) | 398 | void s390_adjust_jiffies(void) |
diff --git a/arch/s390/lib/uaccess_mvcos.c b/arch/s390/lib/uaccess_mvcos.c index 60455f104ea3..58a75a8ae90c 100644 --- a/arch/s390/lib/uaccess_mvcos.c +++ b/arch/s390/lib/uaccess_mvcos.c | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <asm/futex.h> | 14 | #include <asm/futex.h> |
15 | #include "uaccess.h" | 15 | #include "uaccess.h" |
16 | 16 | ||
17 | #ifndef __s390x__ | 17 | #ifndef CONFIG_64BIT |
18 | #define AHI "ahi" | 18 | #define AHI "ahi" |
19 | #define ALR "alr" | 19 | #define ALR "alr" |
20 | #define CLR "clr" | 20 | #define CLR "clr" |
diff --git a/arch/s390/lib/uaccess_std.c b/arch/s390/lib/uaccess_std.c index bb1a7eed42ce..57e94298539b 100644 --- a/arch/s390/lib/uaccess_std.c +++ b/arch/s390/lib/uaccess_std.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <asm/futex.h> | 15 | #include <asm/futex.h> |
16 | #include "uaccess.h" | 16 | #include "uaccess.h" |
17 | 17 | ||
18 | #ifndef __s390x__ | 18 | #ifndef CONFIG_64BIT |
19 | #define AHI "ahi" | 19 | #define AHI "ahi" |
20 | #define ALR "alr" | 20 | #define ALR "alr" |
21 | #define CLR "clr" | 21 | #define CLR "clr" |
diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c index 795a0a9bb2eb..921fa541dc04 100644 --- a/arch/s390/mm/maccess.c +++ b/arch/s390/mm/maccess.c | |||
@@ -101,19 +101,27 @@ int memcpy_real(void *dest, void *src, size_t count) | |||
101 | } | 101 | } |
102 | 102 | ||
103 | /* | 103 | /* |
104 | * Copy memory to absolute zero | 104 | * Copy memory in absolute mode (kernel to kernel) |
105 | */ | 105 | */ |
106 | void copy_to_absolute_zero(void *dest, void *src, size_t count) | 106 | void memcpy_absolute(void *dest, void *src, size_t count) |
107 | { | 107 | { |
108 | unsigned long cr0; | 108 | unsigned long cr0, flags, prefix; |
109 | 109 | ||
110 | BUG_ON((unsigned long) dest + count >= sizeof(struct _lowcore)); | 110 | flags = arch_local_irq_save(); |
111 | preempt_disable(); | ||
112 | __ctl_store(cr0, 0, 0); | 111 | __ctl_store(cr0, 0, 0); |
113 | __ctl_clear_bit(0, 28); /* disable lowcore protection */ | 112 | __ctl_clear_bit(0, 28); /* disable lowcore protection */ |
114 | memcpy_real(dest + store_prefix(), src, count); | 113 | prefix = store_prefix(); |
114 | if (prefix) { | ||
115 | local_mcck_disable(); | ||
116 | set_prefix(0); | ||
117 | memcpy(dest, src, count); | ||
118 | set_prefix(prefix); | ||
119 | local_mcck_enable(); | ||
120 | } else { | ||
121 | memcpy(dest, src, count); | ||
122 | } | ||
115 | __ctl_load(cr0, 0, 0); | 123 | __ctl_load(cr0, 0, 0); |
116 | preempt_enable(); | 124 | arch_local_irq_restore(flags); |
117 | } | 125 | } |
118 | 126 | ||
119 | /* | 127 | /* |
@@ -188,20 +196,6 @@ static int is_swapped(unsigned long addr) | |||
188 | } | 196 | } |
189 | 197 | ||
190 | /* | 198 | /* |
191 | * Return swapped prefix or zero page address | ||
192 | */ | ||
193 | static unsigned long get_swapped(unsigned long addr) | ||
194 | { | ||
195 | unsigned long prefix = store_prefix(); | ||
196 | |||
197 | if (addr < sizeof(struct _lowcore)) | ||
198 | return addr + prefix; | ||
199 | if (addr >= prefix && addr < prefix + sizeof(struct _lowcore)) | ||
200 | return addr - prefix; | ||
201 | return addr; | ||
202 | } | ||
203 | |||
204 | /* | ||
205 | * Convert a physical pointer for /dev/mem access | 199 | * Convert a physical pointer for /dev/mem access |
206 | * | 200 | * |
207 | * For swapped prefix pages a new buffer is returned that contains a copy of | 201 | * For swapped prefix pages a new buffer is returned that contains a copy of |
@@ -218,7 +212,7 @@ void *xlate_dev_mem_ptr(unsigned long addr) | |||
218 | size = PAGE_SIZE - (addr & ~PAGE_MASK); | 212 | size = PAGE_SIZE - (addr & ~PAGE_MASK); |
219 | bounce = (void *) __get_free_page(GFP_ATOMIC); | 213 | bounce = (void *) __get_free_page(GFP_ATOMIC); |
220 | if (bounce) | 214 | if (bounce) |
221 | memcpy_real(bounce, (void *) get_swapped(addr), size); | 215 | memcpy_absolute(bounce, (void *) addr, size); |
222 | } | 216 | } |
223 | preempt_enable(); | 217 | preempt_enable(); |
224 | put_online_cpus(); | 218 | put_online_cpus(); |
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index 4799383e2df9..71ae20df674e 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c | |||
@@ -109,7 +109,7 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro) | |||
109 | pte = mk_pte_phys(address, __pgprot(ro ? _PAGE_RO : 0)); | 109 | pte = mk_pte_phys(address, __pgprot(ro ? _PAGE_RO : 0)); |
110 | pm_dir = pmd_offset(pu_dir, address); | 110 | pm_dir = pmd_offset(pu_dir, address); |
111 | 111 | ||
112 | #ifdef __s390x__ | 112 | #ifdef CONFIG_64BIT |
113 | if (MACHINE_HAS_HPAGE && !(address & ~HPAGE_MASK) && | 113 | if (MACHINE_HAS_HPAGE && !(address & ~HPAGE_MASK) && |
114 | (address + HPAGE_SIZE <= start + size) && | 114 | (address + HPAGE_SIZE <= start + size) && |
115 | (address >= HPAGE_SIZE)) { | 115 | (address >= HPAGE_SIZE)) { |
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c index c6646de07bf4..a4a89fa980d6 100644 --- a/arch/s390/oprofile/hwsampler.c +++ b/arch/s390/oprofile/hwsampler.c | |||
@@ -235,7 +235,7 @@ static void hws_ext_handler(struct ext_code ext_code, | |||
235 | if (!(param32 & CPU_MF_INT_SF_MASK)) | 235 | if (!(param32 & CPU_MF_INT_SF_MASK)) |
236 | return; | 236 | return; |
237 | 237 | ||
238 | kstat_cpu(smp_processor_id()).irqs[EXTINT_CPM]++; | 238 | kstat_cpu(smp_processor_id()).irqs[EXTINT_CMS]++; |
239 | atomic_xchg(&cb->ext_params, atomic_read(&cb->ext_params) | param32); | 239 | atomic_xchg(&cb->ext_params, atomic_read(&cb->ext_params) | param32); |
240 | 240 | ||
241 | if (hws_wq) | 241 | if (hws_wq) |