Skip to contentSkip to conversation

Patch "MIPS: Stack unwinding while on IRQ stack" has been added to the 4.10-stable tree

PATCH [email protected] 1 participant 1 message Apr 12, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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.10-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.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From d42d8d106b0275b027c1e8992c42aecf933436ea Mon Sep 17 00:00:00 2001

From: Matt Redfearn <[email protected]>
Date: Mon, 19 Dec 2016 14:20:57 +0000
Subject: MIPS: Stack unwinding while on IRQ stack

From: Matt Redfearn <[email protected]>

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.

Cc Thomas Gleixner <[email protected]>
Cc Adam Buchbinder <[email protected]>
Cc Maciej W. Rozycki <[email protected]>
Cc Marcin Nowakowski <[email protected]>
Cc Chris Metcalf <[email protected]>
Cc James Hogan <[email protected]>
Cc Paul Burton <[email protected]>
Cc Jiri Slaby <[email protected]>
Cc Andrew Morton <[email protected]>

Patchwork: https://patchwork.linux-mips.org/patch/14741/

---
 arch/mips/kernel/process.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
arch/mips/kernel/process.c +14 -1
@@ -33,6 +33,7 @@
 #include <asm/dsemul.h>
 #include <asm/dsp.h>
 #include <asm/fpu.h>
+#include <asm/irq.h>
 #include <asm/msa.h>
 #include <asm/pgtable.h>
 #include <asm/mipsregs.h>
@@ -556,7 +557,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 [email protected] are

queue-4.10/mips-only-change-28-to-thread_info-if-coming-from-user-mode.patch queue-4.10/mips-stack-unwinding-while-on-irq-stack.patch queue-4.10/mips-introduce-irq_stack.patch