diff options
author | Carsten Otte <cotte@de.ibm.com> | 2009-03-26 10:23:57 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-26 10:24:09 -0400 |
commit | 702d9e584feb028ed7e2a6d2b103b8ea57622ff2 (patch) | |
tree | 965f82b6d0d82e8492a97ac5a117ba47c26d1674 /arch/s390/mm | |
parent | 3324e60aafa9aeb1009878d45079b67367a5e2b6 (diff) |
[S390] check addressing mode in s390_enable_sie
The sie instruction requires address spaces to be switched
to run proper. This patch verifies that this is the case
in s390_enable_sie, otherwise the kernel would crash badly
as soon as the process runs into sie.
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r-- | arch/s390/mm/pgtable.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c index 6b6ddc4ea02b..9bf86125f6f3 100644 --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c | |||
@@ -258,6 +258,10 @@ int s390_enable_sie(void) | |||
258 | struct task_struct *tsk = current; | 258 | struct task_struct *tsk = current; |
259 | struct mm_struct *mm, *old_mm; | 259 | struct mm_struct *mm, *old_mm; |
260 | 260 | ||
261 | /* Do we have switched amode? If no, we cannot do sie */ | ||
262 | if (!switch_amode) | ||
263 | return -EINVAL; | ||
264 | |||
261 | /* Do we have pgstes? if yes, we are done */ | 265 | /* Do we have pgstes? if yes, we are done */ |
262 | if (tsk->mm->context.has_pgste) | 266 | if (tsk->mm->context.has_pgste) |
263 | return 0; | 267 | return 0; |