Skip to content

Commit b5fe242

Browse files
Ard Biesheuvelwildea01
authored andcommitted
arm64: kernel: fix style issues in sleep.S
This fixes a number of style issues in sleep.S. No functional changes are intended: - replace absolute literal references with relative references in __cpu_suspend_enter(), which executes from its virtual address - replace explicit lr assignment plus branch with bl in cpu_resume(), which aligns it with stext() and secondary_startup() - don't export _cpu_resume() - use adr_l for mpidr_hash reference, and fix the incorrect accompanying comment, which has been out of date since commit cabe1c8 ("arm64: Change cpu_resume() to enable mmu early then access sleep_sp by va") - replace leading spaces with tabs, and add a bit of whitespace for readability Reviewed-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 563cada commit b5fe242

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

arch/arm64/kernel/sleep.S

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,9 @@ ENTRY(__cpu_suspend_enter)
7373
str x2, [x0, #SLEEP_STACK_DATA_SYSTEM_REGS + CPU_CTX_SP]
7474

7575
/* find the mpidr_hash */
76-
ldr x1, =sleep_save_stash
77-
ldr x1, [x1]
76+
ldr_l x1, sleep_save_stash
7877
mrs x7, mpidr_el1
79-
ldr x9, =mpidr_hash
78+
adr_l x9, mpidr_hash
8079
ldr x10, [x9, #MPIDR_HASH_MASK]
8180
/*
8281
* Following code relies on the struct mpidr_hash
@@ -95,15 +94,14 @@ ENTRY(__cpu_suspend_enter)
9594
mov x0, #1
9695
ret
9796
ENDPROC(__cpu_suspend_enter)
98-
.ltorg
9997

10098
.pushsection ".idmap.text", "ax"
10199
ENTRY(cpu_resume)
102100
bl el2_setup // if in EL2 drop to EL1 cleanly
101+
bl __cpu_setup
103102
/* enable the MMU early - so we can access sleep_save_stash by va */
104-
adr_l lr, __enable_mmu /* __cpu_setup will return here */
105103
adr_l x27, _resume_switched /* __enable_mmu will branch here */
106-
b __cpu_setup
104+
b __enable_mmu
107105
ENDPROC(cpu_resume)
108106

109107
_resume_switched:
@@ -113,16 +111,17 @@ ENDPROC(_resume_switched)
113111
.ltorg
114112
.popsection
115113

116-
ENTRY(_cpu_resume)
114+
_cpu_resume:
117115
mrs x1, mpidr_el1
118-
adrp x8, mpidr_hash
119-
add x8, x8, #:lo12:mpidr_hash // x8 = struct mpidr_hash phys address
120-
/* retrieve mpidr_hash members to compute the hash */
116+
adr_l x8, mpidr_hash // x8 = struct mpidr_hash virt address
117+
118+
/* retrieve mpidr_hash members to compute the hash */
121119
ldr x2, [x8, #MPIDR_HASH_MASK]
122120
ldp w3, w4, [x8, #MPIDR_HASH_SHIFTS]
123121
ldp w5, w6, [x8, #(MPIDR_HASH_SHIFTS + 8)]
124122
compute_mpidr_hash x7, x3, x4, x5, x6, x1, x2
125-
/* x7 contains hash index, let's use it to grab context pointer */
123+
124+
/* x7 contains hash index, let's use it to grab context pointer */
126125
ldr_l x0, sleep_save_stash
127126
ldr x0, [x0, x7, lsl #3]
128127
add x29, x0, #SLEEP_STACK_DATA_CALLEE_REGS

0 commit comments

Comments
 (0)