All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] ARM: clean up PC-relative arithmetic
@ 2016-08-03 15:38 Ard Biesheuvel
  2016-08-03 15:38 ` [PATCH 1/8] ARM: assembler: introduce adr_l, ldr_l and str_l macros Ard Biesheuvel
                   ` (9 more replies)
  0 siblings, 10 replies; 39+ messages in thread
From: Ard Biesheuvel @ 2016-08-03 15:38 UTC (permalink / raw)
  To: linux-arm-kernel

There are various places in the ARM kernel where the following pattern
is used to create a PC-relative reference that is valid even before the
MMU is on:

     adr    rX, 1f
     ldr    rY, [rX]
     add    rX, rX, rY
     ...
  1: .long  <symbol> - .   

or
     adr    rX, 1f
     ldmia  rX, {rY .. rY+n}
     sub    rX, rX, rY
     add    rY+1, rY+1, rX
     add    rY+2, rY+2, rX
     ...
  1: .long  .
     .long  <symbolY>
     .long  <symbolY+1>
     ...

Both cases can be greatly simplified by letting the linker do the
calculations for us. This series implements adr_l, ldr_l and str_l
macros, and uses them to simplify a couple of instances of the above
patterns.

Ard Biesheuvel (8):
  ARM: assembler: introduce adr_l, ldr_l and str_l macros
  ARM: head-common.S: use PC-relative insn sequence for __proc_info
  ARM: head-common.S: use PC-relative insn sequence for __turn_mmu_on
  ARM: head.S: use PC-relative insn sequence for secondary_data
  ARM: head: use PC-relative insn sequence for __smp_alt
  ARM: sleep.S: use PC-relative insn sequence for
    sleep_save_sp/mpidr_hash
  ARM: head.S: use PC-relative insn sequences for __fixup_pv_table
  ARM: head.S: use PC relative insn sequence to calculate PHYS_OFFSET

 arch/arm/include/asm/assembler.h | 59 ++++++++++++++
 arch/arm/kernel/head-common.S    | 22 ++---
 arch/arm/kernel/head.S           | 86 +++++---------------
 arch/arm/kernel/sleep.S          | 15 +---
 4 files changed, 88 insertions(+), 94 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2016-08-04 15:38 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-03 15:38 [PATCH 0/8] ARM: clean up PC-relative arithmetic Ard Biesheuvel
2016-08-03 15:38 ` [PATCH 1/8] ARM: assembler: introduce adr_l, ldr_l and str_l macros Ard Biesheuvel
2016-08-03 16:49   ` Dave Martin
2016-08-04  7:40     ` Ard Biesheuvel
2016-08-04  9:44       ` Dave Martin
2016-08-04 10:34         ` Ard Biesheuvel
2016-08-04 11:22           ` Dave Martin
2016-08-04 12:16             ` Russell King - ARM Linux
2016-08-04 12:55               ` Dave Martin
2016-08-04 13:58               ` Ard Biesheuvel
2016-08-04  7:43     ` Ard Biesheuvel
2016-08-03 18:09   ` Russell King - ARM Linux
2016-08-04  7:40     ` Ard Biesheuvel
2016-08-04  9:38       ` Dave Martin
2016-08-04 10:12         ` Ard Biesheuvel
2016-08-04 11:08           ` Dave Martin
2016-08-04 11:10             ` Ard Biesheuvel
2016-08-04 11:30               ` Dave Martin
2016-08-04 11:34                 ` Ard Biesheuvel
2016-08-04 13:31                   ` Dave Martin
2016-08-04 13:46                     ` Ard Biesheuvel
2016-08-04 15:38                       ` Dave Martin
2016-08-03 15:38 ` [PATCH 2/8] ARM: head-common.S: use PC-relative insn sequence for __proc_info Ard Biesheuvel
2016-08-03 15:38 ` [PATCH 3/8] ARM: head-common.S: use PC-relative insn sequence for __turn_mmu_on Ard Biesheuvel
2016-08-03 15:38 ` [PATCH 4/8] ARM: head.S: use PC-relative insn sequence for secondary_data Ard Biesheuvel
2016-08-03 18:06   ` Russell King - ARM Linux
2016-08-03 15:38 ` [PATCH 5/8] ARM: head: use PC-relative insn sequence for __smp_alt Ard Biesheuvel
2016-08-03 15:38 ` [PATCH 6/8] ARM: sleep.S: use PC-relative insn sequence for sleep_save_sp/mpidr_hash Ard Biesheuvel
2016-08-03 15:38 ` [PATCH 7/8] ARM: head.S: use PC-relative insn sequences for __fixup_pv_table Ard Biesheuvel
2016-08-03 15:38 ` [PATCH 8/8] ARM: head.S: use PC relative insn sequence to calculate PHYS_OFFSET Ard Biesheuvel
2016-08-03 18:17 ` [PATCH 0/8] ARM: clean up PC-relative arithmetic Russell King - ARM Linux
2016-08-04  7:17   ` Ard Biesheuvel
2016-08-04  9:49     ` Russell King - ARM Linux
2016-08-04  9:54       ` Ard Biesheuvel
2016-08-04 10:03         ` Russell King - ARM Linux
2016-08-04 10:11           ` Ard Biesheuvel
2016-08-04 10:14             ` Russell King - ARM Linux
2016-08-03 18:27 ` Nicolas Pitre
2016-08-04 14:11   ` Ard Biesheuvel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.