Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1683235 > unrolled thread

[PATCH] MIPS: Fix minimum alignment requirement of IRQ stack

Started byMatt Redfearn <matt.redfearn@imgtec.com>
First post2017-07-07 17:00 +0200
Last post2017-07-09 03:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] MIPS: Fix minimum alignment requirement of IRQ stack Matt Redfearn <matt.redfearn@imgtec.com> - 2017-07-07 17:00 +0200
    Re: [PATCH] MIPS: Fix minimum alignment requirement of IRQ stack kbuild test robot <lkp@intel.com> - 2017-07-09 03:30 +0200

#1683235 — [PATCH] MIPS: Fix minimum alignment requirement of IRQ stack

FromMatt Redfearn <matt.redfearn@imgtec.com>
Date2017-07-07 17:00 +0200
Subject[PATCH] MIPS: Fix minimum alignment requirement of IRQ stack
Message-ID<u0CTF-5qc-27@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1683682

Fromkbuild test robot <lkp@intel.com>
Date2017-07-09 03:30 +0200
Message-ID<u19cS-1e2-7@gated-at.bofh.it>
In reply to#1683235

[Multipart message — attachments visible in raw view] — view raw

Hi Matt,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.12 next-20170707]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Matt-Redfearn/MIPS-Fix-minimum-alignment-requirement-of-IRQ-stack/20170709-054925
config: mips-fuloong2e_defconfig (attached as .config)
compiler: mips64el-linux-gnuabi64-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All warnings (new ones prefixed by >>):

   In file included from drivers/net/slip/slip.c:87:0:
>> drivers/net/slip/slip.h:43:0: warning: "END" redefined
    #define END             0300  /* indicates end of frame */
    
   In file included from arch/mips/include/asm/irq.h:12:0,
                    from include/linux/irq.h:27,
                    from include/asm-generic/hardirq.h:12,
                    from arch/mips/include/asm/hardirq.h:16,
                    from include/linux/hardirq.h:8,
                    from include/linux/interrupt.h:12,
                    from drivers/net/slip/slip.c:72:
   arch/mips/include/asm/asm.h:74:0: note: this is the location of the previous definition
    #define END(function)     \
    

vim +/END +43 drivers/net/slip/slip.h

^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  27  # define SL_INCLUDE_CSLIP
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  28  #endif
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  29  
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  30  #ifdef SL_INCLUDE_CSLIP
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  31  # define SL_MODE_DEFAULT SL_MODE_ADAPTIVE
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  32  #else
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  33  # define SL_MODE_DEFAULT SL_MODE_SLIP
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  34  #endif
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  35  
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  36  /* SLIP configuration. */
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  37  #define SL_NRUNIT	256		/* MAX number of SLIP channels;
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  38  					   This can be overridden with
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  39  					   insmod -oslip_maxdev=nnn	*/
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  40  #define SL_MTU		296		/* 296; I am used to 600- FvK	*/
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  41  
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  42  /* SLIP protocol characters. */
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16 @43  #define END             0300		/* indicates end of frame	*/
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  44  #define ESC             0333		/* indicates byte stuffing	*/
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  45  #define ESC_END         0334		/* ESC ESC_END means END 'data'	*/
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  46  #define ESC_ESC         0335		/* ESC ESC_ESC means ESC 'data'	*/
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  47  
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  48  
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  49  struct slip {
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  50    int			magic;
^1da177e drivers/net/slip.h Linus Torvalds 2005-04-16  51  

:::::: The code at line 43 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web