From: Matt Redfearn <matt.redfearn@imgtec.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: <linux-mips@linux-mips.org>,
Matt Redfearn <matt.redfearn@imgtec.com>,
Chris Metcalf <cmetcalf@mellanox.com>,
<linux-kernel@vger.kernel.org>, Aaron Tomlin <atomlin@redhat.com>,
"Jason A. Donenfeld" <jason@zx2c4.com>
Subject: [PATCH] MIPS: Fix minimum alignment requirement of IRQ stack
Date: Fri, 7 Jul 2017 15:57:12 +0100 [thread overview]
Message-ID: <1499439432-29847-1-git-send-email-matt.redfearn@imgtec.com> (raw)
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
next reply other threads:[~2017-07-07 14:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-07 14:57 Matt Redfearn [this message]
2017-07-09 0:07 ` kbuild test robot
2017-07-09 1:21 ` kbuild test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1499439432-29847-1-git-send-email-matt.redfearn@imgtec.com \
--to=matt.redfearn@imgtec.com \
--cc=atomlin@redhat.com \
--cc=cmetcalf@mellanox.com \
--cc=jason@zx2c4.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®