From patchwork Thu Nov 22 02:34:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sanjay Lal X-Patchwork-Id: 1789071 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3A3993FC64 for ; Thu, 22 Nov 2012 21:12:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755679Ab2KVVMt (ORCPT ); Thu, 22 Nov 2012 16:12:49 -0500 Received: from kymasys.com ([64.62.140.43]:33148 "HELO kymasys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1755583Ab2KVSqT (ORCPT ); Thu, 22 Nov 2012 13:46:19 -0500 Received: from agni.kymasys.com ([75.40.23.192]) by kymasys.com for ; Wed, 21 Nov 2012 18:34:55 -0800 Received: by agni.kymasys.com (Postfix, from userid 500) id B29B4630284; Wed, 21 Nov 2012 18:34:18 -0800 (PST) From: Sanjay Lal To: kvm@vger.kernel.org, linux-mips@linux-mips.org Cc: Sanjay Lal Subject: [PATCH v2 15/18] MIPS: Pull in MIPS fix: fix endless loop when processing signals for kernel tasks. Date: Wed, 21 Nov 2012 18:34:13 -0800 Message-Id: <1353551656-23579-16-git-send-email-sanjayl@kymasys.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1353551656-23579-1-git-send-email-sanjayl@kymasys.com> References: <1353551656-23579-1-git-send-email-sanjayl@kymasys.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This bug is discussed in: http://lkml.indiana.edu/hypermail/linux/kernel/1205.2/00719.html Signed-off-by: Sanjay Lal --- arch/mips/kernel/entry.S | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/entry.S b/arch/mips/kernel/entry.S index a6c1332..9b00362 100644 --- a/arch/mips/kernel/entry.S +++ b/arch/mips/kernel/entry.S @@ -36,6 +36,11 @@ FEXPORT(ret_from_exception) FEXPORT(ret_from_irq) LONG_S s0, TI_REGS($28) FEXPORT(__ret_from_irq) +/* + * We can be coming here from a syscall done in the kernel space, + * e.g. a failed kernel_execve(). + */ +resume_userspace_check: LONG_L t0, PT_STATUS(sp) # returning to kernel mode? andi t0, t0, KU_USER beqz t0, resume_kernel @@ -162,7 +167,7 @@ work_notifysig: # deal with pending signals and move a0, sp li a1, 0 jal do_notify_resume # a2 already loaded - j resume_userspace + j resume_userspace_check FEXPORT(syscall_exit_partial) local_irq_disable # make sure need_resched doesn't