mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] MIPS: Fix minimum alignment requirement of IRQ stack
@ 2017-07-07 14:57 Matt Redfearn
  2017-07-09  0:07 ` kbuild test robot
  2017-07-09  1:21 ` kbuild test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Redfearn @ 2017-07-07 14:57 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: linux-mips, Matt Redfearn, Chris Metcalf, linux-kernel,
	Aaron Tomlin, Jason A. Donenfeld

Commit db8466c581cc ("MIPS: IRQ Stack: Unwind IRQ stack onto task
stack") erroneously set the initial stack pointer of the IRQ stack to a
value with a 4 byte alignment. The MIPS32 ABI requires that the minimum
stack alignment is 8 byte, and the MIPS64 ABIs(n32/n64) require 16 byte
minimum alignment. Use the ALMASK stack pointer mask to align the stack
as appropriate for the kernel build.

Fixes: db8466c581cc ("MIPS: IRQ Stack: Unwind IRQ stack onto task stack")
Reported-by: Darius Ivanauskas <dasilt@yahoo.com>
Suggested-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>

---

 arch/mips/include/asm/irq.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/irq.h b/arch/mips/include/asm/irq.h
index ddd1c918103b..ac66a2de091a 100644
--- a/arch/mips/include/asm/irq.h
+++ b/arch/mips/include/asm/irq.h
@@ -9,6 +9,7 @@
 #ifndef _ASM_IRQ_H
 #define _ASM_IRQ_H
 
+#include <asm/asm.h>
 #include <linux/linkage.h>
 #include <linux/smp.h>
 #include <linux/irqdomain.h>
@@ -17,8 +18,8 @@
 
 #include <irq.h>
 
-#define IRQ_STACK_SIZE			THREAD_SIZE
-#define IRQ_STACK_START			(IRQ_STACK_SIZE - sizeof(unsigned long))
+#define IRQ_STACK_SIZE	THREAD_SIZE
+#define IRQ_STACK_START	((IRQ_STACK_SIZE - sizeof(unsigned long)) & ALMASK)
 
 extern void *irq_stack[NR_CPUS];
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-09  1:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-07 14:57 [PATCH] MIPS: Fix minimum alignment requirement of IRQ stack Matt Redfearn
2017-07-09  0:07 ` kbuild test robot
2017-07-09  1:21 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®