From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:34004 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754252AbdDLNeF (ORCPT ); Wed, 12 Apr 2017 09:34:05 -0400 Subject: Patch "MIPS: Stack unwinding while on IRQ stack" has been added to the 4.4-stable tree To: matt.redfearn@imgtec.com, adam.buchbinder@gmail.com, akpm@linux-foundation.org, amit.pundir@linaro.org, cmetcalf@mellanox.com, gregkh@linuxfoundation.org, james.hogan@imgtec.com, jason@zx2c4.com, jslaby@suse.cz, macro@imgtec.com, marcin.nowakowski@imgtec.com, paul.burton@imgtec.com, ralf@linux-mips.org, tglx@linutronix.de Cc: , From: Date: Wed, 12 Apr 2017 15:33:41 +0200 Message-ID: <149200402111847@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled MIPS: Stack unwinding while on IRQ stack to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mips-stack-unwinding-while-on-irq-stack.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From d42d8d106b0275b027c1e8992c42aecf933436ea Mon Sep 17 00:00:00 2001 From: Matt Redfearn Date: Mon, 19 Dec 2016 14:20:57 +0000 Subject: MIPS: Stack unwinding while on IRQ stack From: Matt Redfearn commit d42d8d106b0275b027c1e8992c42aecf933436ea upstream. Within unwind stack, check if the stack pointer being unwound is within the CPU's irq_stack and if so use that page rather than the task's stack page. Signed-off-by: Matt Redfearn Acked-by: Jason A. Donenfeld Cc: Thomas Gleixner Cc: Adam Buchbinder Cc: Maciej W. Rozycki Cc: Marcin Nowakowski Cc: Chris Metcalf Cc: James Hogan Cc: Paul Burton Cc: Jiri Slaby Cc: Andrew Morton Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/14741/ Signed-off-by: Ralf Baechle Signed-off-by: Amit Pundir Signed-off-by: Greg Kroah-Hartman --- arch/mips/kernel/process.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -552,7 +553,19 @@ EXPORT_SYMBOL(unwind_stack_by_address); unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, unsigned long pc, unsigned long *ra) { - unsigned long stack_page = (unsigned long)task_stack_page(task); + unsigned long stack_page = 0; + int cpu; + + for_each_possible_cpu(cpu) { + if (on_irq_stack(cpu, *sp)) { + stack_page = (unsigned long)irq_stack[cpu]; + break; + } + } + + if (!stack_page) + stack_page = (unsigned long)task_stack_page(task); + return unwind_stack_by_address(stack_page, sp, pc, ra); } #endif Patches currently in stable-queue which might be from matt.redfearn@imgtec.com are queue-4.4/mips-only-change-28-to-thread_info-if-coming-from-user-mode.patch queue-4.4/mips-stack-unwinding-while-on-irq-stack.patch queue-4.4/mips-introduce-irq_stack.patch