Skip to content

Commit 9f80ccd

Browse files
ardbiesheuvelRussell King (Oracle)
authored andcommitted
ARM: 9180/1: Thumb2: align ALT_UP() sections in modules sufficiently
When building for Thumb2, the .alt.smp.init sections that are emitted by the ALT_UP() patching code may not be 32-bit aligned, even though the fixup_smp_on_up() routine expects that. This results in alignment faults at module load time, which need to be fixed up by the fault handler. So let's align those sections explicitly, and prevent this from occurring. Cc: <stable@vger.kernel.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
1 parent 1542026 commit 9f80ccd

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

arch/arm/include/asm/assembler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@
288288
*/
289289
#define ALT_UP(instr...) \
290290
.pushsection ".alt.smp.init", "a" ;\
291+
.align 2 ;\
291292
.long 9998b - . ;\
292293
9997: instr ;\
293294
.if . - 9997b == 2 ;\
@@ -299,6 +300,7 @@
299300
.popsection
300301
#define ALT_UP_B(label) \
301302
.pushsection ".alt.smp.init", "a" ;\
303+
.align 2 ;\
302304
.long 9998b - . ;\
303305
W(b) . + (label - 9998b) ;\
304306
.popsection

arch/arm/include/asm/processor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ unsigned long __get_wchan(struct task_struct *p);
9696
#define __ALT_SMP_ASM(smp, up) \
9797
"9998: " smp "\n" \
9898
" .pushsection \".alt.smp.init\", \"a\"\n" \
99+
" .align 2\n" \
99100
" .long 9998b - .\n" \
100101
" " up "\n" \
101102
" .popsection\n"

0 commit comments

Comments
 (0)