From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <20090225150831.512686187@de.ibm.com> References: <20090225150622.529143164@de.ibm.com> Date: Wed, 25 Feb 2009 16:06:38 +0100 From: Martin Schwidefsky Subject: [patch/s390 16/46] check addressing mode in s390_enable_sie Content-Disposition: inline; filename=115-kvm-amode-check.diff Sender: linux-kernel-owner@vger.kernel.org List-Archive: List-Post: To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Heiko Carstens , Carsten Otte , Martin Schwidefsky List-ID: From: Carsten Otte 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 Signed-off-by: Martin Schwidefsky --- arch/s390/mm/pgtable.c | 4 ++++ 1 file changed, 4 insertions(+) Index: quilt-2.6/arch/s390/mm/pgtable.c =================================================================== --- quilt-2.6.orig/arch/s390/mm/pgtable.c +++ quilt-2.6/arch/s390/mm/pgtable.c @@ -256,6 +256,10 @@ int s390_enable_sie(void) struct task_struct *tsk = current; 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 */ if (tsk->mm->context.has_pgste) return 0; -- blue skies, Martin. "Reality continues to ruin my life." - Calvin.