From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752084AbdGGO5Z (ORCPT ); Fri, 7 Jul 2017 10:57:25 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:63752 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751846AbdGGO5X (ORCPT ); Fri, 7 Jul 2017 10:57:23 -0400 From: Matt Redfearn To: Ralf Baechle CC: , Matt Redfearn , Chris Metcalf , , Aaron Tomlin , "Jason A. Donenfeld" Subject: [PATCH] MIPS: Fix minimum alignment requirement of IRQ stack Date: Fri, 7 Jul 2017 15:57:12 +0100 Message-ID: <1499439432-29847-1-git-send-email-matt.redfearn@imgtec.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.150.130.83] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Suggested-by: James Hogan Signed-off-by: Matt Redfearn --- 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 #include #include #include @@ -17,8 +18,8 @@ #include -#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