Skip to content

Commit 59d2f28

Browse files
committed
ARM: head: use PC-relative insn sequence for __smp_alt
Now that calling __do_fixup_smp_on_up() can be done without passing the physical-to-virtual offset in r3, we can replace the open coded PC relative offset calculations with a pair of adr_l invocations. This removes some open coded arithmetic involving virtual addresses, avoids literal pools on v7+, and slightly reduces the footprint of the code. Reviewed-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent 450abd3 commit 59d2f28

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

‎arch/arm/kernel/head.S‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -520,19 +520,11 @@ ARM_BE8(rev r0, r0) @ byteswap if big endian
520520
retne lr
521521

522522
__fixup_smp_on_up:
523-
adr r0, 1f
524-
ldmia r0, {r3 - r5}
525-
sub r3, r0, r3
526-
add r4, r4, r3
527-
add r5, r5, r3
523+
adr_l r4, __smpalt_begin
524+
adr_l r5, __smpalt_end
528525
b __do_fixup_smp_on_up
529526
ENDPROC(__fixup_smp)
530527

531-
.align
532-
1: .word .
533-
.word __smpalt_begin
534-
.word __smpalt_end
535-
536528
.pushsection .data
537529
.align 2
538530
.globl smp_on_up

0 commit comments

Comments
 (0)