Skip to contentSkip to conversation

jump_label: Fix unaligned traps on sparc.

PATCH In review David Miller 2 participants 3 messages Oct 23, 2010 – Oct 30, 2010

Subsystems (2)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/1 jump_label: Fix unaligned traps on sparc.

The vmlinux.lds.h knobs to emit the __jump_table section in the main kernel image takes care to align the section, but this doesn't help for the __jump_table section that gets emitted into modules.

Fix the resulting lack of section alignment by explicitly specifying it in the assembler.

arch/sparc/include/asm/jump_label.h +1 -0
index 62e66d7..d95cf44 100644
@@ -14,6 +14,7 @@
 			 "nop\n\t"				\
 			 "nop\n\t"				\
 			 ".pushsection __jump_table,  \"a\"\n\t"\
+			 ".align 4\n\t"				\
 			 ".word 1b, %l[" #label "], %c0\n\t"	\
 			 ".popsection \n\t"			\
 			 : :  "i" (key) :  : label);\
#1 lore raw
Quoted 8 lines · David Miller

The vmlinux.lds.h knobs to emit the __jump_table section in the main kernel image takes care to align the section, but this doesn't help for the __jump_table section that gets emitted into modules.

Fix the resulting lack of section alignment by explicitly specifying it in the assembler.

Thanks! I'll pull this in tonight with the other jump label patches.

Unfortunately, it turns out that gcc has a bug that can cause crashes when jump label is used. We need to set it to broken until gcc has a fix and we can detect if the compiler has the bug or not.

-- Steve

Quoted 13 lines
arch/sparc/include/asm/jump_label.h +1 -0
index 62e66d7..d95cf44 100644
@@ -14,6 +14,7 @@
 			 "nop\n\t"				\
 			 "nop\n\t"				\
 			 ".pushsection __jump_table,  \"a\"\n\t"\
+			 ".align 4\n\t"				\
 			 ".word 1b, %l[" #label "], %c0\n\t"	\
 			 ".popsection \n\t"			\
 			 : :  "i" (key) :  : label);\
author maintainer
#2 lore raw
In reply to David Miller
Commit-ID:  f0daed0242d514033b9ecca9187108d3c4e281a5
Gitweb:     http://git.kernel.org/tip/f0daed0242d514033b9ecca9187108d3c4e281a5
Author:     David Miller <[email protected]>
AuthorDate: Sat, 23 Oct 2010 11:06:24 -0700
Committer:  Steven Rostedt <[email protected]>
CommitDate: Fri, 29 Oct 2010 12:57:06 -0400

jump_label: Fix unaligned traps on sparc.

The vmlinux.lds.h knobs to emit the __jump_table section in the main kernel image takes care to align the section, but this doesn't help for the __jump_table section that gets emitted into modules.

Fix the resulting lack of section alignment by explicitly specifying it in the assembler.

LKML-Reference: <[email protected]>

---
 arch/sparc/include/asm/jump_label.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/sparc/include/asm/jump_label.h +1 -0
index 62e66d7..d95cf44 100644
@@ -14,6 +14,7 @@
 			 "nop\n\t"				\
 			 "nop\n\t"				\
 			 ".pushsection __jump_table,  \"a\"\n\t"\
+			 ".align 4\n\t"				\
 			 ".word 1b, %l[" #label "], %c0\n\t"	\
 			 ".popsection \n\t"			\
 			 : :  "i" (key) :  : label);\