diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-10-30 10:16:50 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-10-30 10:16:43 -0400 |
commit | b50511e41aa51a89b4176784a670582424bc7db6 (patch) | |
tree | 0ad1553c7f2431878310e590187ee59ccb4d8cab /arch/s390 | |
parent | b6ef5bb3d93efb95ba855a628740375c2280a59e (diff) |
[S390] cleanup psw related bits and pieces
Split out addressing mode bits from PSW_BASE_BITS, rename PSW_BASE_BITS
to PSW_MASK_BASE, get rid of psw_user32_bits, remove unused function
enabled_wait(), introduce PSW_MASK_USER, and drop PSW_MASK_MERGE macros.
Change psw_kernel_bits / psw_user_bits to contain only the bits that
are always set in the respective mode.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/compat.h | 13 | ||||
-rw-r--r-- | arch/s390/include/asm/processor.h | 30 | ||||
-rw-r--r-- | arch/s390/include/asm/ptrace.h | 20 | ||||
-rw-r--r-- | arch/s390/include/asm/system.h | 6 | ||||
-rw-r--r-- | arch/s390/kernel/compat_linux.c | 9 | ||||
-rw-r--r-- | arch/s390/kernel/compat_signal.c | 10 | ||||
-rw-r--r-- | arch/s390/kernel/early.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/ipl.c | 4 | ||||
-rw-r--r-- | arch/s390/kernel/machine_kexec.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/s390/kernel/ptrace.c | 36 | ||||
-rw-r--r-- | arch/s390/kernel/setup.c | 53 | ||||
-rw-r--r-- | arch/s390/kernel/signal.c | 7 | ||||
-rw-r--r-- | arch/s390/kernel/smp.c | 16 | ||||
-rw-r--r-- | arch/s390/kernel/traps.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/vtime.c | 9 | ||||
-rw-r--r-- | arch/s390/lib/delay.c | 3 | ||||
-rw-r--r-- | arch/s390/mm/fault.c | 2 |
18 files changed, 105 insertions, 122 deletions
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index cdb9b78f6c08..2e49748b27da 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define PSW32_MASK_IO 0x02000000UL | 12 | #define PSW32_MASK_IO 0x02000000UL |
13 | #define PSW32_MASK_EXT 0x01000000UL | 13 | #define PSW32_MASK_EXT 0x01000000UL |
14 | #define PSW32_MASK_KEY 0x00F00000UL | 14 | #define PSW32_MASK_KEY 0x00F00000UL |
15 | #define PSW32_MASK_BASE 0x00080000UL /* Always one */ | ||
15 | #define PSW32_MASK_MCHECK 0x00040000UL | 16 | #define PSW32_MASK_MCHECK 0x00040000UL |
16 | #define PSW32_MASK_WAIT 0x00020000UL | 17 | #define PSW32_MASK_WAIT 0x00020000UL |
17 | #define PSW32_MASK_PSTATE 0x00010000UL | 18 | #define PSW32_MASK_PSTATE 0x00010000UL |
@@ -19,21 +20,19 @@ | |||
19 | #define PSW32_MASK_CC 0x00003000UL | 20 | #define PSW32_MASK_CC 0x00003000UL |
20 | #define PSW32_MASK_PM 0x00000f00UL | 21 | #define PSW32_MASK_PM 0x00000f00UL |
21 | 22 | ||
22 | #define PSW32_ADDR_AMODE31 0x80000000UL | 23 | #define PSW32_MASK_USER 0x00003F00UL |
24 | |||
25 | #define PSW32_ADDR_AMODE 0x80000000UL | ||
23 | #define PSW32_ADDR_INSN 0x7FFFFFFFUL | 26 | #define PSW32_ADDR_INSN 0x7FFFFFFFUL |
24 | 27 | ||
25 | #define PSW32_BASE_BITS 0x00080000UL | 28 | #define PSW32_DEFAULT_KEY (((u32) PAGE_DEFAULT_ACC) << 20) |
26 | 29 | ||
27 | #define PSW32_ASC_PRIMARY 0x00000000UL | 30 | #define PSW32_ASC_PRIMARY 0x00000000UL |
28 | #define PSW32_ASC_ACCREG 0x00004000UL | 31 | #define PSW32_ASC_ACCREG 0x00004000UL |
29 | #define PSW32_ASC_SECONDARY 0x00008000UL | 32 | #define PSW32_ASC_SECONDARY 0x00008000UL |
30 | #define PSW32_ASC_HOME 0x0000C000UL | 33 | #define PSW32_ASC_HOME 0x0000C000UL |
31 | 34 | ||
32 | #define PSW32_MASK_MERGE(CURRENT,NEW) \ | 35 | extern u32 psw32_user_bits; |
33 | (((CURRENT) & ~(PSW32_MASK_CC|PSW32_MASK_PM)) | \ | ||
34 | ((NEW) & (PSW32_MASK_CC|PSW32_MASK_PM))) | ||
35 | |||
36 | extern long psw32_user_bits; | ||
37 | 36 | ||
38 | #define COMPAT_USER_HZ 100 | 37 | #define COMPAT_USER_HZ 100 |
39 | #define COMPAT_UTS_MACHINE "s390\0\0\0\0" | 38 | #define COMPAT_UTS_MACHINE "s390\0\0\0\0" |
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index 306c93c1b184..20ffb12d4ae9 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h | |||
@@ -118,17 +118,17 @@ struct stack_frame { | |||
118 | /* | 118 | /* |
119 | * Do necessary setup to start up a new thread. | 119 | * Do necessary setup to start up a new thread. |
120 | */ | 120 | */ |
121 | #define start_thread(regs, new_psw, new_stackp) do { \ | 121 | #define start_thread(regs, new_psw, new_stackp) do { \ |
122 | regs->psw.mask = psw_user_bits; \ | 122 | regs->psw.mask = psw_user_bits | PSW_MASK_EA | PSW_MASK_BA; \ |
123 | regs->psw.addr = new_psw | PSW_ADDR_AMODE; \ | 123 | regs->psw.addr = new_psw | PSW_ADDR_AMODE; \ |
124 | regs->gprs[15] = new_stackp; \ | 124 | regs->gprs[15] = new_stackp; \ |
125 | } while (0) | 125 | } while (0) |
126 | 126 | ||
127 | #define start_thread31(regs, new_psw, new_stackp) do { \ | 127 | #define start_thread31(regs, new_psw, new_stackp) do { \ |
128 | regs->psw.mask = psw_user32_bits; \ | 128 | regs->psw.mask = psw_user_bits | PSW_MASK_BA; \ |
129 | regs->psw.addr = new_psw | PSW_ADDR_AMODE; \ | 129 | regs->psw.addr = new_psw | PSW_ADDR_AMODE; \ |
130 | regs->gprs[15] = new_stackp; \ | 130 | regs->gprs[15] = new_stackp; \ |
131 | crst_table_downgrade(current->mm, 1UL << 31); \ | 131 | crst_table_downgrade(current->mm, 1UL << 31); \ |
132 | } while (0) | 132 | } while (0) |
133 | 133 | ||
134 | /* Forward declaration, a strange C thing */ | 134 | /* Forward declaration, a strange C thing */ |
@@ -234,24 +234,14 @@ static inline unsigned long __rewind_psw(psw_t psw, unsigned long ilc) | |||
234 | } | 234 | } |
235 | 235 | ||
236 | /* | 236 | /* |
237 | * Function to stop a processor until an interruption occurred | ||
238 | */ | ||
239 | static inline void enabled_wait(void) | ||
240 | { | ||
241 | __load_psw_mask(PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT | | ||
242 | PSW_MASK_MCHECK | PSW_MASK_WAIT | PSW_DEFAULT_KEY); | ||
243 | } | ||
244 | |||
245 | /* | ||
246 | * Function to drop a processor into disabled wait state | 237 | * Function to drop a processor into disabled wait state |
247 | */ | 238 | */ |
248 | |||
249 | static inline void ATTRIB_NORET disabled_wait(unsigned long code) | 239 | static inline void ATTRIB_NORET disabled_wait(unsigned long code) |
250 | { | 240 | { |
251 | unsigned long ctl_buf; | 241 | unsigned long ctl_buf; |
252 | psw_t dw_psw; | 242 | psw_t dw_psw; |
253 | 243 | ||
254 | dw_psw.mask = PSW_BASE_BITS | PSW_MASK_WAIT; | 244 | dw_psw.mask = PSW_MASK_BASE | PSW_MASK_WAIT | PSW_MASK_BA | PSW_MASK_EA; |
255 | dw_psw.addr = code; | 245 | dw_psw.addr = code; |
256 | /* | 246 | /* |
257 | * Store status and then load disabled wait psw, | 247 | * Store status and then load disabled wait psw, |
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h index 2904cc66967a..6fc00d268143 100644 --- a/arch/s390/include/asm/ptrace.h +++ b/arch/s390/include/asm/ptrace.h | |||
@@ -230,6 +230,7 @@ typedef struct | |||
230 | #define PSW_MASK_IO 0x02000000UL | 230 | #define PSW_MASK_IO 0x02000000UL |
231 | #define PSW_MASK_EXT 0x01000000UL | 231 | #define PSW_MASK_EXT 0x01000000UL |
232 | #define PSW_MASK_KEY 0x00F00000UL | 232 | #define PSW_MASK_KEY 0x00F00000UL |
233 | #define PSW_MASK_BASE 0x00080000UL /* always one */ | ||
233 | #define PSW_MASK_MCHECK 0x00040000UL | 234 | #define PSW_MASK_MCHECK 0x00040000UL |
234 | #define PSW_MASK_WAIT 0x00020000UL | 235 | #define PSW_MASK_WAIT 0x00020000UL |
235 | #define PSW_MASK_PSTATE 0x00010000UL | 236 | #define PSW_MASK_PSTATE 0x00010000UL |
@@ -239,10 +240,11 @@ typedef struct | |||
239 | #define PSW_MASK_EA 0x00000000UL | 240 | #define PSW_MASK_EA 0x00000000UL |
240 | #define PSW_MASK_BA 0x00000000UL | 241 | #define PSW_MASK_BA 0x00000000UL |
241 | 242 | ||
243 | #define PSW_MASK_USER 0x00003F00UL | ||
244 | |||
242 | #define PSW_ADDR_AMODE 0x80000000UL | 245 | #define PSW_ADDR_AMODE 0x80000000UL |
243 | #define PSW_ADDR_INSN 0x7FFFFFFFUL | 246 | #define PSW_ADDR_INSN 0x7FFFFFFFUL |
244 | 247 | ||
245 | #define PSW_BASE_BITS 0x00080000UL | ||
246 | #define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 20) | 248 | #define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 20) |
247 | 249 | ||
248 | #define PSW_ASC_PRIMARY 0x00000000UL | 250 | #define PSW_ASC_PRIMARY 0x00000000UL |
@@ -256,6 +258,7 @@ typedef struct | |||
256 | #define PSW_MASK_DAT 0x0400000000000000UL | 258 | #define PSW_MASK_DAT 0x0400000000000000UL |
257 | #define PSW_MASK_IO 0x0200000000000000UL | 259 | #define PSW_MASK_IO 0x0200000000000000UL |
258 | #define PSW_MASK_EXT 0x0100000000000000UL | 260 | #define PSW_MASK_EXT 0x0100000000000000UL |
261 | #define PSW_MASK_BASE 0x0000000000000000UL | ||
259 | #define PSW_MASK_KEY 0x00F0000000000000UL | 262 | #define PSW_MASK_KEY 0x00F0000000000000UL |
260 | #define PSW_MASK_MCHECK 0x0004000000000000UL | 263 | #define PSW_MASK_MCHECK 0x0004000000000000UL |
261 | #define PSW_MASK_WAIT 0x0002000000000000UL | 264 | #define PSW_MASK_WAIT 0x0002000000000000UL |
@@ -266,11 +269,11 @@ typedef struct | |||
266 | #define PSW_MASK_EA 0x0000000100000000UL | 269 | #define PSW_MASK_EA 0x0000000100000000UL |
267 | #define PSW_MASK_BA 0x0000000080000000UL | 270 | #define PSW_MASK_BA 0x0000000080000000UL |
268 | 271 | ||
272 | #define PSW_MASK_USER 0x00003F0000000000UL | ||
273 | |||
269 | #define PSW_ADDR_AMODE 0x0000000000000000UL | 274 | #define PSW_ADDR_AMODE 0x0000000000000000UL |
270 | #define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL | 275 | #define PSW_ADDR_INSN 0xFFFFFFFFFFFFFFFFUL |
271 | 276 | ||
272 | #define PSW_BASE_BITS 0x0000000180000000UL | ||
273 | #define PSW_BASE32_BITS 0x0000000080000000UL | ||
274 | #define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 52) | 277 | #define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 52) |
275 | 278 | ||
276 | #define PSW_ASC_PRIMARY 0x0000000000000000UL | 279 | #define PSW_ASC_PRIMARY 0x0000000000000000UL |
@@ -283,18 +286,7 @@ typedef struct | |||
283 | #ifdef __KERNEL__ | 286 | #ifdef __KERNEL__ |
284 | extern long psw_kernel_bits; | 287 | extern long psw_kernel_bits; |
285 | extern long psw_user_bits; | 288 | extern long psw_user_bits; |
286 | #ifdef CONFIG_64BIT | ||
287 | extern long psw_user32_bits; | ||
288 | #endif | 289 | #endif |
289 | #endif | ||
290 | |||
291 | /* This macro merges a NEW PSW mask specified by the user into | ||
292 | the currently active PSW mask CURRENT, modifying only those | ||
293 | bits in CURRENT that the user may be allowed to change: this | ||
294 | is the condition code and the program mask bits. */ | ||
295 | #define PSW_MASK_MERGE(CURRENT,NEW) \ | ||
296 | (((CURRENT) & ~(PSW_MASK_CC|PSW_MASK_PM)) | \ | ||
297 | ((NEW) & (PSW_MASK_CC|PSW_MASK_PM))) | ||
298 | 290 | ||
299 | /* | 291 | /* |
300 | * The s390_regs structure is used to define the elf_gregset_t. | 292 | * The s390_regs structure is used to define the elf_gregset_t. |
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h index afb849e4bf4b..d73cc6b60000 100644 --- a/arch/s390/include/asm/system.h +++ b/arch/s390/include/asm/system.h | |||
@@ -212,8 +212,10 @@ __set_psw_mask(unsigned long mask) | |||
212 | __load_psw_mask(mask | (arch_local_save_flags() & ~(-1UL >> 8))); | 212 | __load_psw_mask(mask | (arch_local_save_flags() & ~(-1UL >> 8))); |
213 | } | 213 | } |
214 | 214 | ||
215 | #define local_mcck_enable() __set_psw_mask(psw_kernel_bits) | 215 | #define local_mcck_enable() \ |
216 | #define local_mcck_disable() __set_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK) | 216 | __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_MCHECK) |
217 | #define local_mcck_disable() \ | ||
218 | __set_psw_mask(psw_kernel_bits | PSW_MASK_DAT) | ||
217 | 219 | ||
218 | #ifdef CONFIG_SMP | 220 | #ifdef CONFIG_SMP |
219 | 221 | ||
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index 53acaa86dd94..24b218737b9b 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -60,12 +60,9 @@ | |||
60 | 60 | ||
61 | #include "compat_linux.h" | 61 | #include "compat_linux.h" |
62 | 62 | ||
63 | long psw_user32_bits = (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME | | 63 | u32 psw32_user_bits = PSW32_MASK_DAT | PSW32_MASK_IO | PSW32_MASK_EXT | |
64 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | | 64 | PSW32_DEFAULT_KEY | PSW32_MASK_BASE | PSW32_MASK_MCHECK | |
65 | PSW_MASK_PSTATE | PSW_DEFAULT_KEY); | 65 | PSW32_MASK_PSTATE | PSW32_ASC_HOME; |
66 | long psw32_user_bits = (PSW32_BASE_BITS | PSW32_MASK_DAT | PSW32_ASC_HOME | | ||
67 | PSW32_MASK_IO | PSW32_MASK_EXT | PSW32_MASK_MCHECK | | ||
68 | PSW32_MASK_PSTATE); | ||
69 | 66 | ||
70 | /* For this source file, we want overflow handling. */ | 67 | /* For this source file, we want overflow handling. */ |
71 | 68 | ||
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index 72a1c8d8d212..fd83b69207f5 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
@@ -300,9 +300,9 @@ static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs) | |||
300 | _s390_regs_common32 regs32; | 300 | _s390_regs_common32 regs32; |
301 | int err, i; | 301 | int err, i; |
302 | 302 | ||
303 | regs32.psw.mask = PSW32_MASK_MERGE(psw32_user_bits, | 303 | regs32.psw.mask = psw32_user_bits | |
304 | (__u32)(regs->psw.mask >> 32)); | 304 | ((__u32)(regs->psw.mask >> 32) & PSW32_MASK_USER); |
305 | regs32.psw.addr = PSW32_ADDR_AMODE31 | (__u32) regs->psw.addr; | 305 | regs32.psw.addr = PSW32_ADDR_AMODE | (__u32) regs->psw.addr; |
306 | for (i = 0; i < NUM_GPRS; i++) | 306 | for (i = 0; i < NUM_GPRS; i++) |
307 | regs32.gprs[i] = (__u32) regs->gprs[i]; | 307 | regs32.gprs[i] = (__u32) regs->gprs[i]; |
308 | save_access_regs(current->thread.acrs); | 308 | save_access_regs(current->thread.acrs); |
@@ -327,8 +327,8 @@ static int restore_sigregs32(struct pt_regs *regs,_sigregs32 __user *sregs) | |||
327 | err = __copy_from_user(®s32, &sregs->regs, sizeof(regs32)); | 327 | err = __copy_from_user(®s32, &sregs->regs, sizeof(regs32)); |
328 | if (err) | 328 | if (err) |
329 | return err; | 329 | return err; |
330 | regs->psw.mask = PSW_MASK_MERGE(regs->psw.mask, | 330 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | |
331 | (__u64)regs32.psw.mask << 32); | 331 | (__u64)(regs32.psw.mask & PSW32_MASK_USER) << 32; |
332 | regs->psw.addr = (__u64)(regs32.psw.addr & PSW32_ADDR_INSN); | 332 | regs->psw.addr = (__u64)(regs32.psw.addr & PSW32_ADDR_INSN); |
333 | for (i = 0; i < NUM_GPRS; i++) | 333 | for (i = 0; i < NUM_GPRS; i++) |
334 | regs->gprs[i] = (__u64) regs32.gprs[i]; | 334 | regs->gprs[i] = (__u64) regs32.gprs[i]; |
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index f297456dba7a..37394b3413e2 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -252,7 +252,7 @@ static noinline __init void setup_lowcore_early(void) | |||
252 | { | 252 | { |
253 | psw_t psw; | 253 | psw_t psw; |
254 | 254 | ||
255 | psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; | 255 | psw.mask = PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA; |
256 | psw.addr = PSW_ADDR_AMODE | (unsigned long) s390_base_ext_handler; | 256 | psw.addr = PSW_ADDR_AMODE | (unsigned long) s390_base_ext_handler; |
257 | S390_lowcore.external_new_psw = psw; | 257 | S390_lowcore.external_new_psw = psw; |
258 | psw.addr = PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler; | 258 | psw.addr = PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler; |
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index ca0520c52547..296458360a32 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -2033,12 +2033,12 @@ void s390_reset_system(void (*func)(void *), void *data) | |||
2033 | __ctl_clear_bit(0,28); | 2033 | __ctl_clear_bit(0,28); |
2034 | 2034 | ||
2035 | /* Set new machine check handler */ | 2035 | /* Set new machine check handler */ |
2036 | S390_lowcore.mcck_new_psw.mask = psw_kernel_bits & ~PSW_MASK_MCHECK; | 2036 | S390_lowcore.mcck_new_psw.mask = psw_kernel_bits | PSW_MASK_DAT; |
2037 | S390_lowcore.mcck_new_psw.addr = | 2037 | S390_lowcore.mcck_new_psw.addr = |
2038 | PSW_ADDR_AMODE | (unsigned long) s390_base_mcck_handler; | 2038 | PSW_ADDR_AMODE | (unsigned long) s390_base_mcck_handler; |
2039 | 2039 | ||
2040 | /* Set new program check handler */ | 2040 | /* Set new program check handler */ |
2041 | S390_lowcore.program_new_psw.mask = psw_kernel_bits & ~PSW_MASK_MCHECK; | 2041 | S390_lowcore.program_new_psw.mask = psw_kernel_bits | PSW_MASK_DAT; |
2042 | S390_lowcore.program_new_psw.addr = | 2042 | S390_lowcore.program_new_psw.addr = |
2043 | PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler; | 2043 | PSW_ADDR_AMODE | (unsigned long) s390_base_pgm_handler; |
2044 | 2044 | ||
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c index 13a0b528c70b..3cd0f25ab015 100644 --- a/arch/s390/kernel/machine_kexec.c +++ b/arch/s390/kernel/machine_kexec.c | |||
@@ -108,7 +108,7 @@ static void __do_machine_kdump(void *image) | |||
108 | #ifdef CONFIG_CRASH_DUMP | 108 | #ifdef CONFIG_CRASH_DUMP |
109 | int (*start_kdump)(int) = (void *)((struct kimage *) image)->start; | 109 | int (*start_kdump)(int) = (void *)((struct kimage *) image)->start; |
110 | 110 | ||
111 | __load_psw_mask(PSW_BASE_BITS | PSW_DEFAULT_KEY); | 111 | __load_psw_mask(PSW_MASK_BASE | PSW_DEFAULT_KEY | PSW_MASK_EA | PSW_MASK_BA); |
112 | setup_regs(); | 112 | setup_regs(); |
113 | start_kdump(1); | 113 | start_kdump(1); |
114 | #endif | 114 | #endif |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 541a7509faeb..5e64a9a29ea4 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -117,7 +117,8 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
117 | struct pt_regs regs; | 117 | struct pt_regs regs; |
118 | 118 | ||
119 | memset(®s, 0, sizeof(regs)); | 119 | memset(®s, 0, sizeof(regs)); |
120 | regs.psw.mask = psw_kernel_bits | PSW_MASK_IO | PSW_MASK_EXT; | 120 | regs.psw.mask = psw_kernel_bits | |
121 | PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK; | ||
121 | regs.psw.addr = (unsigned long) kernel_thread_starter | PSW_ADDR_AMODE; | 122 | regs.psw.addr = (unsigned long) kernel_thread_starter | PSW_ADDR_AMODE; |
122 | regs.gprs[9] = (unsigned long) fn; | 123 | regs.gprs[9] = (unsigned long) fn; |
123 | regs.gprs[10] = (unsigned long) arg; | 124 | regs.gprs[10] = (unsigned long) arg; |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 3519c99ae0c0..41e20763886e 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -169,8 +169,9 @@ static unsigned long __peek_user(struct task_struct *child, addr_t addr) | |||
169 | */ | 169 | */ |
170 | tmp = *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr); | 170 | tmp = *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr); |
171 | if (addr == (addr_t) &dummy->regs.psw.mask) | 171 | if (addr == (addr_t) &dummy->regs.psw.mask) |
172 | /* Remove per bit from user psw. */ | 172 | /* Return a clean psw mask. */ |
173 | tmp &= ~PSW_MASK_PER; | 173 | tmp = psw_user_bits | (tmp & PSW_MASK_USER) | |
174 | PSW_MASK_EA | PSW_MASK_BA; | ||
174 | 175 | ||
175 | } else if (addr < (addr_t) &dummy->regs.orig_gpr2) { | 176 | } else if (addr < (addr_t) &dummy->regs.orig_gpr2) { |
176 | /* | 177 | /* |
@@ -285,17 +286,18 @@ static inline void __poke_user_per(struct task_struct *child, | |||
285 | static int __poke_user(struct task_struct *child, addr_t addr, addr_t data) | 286 | static int __poke_user(struct task_struct *child, addr_t addr, addr_t data) |
286 | { | 287 | { |
287 | struct user *dummy = NULL; | 288 | struct user *dummy = NULL; |
288 | addr_t offset; | 289 | addr_t offset, tmp; |
289 | 290 | ||
290 | if (addr < (addr_t) &dummy->regs.acrs) { | 291 | if (addr < (addr_t) &dummy->regs.acrs) { |
291 | /* | 292 | /* |
292 | * psw and gprs are stored on the stack | 293 | * psw and gprs are stored on the stack |
293 | */ | 294 | */ |
295 | tmp = (data & ~PSW_MASK_USER) ^ psw_user_bits; | ||
294 | if (addr == (addr_t) &dummy->regs.psw.mask && | 296 | if (addr == (addr_t) &dummy->regs.psw.mask && |
295 | #ifdef CONFIG_COMPAT | 297 | #ifdef CONFIG_COMPAT |
296 | data != PSW_MASK_MERGE(psw_user32_bits, data) && | 298 | tmp != PSW_MASK_BA && |
297 | #endif | 299 | #endif |
298 | data != PSW_MASK_MERGE(psw_user_bits, data)) | 300 | tmp != (PSW_MASK_EA | PSW_MASK_BA)) |
299 | /* Invalid psw mask. */ | 301 | /* Invalid psw mask. */ |
300 | return -EINVAL; | 302 | return -EINVAL; |
301 | #ifndef CONFIG_64BIT | 303 | #ifndef CONFIG_64BIT |
@@ -505,21 +507,20 @@ static u32 __peek_user_compat(struct task_struct *child, addr_t addr) | |||
505 | __u32 tmp; | 507 | __u32 tmp; |
506 | 508 | ||
507 | if (addr < (addr_t) &dummy32->regs.acrs) { | 509 | if (addr < (addr_t) &dummy32->regs.acrs) { |
510 | struct pt_regs *regs = task_pt_regs(child); | ||
508 | /* | 511 | /* |
509 | * psw and gprs are stored on the stack | 512 | * psw and gprs are stored on the stack |
510 | */ | 513 | */ |
511 | if (addr == (addr_t) &dummy32->regs.psw.mask) { | 514 | if (addr == (addr_t) &dummy32->regs.psw.mask) { |
512 | /* Fake a 31 bit psw mask. */ | 515 | /* Fake a 31 bit psw mask. */ |
513 | tmp = (__u32)(task_pt_regs(child)->psw.mask >> 32); | 516 | tmp = (__u32)(regs->psw.mask >> 32); |
514 | tmp = PSW32_MASK_MERGE(psw32_user_bits, tmp); | 517 | tmp = psw32_user_bits | (tmp & PSW32_MASK_USER); |
515 | } else if (addr == (addr_t) &dummy32->regs.psw.addr) { | 518 | } else if (addr == (addr_t) &dummy32->regs.psw.addr) { |
516 | /* Fake a 31 bit psw address. */ | 519 | /* Fake a 31 bit psw address. */ |
517 | tmp = (__u32) task_pt_regs(child)->psw.addr | | 520 | tmp = (__u32) regs->psw.addr | PSW32_ADDR_AMODE; |
518 | PSW32_ADDR_AMODE31; | ||
519 | } else { | 521 | } else { |
520 | /* gpr 0-15 */ | 522 | /* gpr 0-15 */ |
521 | tmp = *(__u32 *)((addr_t) &task_pt_regs(child)->psw + | 523 | tmp = *(__u32 *)((addr_t) ®s->psw + addr*2 + 4); |
522 | addr*2 + 4); | ||
523 | } | 524 | } |
524 | } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) { | 525 | } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) { |
525 | /* | 526 | /* |
@@ -604,20 +605,20 @@ static int __poke_user_compat(struct task_struct *child, | |||
604 | addr_t offset; | 605 | addr_t offset; |
605 | 606 | ||
606 | if (addr < (addr_t) &dummy32->regs.acrs) { | 607 | if (addr < (addr_t) &dummy32->regs.acrs) { |
608 | struct pt_regs *regs = task_pt_regs(child); | ||
607 | /* | 609 | /* |
608 | * psw, gprs, acrs and orig_gpr2 are stored on the stack | 610 | * psw, gprs, acrs and orig_gpr2 are stored on the stack |
609 | */ | 611 | */ |
610 | if (addr == (addr_t) &dummy32->regs.psw.mask) { | 612 | if (addr == (addr_t) &dummy32->regs.psw.mask) { |
611 | /* Build a 64 bit psw mask from 31 bit mask. */ | 613 | /* Build a 64 bit psw mask from 31 bit mask. */ |
612 | if (tmp != PSW32_MASK_MERGE(psw32_user_bits, tmp)) | 614 | if ((tmp & ~PSW32_MASK_USER) != psw32_user_bits) |
613 | /* Invalid psw mask. */ | 615 | /* Invalid psw mask. */ |
614 | return -EINVAL; | 616 | return -EINVAL; |
615 | task_pt_regs(child)->psw.mask = | 617 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | |
616 | PSW_MASK_MERGE(psw_user32_bits, (__u64) tmp << 32); | 618 | (__u64)(tmp & PSW32_MASK_USER) << 32; |
617 | } else if (addr == (addr_t) &dummy32->regs.psw.addr) { | 619 | } else if (addr == (addr_t) &dummy32->regs.psw.addr) { |
618 | /* Build a 64 bit psw address from 31 bit address. */ | 620 | /* Build a 64 bit psw address from 31 bit address. */ |
619 | task_pt_regs(child)->psw.addr = | 621 | regs->psw.addr = (__u64) tmp & PSW32_ADDR_INSN; |
620 | (__u64) tmp & PSW32_ADDR_INSN; | ||
621 | /* | 622 | /* |
622 | * The debugger changed the instruction address, | 623 | * The debugger changed the instruction address, |
623 | * reset system call restart, see signal.c:do_signal | 624 | * reset system call restart, see signal.c:do_signal |
@@ -625,8 +626,7 @@ static int __poke_user_compat(struct task_struct *child, | |||
625 | task_thread_info(child)->system_call = 0; | 626 | task_thread_info(child)->system_call = 0; |
626 | } else { | 627 | } else { |
627 | /* gpr 0-15 */ | 628 | /* gpr 0-15 */ |
628 | *(__u32*)((addr_t) &task_pt_regs(child)->psw | 629 | *(__u32*)((addr_t) ®s->psw + addr*2 + 4) = tmp; |
629 | + addr*2 + 4) = tmp; | ||
630 | } | 630 | } |
631 | } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) { | 631 | } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) { |
632 | /* | 632 | /* |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 6f8e3777a0c8..8ac6bfa2786c 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -62,11 +62,11 @@ | |||
62 | #include <asm/kvm_virtio.h> | 62 | #include <asm/kvm_virtio.h> |
63 | #include <asm/diag.h> | 63 | #include <asm/diag.h> |
64 | 64 | ||
65 | long psw_kernel_bits = (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | | 65 | long psw_kernel_bits = PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_ASC_PRIMARY | |
66 | PSW_MASK_MCHECK | PSW_DEFAULT_KEY); | 66 | PSW_MASK_EA | PSW_MASK_BA; |
67 | long psw_user_bits = (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | | 67 | long psw_user_bits = PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT | |
68 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | | 68 | PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_MCHECK | |
69 | PSW_MASK_PSTATE | PSW_DEFAULT_KEY); | 69 | PSW_MASK_PSTATE | PSW_ASC_HOME; |
70 | 70 | ||
71 | /* | 71 | /* |
72 | * User copy operations. | 72 | * User copy operations. |
@@ -278,22 +278,14 @@ early_param("mem", early_parse_mem); | |||
278 | unsigned int user_mode = HOME_SPACE_MODE; | 278 | unsigned int user_mode = HOME_SPACE_MODE; |
279 | EXPORT_SYMBOL_GPL(user_mode); | 279 | EXPORT_SYMBOL_GPL(user_mode); |
280 | 280 | ||
281 | static int set_amode_and_uaccess(unsigned long user_amode, | 281 | static int set_amode_primary(void) |
282 | unsigned long user32_amode) | ||
283 | { | 282 | { |
284 | psw_user_bits = PSW_BASE_BITS | PSW_MASK_DAT | user_amode | | 283 | psw_kernel_bits = (psw_kernel_bits & ~PSW_MASK_ASC) | PSW_ASC_HOME; |
285 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | | 284 | psw_user_bits = (psw_user_bits & ~PSW_MASK_ASC) | PSW_ASC_PRIMARY; |
286 | PSW_MASK_PSTATE | PSW_DEFAULT_KEY; | ||
287 | #ifdef CONFIG_COMPAT | 285 | #ifdef CONFIG_COMPAT |
288 | psw_user32_bits = PSW_BASE32_BITS | PSW_MASK_DAT | user_amode | | 286 | psw32_user_bits = |
289 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | | 287 | (psw32_user_bits & ~PSW32_MASK_ASC) | PSW32_ASC_PRIMARY; |
290 | PSW_MASK_PSTATE | PSW_DEFAULT_KEY; | ||
291 | psw32_user_bits = PSW32_BASE_BITS | PSW32_MASK_DAT | user32_amode | | ||
292 | PSW32_MASK_IO | PSW32_MASK_EXT | PSW32_MASK_MCHECK | | ||
293 | PSW32_MASK_PSTATE; | ||
294 | #endif | 288 | #endif |
295 | psw_kernel_bits = PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | | ||
296 | PSW_MASK_MCHECK | PSW_DEFAULT_KEY; | ||
297 | 289 | ||
298 | if (MACHINE_HAS_MVCOS) { | 290 | if (MACHINE_HAS_MVCOS) { |
299 | memcpy(&uaccess, &uaccess_mvcos_switch, sizeof(uaccess)); | 291 | memcpy(&uaccess, &uaccess_mvcos_switch, sizeof(uaccess)); |
@@ -329,7 +321,7 @@ early_param("user_mode", early_parse_user_mode); | |||
329 | static void setup_addressing_mode(void) | 321 | static void setup_addressing_mode(void) |
330 | { | 322 | { |
331 | if (user_mode == PRIMARY_SPACE_MODE) { | 323 | if (user_mode == PRIMARY_SPACE_MODE) { |
332 | if (set_amode_and_uaccess(PSW_ASC_PRIMARY, PSW32_ASC_PRIMARY)) | 324 | if (set_amode_primary()) |
333 | pr_info("Address spaces switched, " | 325 | pr_info("Address spaces switched, " |
334 | "mvcos available\n"); | 326 | "mvcos available\n"); |
335 | else | 327 | else |
@@ -348,24 +340,25 @@ setup_lowcore(void) | |||
348 | */ | 340 | */ |
349 | BUILD_BUG_ON(sizeof(struct _lowcore) != LC_PAGES * 4096); | 341 | BUILD_BUG_ON(sizeof(struct _lowcore) != LC_PAGES * 4096); |
350 | lc = __alloc_bootmem_low(LC_PAGES * PAGE_SIZE, LC_PAGES * PAGE_SIZE, 0); | 342 | lc = __alloc_bootmem_low(LC_PAGES * PAGE_SIZE, LC_PAGES * PAGE_SIZE, 0); |
351 | lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; | 343 | lc->restart_psw.mask = psw_kernel_bits; |
352 | lc->restart_psw.addr = | 344 | lc->restart_psw.addr = |
353 | PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler; | 345 | PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler; |
354 | if (user_mode != HOME_SPACE_MODE) | 346 | lc->external_new_psw.mask = psw_kernel_bits | |
355 | lc->restart_psw.mask |= PSW_ASC_HOME; | 347 | PSW_MASK_DAT | PSW_MASK_MCHECK; |
356 | lc->external_new_psw.mask = psw_kernel_bits; | ||
357 | lc->external_new_psw.addr = | 348 | lc->external_new_psw.addr = |
358 | PSW_ADDR_AMODE | (unsigned long) ext_int_handler; | 349 | PSW_ADDR_AMODE | (unsigned long) ext_int_handler; |
359 | lc->svc_new_psw.mask = psw_kernel_bits | PSW_MASK_IO | PSW_MASK_EXT; | 350 | lc->svc_new_psw.mask = psw_kernel_bits | |
351 | PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK; | ||
360 | lc->svc_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) system_call; | 352 | lc->svc_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) system_call; |
361 | lc->program_new_psw.mask = psw_kernel_bits; | 353 | lc->program_new_psw.mask = psw_kernel_bits | |
354 | PSW_MASK_DAT | PSW_MASK_MCHECK; | ||
362 | lc->program_new_psw.addr = | 355 | lc->program_new_psw.addr = |
363 | PSW_ADDR_AMODE | (unsigned long)pgm_check_handler; | 356 | PSW_ADDR_AMODE | (unsigned long) pgm_check_handler; |
364 | lc->mcck_new_psw.mask = | 357 | lc->mcck_new_psw.mask = psw_kernel_bits; |
365 | psw_kernel_bits & ~PSW_MASK_MCHECK & ~PSW_MASK_DAT; | ||
366 | lc->mcck_new_psw.addr = | 358 | lc->mcck_new_psw.addr = |
367 | PSW_ADDR_AMODE | (unsigned long) mcck_int_handler; | 359 | PSW_ADDR_AMODE | (unsigned long) mcck_int_handler; |
368 | lc->io_new_psw.mask = psw_kernel_bits; | 360 | lc->io_new_psw.mask = psw_kernel_bits | |
361 | PSW_MASK_DAT | PSW_MASK_MCHECK; | ||
369 | lc->io_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) io_int_handler; | 362 | lc->io_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) io_int_handler; |
370 | lc->clock_comparator = -1ULL; | 363 | lc->clock_comparator = -1ULL; |
371 | lc->kernel_stack = ((unsigned long) &init_thread_union) + THREAD_SIZE; | 364 | lc->kernel_stack = ((unsigned long) &init_thread_union) + THREAD_SIZE; |
@@ -554,7 +547,7 @@ static void __init setup_restart_psw(void) | |||
554 | * Setup restart PSW for absolute zero lowcore. This is necesary | 547 | * Setup restart PSW for absolute zero lowcore. This is necesary |
555 | * if PSW restart is done on an offline CPU that has lowcore zero | 548 | * if PSW restart is done on an offline CPU that has lowcore zero |
556 | */ | 549 | */ |
557 | psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; | 550 | psw.mask = PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_EA | PSW_MASK_BA; |
558 | psw.addr = PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler; | 551 | psw.addr = PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler; |
559 | copy_to_absolute_zero(&S390_lowcore.restart_psw, &psw, sizeof(psw)); | 552 | copy_to_absolute_zero(&S390_lowcore.restart_psw, &psw, sizeof(psw)); |
560 | } | 553 | } |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 0e905cb7604a..c19755815e53 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -117,7 +117,8 @@ static int save_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | |||
117 | 117 | ||
118 | /* Copy a 'clean' PSW mask to the user to avoid leaking | 118 | /* Copy a 'clean' PSW mask to the user to avoid leaking |
119 | information about whether PER is currently on. */ | 119 | information about whether PER is currently on. */ |
120 | user_sregs.regs.psw.mask = PSW_MASK_MERGE(psw_user_bits, regs->psw.mask); | 120 | user_sregs.regs.psw.mask = psw_user_bits | PSW_MASK_EA | PSW_MASK_BA | |
121 | (regs->psw.mask & PSW_MASK_USER); | ||
121 | user_sregs.regs.psw.addr = regs->psw.addr; | 122 | user_sregs.regs.psw.addr = regs->psw.addr; |
122 | memcpy(&user_sregs.regs.gprs, ®s->gprs, sizeof(sregs->regs.gprs)); | 123 | memcpy(&user_sregs.regs.gprs, ®s->gprs, sizeof(sregs->regs.gprs)); |
123 | memcpy(&user_sregs.regs.acrs, current->thread.acrs, | 124 | memcpy(&user_sregs.regs.acrs, current->thread.acrs, |
@@ -144,8 +145,8 @@ static int restore_sigregs(struct pt_regs *regs, _sigregs __user *sregs) | |||
144 | err = __copy_from_user(&user_sregs, sregs, sizeof(_sigregs)); | 145 | err = __copy_from_user(&user_sregs, sregs, sizeof(_sigregs)); |
145 | if (err) | 146 | if (err) |
146 | return err; | 147 | return err; |
147 | regs->psw.mask = PSW_MASK_MERGE(regs->psw.mask, | 148 | regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) | |
148 | user_sregs.regs.psw.mask); | 149 | (user_sregs.regs.psw.mask & PSW_MASK_USER); |
149 | regs->psw.addr = PSW_ADDR_AMODE | user_sregs.regs.psw.addr; | 150 | regs->psw.addr = PSW_ADDR_AMODE | user_sregs.regs.psw.addr; |
150 | memcpy(®s->gprs, &user_sregs.regs.gprs, sizeof(sregs->regs.gprs)); | 151 | memcpy(®s->gprs, &user_sregs.regs.gprs, sizeof(sregs->regs.gprs)); |
151 | memcpy(¤t->thread.acrs, &user_sregs.regs.acrs, | 152 | memcpy(¤t->thread.acrs, &user_sregs.regs.acrs, |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index e3f51dfa5cad..6c8a977af595 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -108,7 +108,7 @@ void smp_restart_with_online_cpu(void) | |||
108 | for_each_online_cpu(cpu) { | 108 | for_each_online_cpu(cpu) { |
109 | if (stap() == __cpu_logical_map[cpu]) { | 109 | if (stap() == __cpu_logical_map[cpu]) { |
110 | /* We are online: Enable DAT again and return */ | 110 | /* We are online: Enable DAT again and return */ |
111 | __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK); | 111 | __load_psw_mask(psw_kernel_bits | PSW_MASK_DAT); |
112 | return; | 112 | return; |
113 | } | 113 | } |
114 | } | 114 | } |
@@ -130,14 +130,16 @@ void smp_switch_to_ipl_cpu(void (*func)(void *), void *data) | |||
130 | 130 | ||
131 | if (smp_processor_id() == 0) | 131 | if (smp_processor_id() == 0) |
132 | func(data); | 132 | func(data); |
133 | __load_psw_mask(PSW_BASE_BITS | PSW_DEFAULT_KEY); | 133 | __load_psw_mask(PSW_DEFAULT_KEY | PSW_MASK_BASE | |
134 | PSW_MASK_EA | PSW_MASK_BA); | ||
134 | /* Disable lowcore protection */ | 135 | /* Disable lowcore protection */ |
135 | __ctl_clear_bit(0, 28); | 136 | __ctl_clear_bit(0, 28); |
136 | current_lc = lowcore_ptr[smp_processor_id()]; | 137 | current_lc = lowcore_ptr[smp_processor_id()]; |
137 | lc = lowcore_ptr[0]; | 138 | lc = lowcore_ptr[0]; |
138 | if (!lc) | 139 | if (!lc) |
139 | lc = current_lc; | 140 | lc = current_lc; |
140 | lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; | 141 | lc->restart_psw.mask = |
142 | PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_EA | PSW_MASK_BA; | ||
141 | lc->restart_psw.addr = PSW_ADDR_AMODE | (unsigned long) smp_restart_cpu; | 143 | lc->restart_psw.addr = PSW_ADDR_AMODE | (unsigned long) smp_restart_cpu; |
142 | if (!cpu_online(0)) | 144 | if (!cpu_online(0)) |
143 | smp_switch_to_cpu(func, data, 0, stap(), __cpu_logical_map[0]); | 145 | smp_switch_to_cpu(func, data, 0, stap(), __cpu_logical_map[0]); |
@@ -159,7 +161,7 @@ void smp_send_stop(void) | |||
159 | int cpu, rc; | 161 | int cpu, rc; |
160 | 162 | ||
161 | /* Disable all interrupts/machine checks */ | 163 | /* Disable all interrupts/machine checks */ |
162 | __load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK); | 164 | __load_psw_mask(psw_kernel_bits | PSW_MASK_DAT); |
163 | trace_hardirqs_off(); | 165 | trace_hardirqs_off(); |
164 | 166 | ||
165 | /* stop all processors */ | 167 | /* stop all processors */ |
@@ -501,7 +503,8 @@ int __cpuinit start_secondary(void *cpuvoid) | |||
501 | set_cpu_online(smp_processor_id(), true); | 503 | set_cpu_online(smp_processor_id(), true); |
502 | ipi_call_unlock(); | 504 | ipi_call_unlock(); |
503 | __ctl_clear_bit(0, 28); /* Disable lowcore protection */ | 505 | __ctl_clear_bit(0, 28); /* Disable lowcore protection */ |
504 | S390_lowcore.restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; | 506 | S390_lowcore.restart_psw.mask = |
507 | PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_EA | PSW_MASK_BA; | ||
505 | S390_lowcore.restart_psw.addr = | 508 | S390_lowcore.restart_psw.addr = |
506 | PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler; | 509 | PSW_ADDR_AMODE | (unsigned long) psw_restart_int_handler; |
507 | __ctl_set_bit(0, 28); /* Enable lowcore protection */ | 510 | __ctl_set_bit(0, 28); /* Enable lowcore protection */ |
@@ -549,7 +552,8 @@ static int __cpuinit smp_alloc_lowcore(int cpu) | |||
549 | memset((char *)lowcore + 512, 0, sizeof(*lowcore) - 512); | 552 | memset((char *)lowcore + 512, 0, sizeof(*lowcore) - 512); |
550 | lowcore->async_stack = async_stack + ASYNC_SIZE; | 553 | lowcore->async_stack = async_stack + ASYNC_SIZE; |
551 | lowcore->panic_stack = panic_stack + PAGE_SIZE; | 554 | lowcore->panic_stack = panic_stack + PAGE_SIZE; |
552 | lowcore->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; | 555 | lowcore->restart_psw.mask = |
556 | PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_EA | PSW_MASK_BA; | ||
553 | lowcore->restart_psw.addr = | 557 | lowcore->restart_psw.addr = |
554 | PSW_ADDR_AMODE | (unsigned long) restart_int_handler; | 558 | PSW_ADDR_AMODE | (unsigned long) restart_int_handler; |
555 | if (user_mode != HOME_SPACE_MODE) | 559 | if (user_mode != HOME_SPACE_MODE) |
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index ffabcd9d3363..79eee3f27afb 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c | |||
@@ -200,7 +200,7 @@ void show_registers(struct pt_regs *regs) | |||
200 | mask_bits(regs, PSW_MASK_PSTATE), mask_bits(regs, PSW_MASK_ASC), | 200 | mask_bits(regs, PSW_MASK_PSTATE), mask_bits(regs, PSW_MASK_ASC), |
201 | mask_bits(regs, PSW_MASK_CC), mask_bits(regs, PSW_MASK_PM)); | 201 | mask_bits(regs, PSW_MASK_CC), mask_bits(regs, PSW_MASK_PM)); |
202 | #ifdef CONFIG_64BIT | 202 | #ifdef CONFIG_64BIT |
203 | printk(" EA:%x", mask_bits(regs, PSW_BASE_BITS)); | 203 | printk(" EA:%x", mask_bits(regs, PSW_MASK_EA | PSW_MASK_BA)); |
204 | #endif | 204 | #endif |
205 | printk("\n%s GPRS: " FOURLONG, mode, | 205 | printk("\n%s GPRS: " FOURLONG, mode, |
206 | regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]); | 206 | regs->gprs[0], regs->gprs[1], regs->gprs[2], regs->gprs[3]); |
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 2d6228f60cd6..4f3de980b0e5 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
@@ -170,7 +170,8 @@ void __kprobes vtime_stop_cpu(void) | |||
170 | psw_t psw; | 170 | psw_t psw; |
171 | 171 | ||
172 | /* Wait for external, I/O or machine check interrupt. */ | 172 | /* Wait for external, I/O or machine check interrupt. */ |
173 | psw.mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_IO | PSW_MASK_EXT; | 173 | psw.mask = psw_kernel_bits | PSW_MASK_WAIT | |
174 | PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK; | ||
174 | 175 | ||
175 | idle->nohz_delay = 0; | 176 | idle->nohz_delay = 0; |
176 | 177 | ||
@@ -183,7 +184,8 @@ void __kprobes vtime_stop_cpu(void) | |||
183 | * set_cpu_timer(VTIMER_MAX_SLICE); | 184 | * set_cpu_timer(VTIMER_MAX_SLICE); |
184 | * idle->idle_enter = get_clock(); | 185 | * idle->idle_enter = get_clock(); |
185 | * __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | | 186 | * __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | |
186 | * PSW_MASK_IO | PSW_MASK_EXT); | 187 | * PSW_MASK_DAT | PSW_MASK_IO | |
188 | * PSW_MASK_EXT | PSW_MASK_MCHECK); | ||
187 | * The difference is that the inline assembly makes sure that | 189 | * The difference is that the inline assembly makes sure that |
188 | * the last three instruction are stpt, stck and lpsw in that | 190 | * the last three instruction are stpt, stck and lpsw in that |
189 | * order. This is done to increase the precision. | 191 | * order. This is done to increase the precision. |
@@ -216,7 +218,8 @@ void __kprobes vtime_stop_cpu(void) | |||
216 | * vq->idle = get_cpu_timer(); | 218 | * vq->idle = get_cpu_timer(); |
217 | * idle->idle_enter = get_clock(); | 219 | * idle->idle_enter = get_clock(); |
218 | * __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | | 220 | * __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | |
219 | * PSW_MASK_IO | PSW_MASK_EXT); | 221 | * PSW_MASK_DAT | PSW_MASK_IO | |
222 | * PSW_MASK_EXT | PSW_MASK_MCHECK); | ||
220 | * The difference is that the inline assembly makes sure that | 223 | * The difference is that the inline assembly makes sure that |
221 | * the last three instruction are stpt, stck and lpsw in that | 224 | * the last three instruction are stpt, stck and lpsw in that |
222 | * order. This is done to increase the precision. | 225 | * order. This is done to increase the precision. |
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c index a65229d91c92..db92f044024c 100644 --- a/arch/s390/lib/delay.c +++ b/arch/s390/lib/delay.c | |||
@@ -32,7 +32,8 @@ static void __udelay_disabled(unsigned long long usecs) | |||
32 | u64 clock_saved; | 32 | u64 clock_saved; |
33 | u64 end; | 33 | u64 end; |
34 | 34 | ||
35 | mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_EXT; | 35 | mask = psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_WAIT | |
36 | PSW_MASK_EXT | PSW_MASK_MCHECK; | ||
36 | end = get_clock() + (usecs << 12); | 37 | end = get_clock() + (usecs << 12); |
37 | clock_saved = local_tick_disable(); | 38 | clock_saved = local_tick_disable(); |
38 | __ctl_store(cr0_saved, 0, 0); | 39 | __ctl_store(cr0_saved, 0, 0); |
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index a90fd91a9c72..de3af0c053c0 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
@@ -454,7 +454,7 @@ int __handle_fault(unsigned long uaddr, unsigned long pgm_int_code, int write) | |||
454 | struct pt_regs regs; | 454 | struct pt_regs regs; |
455 | int access, fault; | 455 | int access, fault; |
456 | 456 | ||
457 | regs.psw.mask = psw_kernel_bits; | 457 | regs.psw.mask = psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_MCHECK; |
458 | if (!irqs_disabled()) | 458 | if (!irqs_disabled()) |
459 | regs.psw.mask |= PSW_MASK_IO | PSW_MASK_EXT; | 459 | regs.psw.mask |= PSW_MASK_IO | PSW_MASK_EXT; |
460 | regs.psw.addr = (unsigned long) __builtin_return_address(0); | 460 | regs.psw.addr = (unsigned long) __builtin_return_address(0); |