From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/8] ARM: head.S: use PC-relative insn sequences for __fixup_pv_table
Date: Wed, 3 Aug 2016 17:38:49 +0200 [thread overview]
Message-ID: <1470238730-30038-8-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1470238730-30038-1-git-send-email-ard.biesheuvel@linaro.org>
Replace the open coded PC relative offset calculations with adr_l,
ldr_l and str_l invocations.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
arch/arm/kernel/head.S | 32 ++++++--------------
1 file changed, 10 insertions(+), 22 deletions(-)
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index a9d8f9004dfd..b9746366b633 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -577,37 +577,28 @@ ENDPROC(fixup_smp)
*/
__HEAD
__fixup_pv_table:
- adr r0, 1f
- ldmia r0, {r3-r7}
+ adr_l r7, __pv_offset @ __pa(__pv_offset)
+ ldr r3, =__pv_offset @ __va(__pv_offset)
mvn ip, #0
- subs r3, r0, r3 @ PHYS_OFFSET - PAGE_OFFSET
- add r4, r4, r3 @ adjust table start address
- add r5, r5, r3 @ adjust table end address
- add r6, r6, r3 @ adjust __pv_phys_pfn_offset address
- add r7, r7, r3 @ adjust __pv_offset address
- mov r0, r8, lsr #PAGE_SHIFT @ convert to PFN
- str r0, [r6] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset
+ subs r3, r7, r3 @ PHYS_OFFSET - PAGE_OFFSET
+ mov r0, r8, lsr #PAGE_SHIFT @ convert to PFN
+ str_l r0, __pv_phys_pfn_offset, r6 @ save computed PHYS_OFFSET
strcc ip, [r7, #HIGH_OFFSET] @ save to __pv_offset high bits
mov r6, r3, lsr #24 @ constant for add/sub instructions
teq r3, r6, lsl #24 @ must be 16MiB aligned
THUMB( it ne @ cross section branch )
bne __error
str r3, [r7, #LOW_OFFSET] @ save to __pv_offset low bits
+
+ adr_l r4, __pv_table_begin
+ adr_l r5, __pv_table_end
b __fixup_a_pv_table
ENDPROC(__fixup_pv_table)
-
- .align
-1: .long .
- .long __pv_table_begin
- .long __pv_table_end
-2: .long __pv_phys_pfn_offset
- .long __pv_offset
+ .ltorg
.text
__fixup_a_pv_table:
- adr r0, 3f
- ldr r6, [r0]
- add r6, r6, r3
+ adr_l r6, __pv_offset
ldr r0, [r6, #HIGH_OFFSET] @ pv_offset high word
ldr r6, [r6, #LOW_OFFSET] @ pv_offset low word
mov r6, r6, lsr #24
@@ -675,9 +666,6 @@ ARM_BE8(rev16 ip, ip)
#endif
ENDPROC(__fixup_a_pv_table)
- .align
-3: .long __pv_offset
-
ENTRY(fixup_pv_table)
stmfd sp!, {r4 - r7, lr}
mov r3, #0 @ no offset
--
2.7.4
next prev parent reply other threads:[~2016-08-03 15:38 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Ard Biesheuvel [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470238730-30038-8-git-send-email-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.