Skip to content

ARM: use adr_l/ldr_l macros for PC-relative references

Ard Biesheuvel linux-arm-kernel linux-efi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12ARM: assembler: introduce adr_l, ldr_l and str_l macrosarch/arm/include/asm/assembler.h+84 -02 replies
2/12ARM: efistub: replace adrl pseudo-op with adr_l macro invocationarch/arm/boot/compressed/head.S+1 -20 replies
3/12ARM: module: add support for place relative relocationsarch/arm/include/asm/elf.h arch/arm/kernel/module.c+23 -22 replies
4/12ARM: head-common.S: use PC-relative insn sequence for __proc_infoarch/arm/kernel/head-common.S+6 -160 replies
5/12ARM: head-common.S: use PC-relative insn sequence for idmap creationarch/arm/kernel/head.S+2 -100 replies
6/12ARM: head.S: use PC-relative insn sequence for secondary_dataarch/arm/kernel/head.S+4 -150 replies
7/12ARM: kernel: use relative references for UP/SMP alternativesarch/arm/include/asm/assembler.h arch/arm/include/asm/processor.h arch/arm/kernel/head.S+8 -80 replies
8/12ARM: head: use PC-relative insn sequence for __smp_altarch/arm/kernel/head.S+2 -100 replies
9/12ARM: sleep.S: use PC-relative insn sequence for sleep_save_sp/mpidr_hasharch/arm/kernel/sleep.S+5 -140 replies
10/12ARM: head.S: use PC-relative insn sequences for __fixup_pv_tablearch/arm/kernel/head.S+8 -190 replies
11/12ARM: head.S: use PC relative insn sequence to calculate PHYS_OFFSETarch/arm/kernel/head.S+2 -80 replies
12/12ARM: kvm: replace open coded VA->PA calculations with adr_l callarch/arm/boot/compressed/head.S arch/arm/kernel/hyp-stub.S+14 -280 replies

Reviews trailers per patch

None of the 12 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNicolas PitreNick Desaulniers
SeriesR-b T-b
1/12
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12
10/12
11/12
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/12] ARM: use adr_l/ldr_l macros for PC-relative references

This is a respin of the adr_l/ldr_l code I wrote some years ago in the context of my KASLR proof of concept for 32-bit ARM.

A new use case came up, in the form of Clang, which does not implement the 'adrl' pseudo-instruction in its assembler, and so for PC-relative references that don't fit into a ARM adr instruction, we need something else. Patch #2 addresses an actual Clang build issue of this nature, by replacing an occurrence of adrl with adr_l.

I have included my existing cleanup patches that were built on top of the adr_l macro, which replace several occurrences of open coded arithmetic to calculate runtime addresses based on link time virtual addresses stored in literals.

Note that all of these patches with the exception of #2 were reviewed or acked by Nico before, but given that this was a while ago (and the fact that neither of us work for Linaro anymore), I have dropped these. Note that only patch #1 deviates significantly from the last version that I sent out, the remaining ones were just freshened up (and their commit logs slightly expanded).

Cc Russell King <[email protected]>
Cc Linus Walleij <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Nick Desaulniers <[email protected]>
Cc Stefan Agner <[email protected]>
Cc Peter Smith <[email protected]>
Cc Marc Zyngier <[email protected]>
Cc Will Deacon <[email protected]>

Ard Biesheuvel (12):
ARM: assembler: introduce adr_l, ldr_l and str_l macros
ARM: efistub: replace adrl pseudo-op with adr_l macro invocation
ARM: module: add support for place relative relocations
ARM: head-common.S: use PC-relative insn sequence for __proc_info
ARM: head-common.S: use PC-relative insn sequence for idmap creation
ARM: head.S: use PC-relative insn sequence for secondary_data
ARM: kernel: use relative references for UP/SMP alternatives
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
ARM: kvm: replace open coded VA->PA calculations with adr_l call

 arch/arm/boot/compressed/head.S  | 18 +---
 arch/arm/include/asm/assembler.h | 88 ++++++++++++++++++-
 arch/arm/include/asm/elf.h       |  5 ++
 arch/arm/include/asm/processor.h |  2 +-
 arch/arm/kernel/head-common.S    | 22 ++---
 arch/arm/kernel/head.S           | 90 +++++---------------
 arch/arm/kernel/hyp-stub.S       | 27 +++---
 arch/arm/kernel/module.c         | 20 ++++-
 arch/arm/kernel/sleep.S          | 19 ++---
 9 files changed, 159 insertions(+), 132 deletions(-)
Signature · 1 line
2.17.1