aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-s390
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-s390')
-rw-r--r--include/asm-s390/page.h2
-rw-r--r--include/asm-s390/processor.h2
-rw-r--r--include/asm-s390/ptrace.h16
3 files changed, 16 insertions, 4 deletions
diff --git a/include/asm-s390/page.h b/include/asm-s390/page.h
index 614e2a93c703..2be287b9df88 100644
--- a/include/asm-s390/page.h
+++ b/include/asm-s390/page.h
@@ -16,6 +16,8 @@
16#define PAGE_SHIFT 12 16#define PAGE_SHIFT 12
17#define PAGE_SIZE (1UL << PAGE_SHIFT) 17#define PAGE_SIZE (1UL << PAGE_SHIFT)
18#define PAGE_MASK (~(PAGE_SIZE-1)) 18#define PAGE_MASK (~(PAGE_SIZE-1))
19#define PAGE_DEFAULT_ACC 0
20#define PAGE_DEFAULT_KEY (PAGE_DEFAULT_ACC << 4)
19 21
20#ifdef __KERNEL__ 22#ifdef __KERNEL__
21#ifndef __ASSEMBLY__ 23#ifndef __ASSEMBLY__
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index 88c272ca48bf..fb46e9090b50 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -245,7 +245,7 @@ static inline void enabled_wait(void)
245 psw_t wait_psw; 245 psw_t wait_psw;
246 246
247 wait_psw.mask = PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT | 247 wait_psw.mask = PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT |
248 PSW_MASK_MCHECK | PSW_MASK_WAIT; 248 PSW_MASK_MCHECK | PSW_MASK_WAIT | PSW_DEFAULT_KEY;
249#ifndef __s390x__ 249#ifndef __s390x__
250 asm volatile ( 250 asm volatile (
251 " basr %0,0\n" 251 " basr %0,0\n"
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index 1dc80666e97e..4eff8f2e3bf1 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -185,6 +185,7 @@
185#include <linux/stddef.h> 185#include <linux/stddef.h>
186#include <linux/types.h> 186#include <linux/types.h>
187#include <asm/setup.h> 187#include <asm/setup.h>
188#include <asm/page.h>
188 189
189typedef union 190typedef union
190{ 191{
@@ -235,6 +236,7 @@ typedef struct
235#define PSW_ADDR_INSN 0x7FFFFFFFUL 236#define PSW_ADDR_INSN 0x7FFFFFFFUL
236 237
237#define PSW_BASE_BITS 0x00080000UL 238#define PSW_BASE_BITS 0x00080000UL
239#define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 20)
238 240
239#define PSW_ASC_PRIMARY 0x00000000UL 241#define PSW_ASC_PRIMARY 0x00000000UL
240#define PSW_ASC_ACCREG 0x00004000UL 242#define PSW_ASC_ACCREG 0x00004000UL
@@ -260,6 +262,7 @@ typedef struct
260 262
261#define PSW_BASE_BITS 0x0000000180000000UL 263#define PSW_BASE_BITS 0x0000000180000000UL
262#define PSW_BASE32_BITS 0x0000000080000000UL 264#define PSW_BASE32_BITS 0x0000000080000000UL
265#define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 52)
263 266
264#define PSW_ASC_PRIMARY 0x0000000000000000UL 267#define PSW_ASC_PRIMARY 0x0000000000000000UL
265#define PSW_ASC_ACCREG 0x0000400000000000UL 268#define PSW_ASC_ACCREG 0x0000400000000000UL
@@ -268,14 +271,15 @@ typedef struct
268 271
269#define PSW_USER32_BITS (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ 272#define PSW_USER32_BITS (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \
270 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ 273 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
271 PSW_MASK_PSTATE) 274 PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
272 275
273#endif /* __s390x__ */ 276#endif /* __s390x__ */
274 277
275#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY) 278#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | \
279 PSW_DEFAULT_KEY)
276#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ 280#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \
277 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ 281 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
278 PSW_MASK_PSTATE) 282 PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
279 283
280/* This macro merges a NEW PSW mask specified by the user into 284/* This macro merges a NEW PSW mask specified by the user into
281 the currently active PSW mask CURRENT, modifying only those 285 the currently active PSW mask CURRENT, modifying only those
@@ -470,6 +474,12 @@ struct user_regs_struct
470extern void show_regs(struct pt_regs * regs); 474extern void show_regs(struct pt_regs * regs);
471#endif 475#endif
472 476
477static inline void
478psw_set_key(unsigned int key)
479{
480 asm volatile ( "spka 0(%0)" : : "d" (key) );
481}
482
473#endif /* __ASSEMBLY__ */ 483#endif /* __ASSEMBLY__ */
474 484
475#endif /* _S390_PTRACE_H */ 485#endif /* _S390_PTRACE_H */