Commit 702d9e58 authored by Carsten Otte's avatar Carsten Otte Committed by Martin Schwidefsky

[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: default avatarCarsten Otte <cotte@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 3324e60a
...@@ -258,6 +258,10 @@ int s390_enable_sie(void) ...@@ -258,6 +258,10 @@ int s390_enable_sie(void)
struct task_struct *tsk = current; struct task_struct *tsk = current;
struct mm_struct *mm, *old_mm; struct mm_struct *mm, *old_mm;
/* Do we have switched amode? If no, we cannot do sie */
if (!switch_amode)
return -EINVAL;
/* Do we have pgstes? if yes, we are done */ /* Do we have pgstes? if yes, we are done */
if (tsk->mm->context.has_pgste) if (tsk->mm->context.has_pgste)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment