diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-12-07 06:51:43 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2009-12-07 06:51:33 -0500 |
commit | b11b53342773361f3353b285eb6a3fd6074e7997 (patch) | |
tree | b7fda314933b82d39cb8d30c7882ca3044dd0367 /arch/s390/mm | |
parent | 61365e132ef987f7719af5d2e434db4465957637 (diff) |
[S390] Improve address space mode selection.
Introduce user_mode to replace the two variables switch_amode and
s390_noexec. There are three valid combinations of the old values:
1) switch_amode == 0 && s390_noexec == 0
2) switch_amode == 1 && s390_noexec == 0
3) switch_amode == 1 && s390_noexec == 1
They get replaced by
1) user_mode == HOME_SPACE_MODE
2) user_mode == PRIMARY_SPACE_MODE
3) user_mode == SECONDARY_SPACE_MODE
The new kernel parameter user_mode=[primary,secondary,home] lets
you choose the address space mode the user space processes should
use. In addition the CONFIG_S390_SWITCH_AMODE config option
is removed.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r-- | arch/s390/mm/fault.c | 4 | ||||
-rw-r--r-- | arch/s390/mm/pgtable.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 3df5b918cfe2..77108e34fc1a 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
@@ -112,7 +112,7 @@ static inline int user_space_fault(unsigned long trans_exc_code) | |||
112 | if (trans_exc_code == 2) | 112 | if (trans_exc_code == 2) |
113 | /* Access via secondary space, set_fs setting decides */ | 113 | /* Access via secondary space, set_fs setting decides */ |
114 | return current->thread.mm_segment.ar4; | 114 | return current->thread.mm_segment.ar4; |
115 | if (!switch_amode) | 115 | if (user_mode == HOME_SPACE_MODE) |
116 | /* User space if the access has been done via home space. */ | 116 | /* User space if the access has been done via home space. */ |
117 | return trans_exc_code == 3; | 117 | return trans_exc_code == 3; |
118 | /* | 118 | /* |
@@ -168,7 +168,7 @@ static void do_no_context(struct pt_regs *regs, unsigned long error_code, | |||
168 | * terminate things with extreme prejudice. | 168 | * terminate things with extreme prejudice. |
169 | */ | 169 | */ |
170 | address = trans_exc_code & __FAIL_ADDR_MASK; | 170 | address = trans_exc_code & __FAIL_ADDR_MASK; |
171 | if (user_space_fault(trans_exc_code) == 0) | 171 | if (!user_space_fault(trans_exc_code)) |
172 | printk(KERN_ALERT "Unable to handle kernel pointer dereference" | 172 | printk(KERN_ALERT "Unable to handle kernel pointer dereference" |
173 | " at virtual kernel address %p\n", (void *)address); | 173 | " at virtual kernel address %p\n", (void *)address); |
174 | else | 174 | else |
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 2757c5616a07..ad621e06ada3 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -269,7 +269,7 @@ int s390_enable_sie(void) | |||
269 | struct mm_struct *mm, *old_mm; | 269 | struct mm_struct *mm, *old_mm; |
270 | 270 | ||
271 | /* Do we have switched amode? If no, we cannot do sie */ | 271 | /* Do we have switched amode? If no, we cannot do sie */ |
272 | if (!switch_amode) | 272 | if (user_mode == HOME_SPACE_MODE) |
273 | return -EINVAL; | 273 | return -EINVAL; |
274 | 274 | ||
275 | /* Do we have pgstes? if yes, we are done */ | 275 | /* Do we have pgstes? if yes, we are done */ |