Skip to content

Commit a50f65b

Browse files
ardbiesheuvelpelwell
authored andcommitted
ARM: head: use PC-relative insn sequence for __smp_alt
commit 59d2f28 upstream. 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 5b6d749 commit a50f65b

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
@@ -519,19 +519,11 @@ ARM_BE8(rev r0, r0) @ byteswap if big endian
519519
retne lr
520520

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

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

0 commit comments

Comments
 (0)