Skip to content

Commit f465925

Browse files
brooniewilldeacon
authored andcommitted
arm64: mm: Use modern annotations for assembly functions
In an effort to clarify and simplify the annotation of assembly functions in the kernel new macros have been introduced. These replace ENTRY and ENDPROC and also add a new annotation for static functions which previously had no ENTRY equivalent. Update the annotations in the mm code to the new macros. Even the functions called from non-standard environments like idmap have no special requirements on their environments so can be treated like regular functions. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent 3ac0f45 commit f465925

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

arch/arm64/mm/cache.S

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* - start - virtual start address of region
2525
* - end - virtual end address of region
2626
*/
27-
ENTRY(__flush_icache_range)
27+
SYM_FUNC_START(__flush_icache_range)
2828
/* FALLTHROUGH */
2929

3030
/*
@@ -37,7 +37,7 @@ ENTRY(__flush_icache_range)
3737
* - start - virtual start address of region
3838
* - end - virtual end address of region
3939
*/
40-
ENTRY(__flush_cache_user_range)
40+
SYM_FUNC_START(__flush_cache_user_range)
4141
uaccess_ttbr0_enable x2, x3, x4
4242
alternative_if ARM64_HAS_CACHE_IDC
4343
dsb ishst
@@ -66,8 +66,8 @@ alternative_else_nop_endif
6666
9:
6767
mov x0, #-EFAULT
6868
b 1b
69-
ENDPROC(__flush_icache_range)
70-
ENDPROC(__flush_cache_user_range)
69+
SYM_FUNC_END(__flush_icache_range)
70+
SYM_FUNC_END(__flush_cache_user_range)
7171

7272
/*
7373
* invalidate_icache_range(start,end)
@@ -77,7 +77,7 @@ ENDPROC(__flush_cache_user_range)
7777
* - start - virtual start address of region
7878
* - end - virtual end address of region
7979
*/
80-
ENTRY(invalidate_icache_range)
80+
SYM_FUNC_START(invalidate_icache_range)
8181
alternative_if ARM64_HAS_CACHE_DIC
8282
mov x0, xzr
8383
isb
@@ -94,7 +94,7 @@ alternative_else_nop_endif
9494
2:
9595
mov x0, #-EFAULT
9696
b 1b
97-
ENDPROC(invalidate_icache_range)
97+
SYM_FUNC_END(invalidate_icache_range)
9898

9999
/*
100100
* __flush_dcache_area(kaddr, size)
@@ -105,10 +105,10 @@ ENDPROC(invalidate_icache_range)
105105
* - kaddr - kernel address
106106
* - size - size in question
107107
*/
108-
ENTRY(__flush_dcache_area)
108+
SYM_FUNC_START_PI(__flush_dcache_area)
109109
dcache_by_line_op civac, sy, x0, x1, x2, x3
110110
ret
111-
ENDPIPROC(__flush_dcache_area)
111+
SYM_FUNC_END_PI(__flush_dcache_area)
112112

113113
/*
114114
* __clean_dcache_area_pou(kaddr, size)
@@ -119,14 +119,14 @@ ENDPIPROC(__flush_dcache_area)
119119
* - kaddr - kernel address
120120
* - size - size in question
121121
*/
122-
ENTRY(__clean_dcache_area_pou)
122+
SYM_FUNC_START(__clean_dcache_area_pou)
123123
alternative_if ARM64_HAS_CACHE_IDC
124124
dsb ishst
125125
ret
126126
alternative_else_nop_endif
127127
dcache_by_line_op cvau, ish, x0, x1, x2, x3
128128
ret
129-
ENDPROC(__clean_dcache_area_pou)
129+
SYM_FUNC_END(__clean_dcache_area_pou)
130130

131131
/*
132132
* __inval_dcache_area(kaddr, size)
@@ -138,15 +138,15 @@ ENDPROC(__clean_dcache_area_pou)
138138
* - kaddr - kernel address
139139
* - size - size in question
140140
*/
141-
ENTRY(__inval_dcache_area)
141+
SYM_FUNC_START_LOCAL(__dma_inv_area)
142+
SYM_FUNC_START_PI(__inval_dcache_area)
142143
/* FALLTHROUGH */
143144

144145
/*
145146
* __dma_inv_area(start, size)
146147
* - start - virtual start address of region
147148
* - size - size in question
148149
*/
149-
__dma_inv_area:
150150
add x1, x1, x0
151151
dcache_line_size x2, x3
152152
sub x3, x2, #1
@@ -165,8 +165,8 @@ __dma_inv_area:
165165
b.lo 2b
166166
dsb sy
167167
ret
168-
ENDPIPROC(__inval_dcache_area)
169-
ENDPROC(__dma_inv_area)
168+
SYM_FUNC_END_PI(__inval_dcache_area)
169+
SYM_FUNC_END(__dma_inv_area)
170170

171171
/*
172172
* __clean_dcache_area_poc(kaddr, size)
@@ -177,19 +177,19 @@ ENDPROC(__dma_inv_area)
177177
* - kaddr - kernel address
178178
* - size - size in question
179179
*/
180-
ENTRY(__clean_dcache_area_poc)
180+
SYM_FUNC_START_LOCAL(__dma_clean_area)
181+
SYM_FUNC_START_PI(__clean_dcache_area_poc)
181182
/* FALLTHROUGH */
182183

183184
/*
184185
* __dma_clean_area(start, size)
185186
* - start - virtual start address of region
186187
* - size - size in question
187188
*/
188-
__dma_clean_area:
189189
dcache_by_line_op cvac, sy, x0, x1, x2, x3
190190
ret
191-
ENDPIPROC(__clean_dcache_area_poc)
192-
ENDPROC(__dma_clean_area)
191+
SYM_FUNC_END_PI(__clean_dcache_area_poc)
192+
SYM_FUNC_END(__dma_clean_area)
193193

194194
/*
195195
* __clean_dcache_area_pop(kaddr, size)
@@ -200,13 +200,13 @@ ENDPROC(__dma_clean_area)
200200
* - kaddr - kernel address
201201
* - size - size in question
202202
*/
203-
ENTRY(__clean_dcache_area_pop)
203+
SYM_FUNC_START_PI(__clean_dcache_area_pop)
204204
alternative_if_not ARM64_HAS_DCPOP
205205
b __clean_dcache_area_poc
206206
alternative_else_nop_endif
207207
dcache_by_line_op cvap, sy, x0, x1, x2, x3
208208
ret
209-
ENDPIPROC(__clean_dcache_area_pop)
209+
SYM_FUNC_END_PI(__clean_dcache_area_pop)
210210

211211
/*
212212
* __dma_flush_area(start, size)
@@ -216,31 +216,31 @@ ENDPIPROC(__clean_dcache_area_pop)
216216
* - start - virtual start address of region
217217
* - size - size in question
218218
*/
219-
ENTRY(__dma_flush_area)
219+
SYM_FUNC_START_PI(__dma_flush_area)
220220
dcache_by_line_op civac, sy, x0, x1, x2, x3
221221
ret
222-
ENDPIPROC(__dma_flush_area)
222+
SYM_FUNC_END_PI(__dma_flush_area)
223223

224224
/*
225225
* __dma_map_area(start, size, dir)
226226
* - start - kernel virtual start address
227227
* - size - size of region
228228
* - dir - DMA direction
229229
*/
230-
ENTRY(__dma_map_area)
230+
SYM_FUNC_START_PI(__dma_map_area)
231231
cmp w2, #DMA_FROM_DEVICE
232232
b.eq __dma_inv_area
233233
b __dma_clean_area
234-
ENDPIPROC(__dma_map_area)
234+
SYM_FUNC_END_PI(__dma_map_area)
235235

236236
/*
237237
* __dma_unmap_area(start, size, dir)
238238
* - start - kernel virtual start address
239239
* - size - size of region
240240
* - dir - DMA direction
241241
*/
242-
ENTRY(__dma_unmap_area)
242+
SYM_FUNC_START_PI(__dma_unmap_area)
243243
cmp w2, #DMA_TO_DEVICE
244244
b.ne __dma_inv_area
245245
ret
246-
ENDPIPROC(__dma_unmap_area)
246+
SYM_FUNC_END_PI(__dma_unmap_area)

arch/arm64/mm/proc.S

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
*
5151
* x0: virtual address of context pointer
5252
*/
53-
ENTRY(cpu_do_suspend)
53+
SYM_FUNC_START(cpu_do_suspend)
5454
mrs x2, tpidr_el0
5555
mrs x3, tpidrro_el0
5656
mrs x4, contextidr_el1
@@ -74,15 +74,15 @@ alternative_endif
7474
stp x10, x11, [x0, #64]
7575
stp x12, x13, [x0, #80]
7676
ret
77-
ENDPROC(cpu_do_suspend)
77+
SYM_FUNC_END(cpu_do_suspend)
7878

7979
/**
8080
* cpu_do_resume - restore CPU register context
8181
*
8282
* x0: Address of context pointer
8383
*/
8484
.pushsection ".idmap.text", "awx"
85-
ENTRY(cpu_do_resume)
85+
SYM_FUNC_START(cpu_do_resume)
8686
ldp x2, x3, [x0]
8787
ldp x4, x5, [x0, #16]
8888
ldp x6, x8, [x0, #32]
@@ -131,7 +131,7 @@ alternative_else_nop_endif
131131

132132
isb
133133
ret
134-
ENDPROC(cpu_do_resume)
134+
SYM_FUNC_END(cpu_do_resume)
135135
.popsection
136136
#endif
137137

@@ -142,7 +142,7 @@ ENDPROC(cpu_do_resume)
142142
*
143143
* - pgd_phys - physical address of new TTB
144144
*/
145-
ENTRY(cpu_do_switch_mm)
145+
SYM_FUNC_START(cpu_do_switch_mm)
146146
mrs x2, ttbr1_el1
147147
mmid x1, x1 // get mm->context.id
148148
phys_to_ttbr x3, x0
@@ -161,7 +161,7 @@ alternative_else_nop_endif
161161
msr ttbr0_el1, x3 // now update TTBR0
162162
isb
163163
b post_ttbr_update_workaround // Back to C code...
164-
ENDPROC(cpu_do_switch_mm)
164+
SYM_FUNC_END(cpu_do_switch_mm)
165165

166166
.pushsection ".idmap.text", "awx"
167167

@@ -182,7 +182,7 @@ ENDPROC(cpu_do_switch_mm)
182182
* This is the low-level counterpart to cpu_replace_ttbr1, and should not be
183183
* called by anything else. It can only be executed from a TTBR0 mapping.
184184
*/
185-
ENTRY(idmap_cpu_replace_ttbr1)
185+
SYM_FUNC_START(idmap_cpu_replace_ttbr1)
186186
save_and_disable_daif flags=x2
187187

188188
__idmap_cpu_set_reserved_ttbr1 x1, x3
@@ -194,7 +194,7 @@ ENTRY(idmap_cpu_replace_ttbr1)
194194
restore_daif x2
195195

196196
ret
197-
ENDPROC(idmap_cpu_replace_ttbr1)
197+
SYM_FUNC_END(idmap_cpu_replace_ttbr1)
198198
.popsection
199199

200200
#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
@@ -222,7 +222,7 @@ ENDPROC(idmap_cpu_replace_ttbr1)
222222
*/
223223
__idmap_kpti_flag:
224224
.long 1
225-
ENTRY(idmap_kpti_install_ng_mappings)
225+
SYM_FUNC_START(idmap_kpti_install_ng_mappings)
226226
cpu .req w0
227227
num_cpus .req w1
228228
swapper_pa .req x2
@@ -393,7 +393,7 @@ __idmap_kpti_secondary:
393393
.unreq cur_ptep
394394
.unreq end_ptep
395395
.unreq pte
396-
ENDPROC(idmap_kpti_install_ng_mappings)
396+
SYM_FUNC_END(idmap_kpti_install_ng_mappings)
397397
.popsection
398398
#endif
399399

@@ -404,7 +404,7 @@ ENDPROC(idmap_kpti_install_ng_mappings)
404404
* value of the SCTLR_EL1 register.
405405
*/
406406
.pushsection ".idmap.text", "awx"
407-
ENTRY(__cpu_setup)
407+
SYM_FUNC_START(__cpu_setup)
408408
tlbi vmalle1 // Invalidate local TLB
409409
dsb nsh
410410

@@ -475,4 +475,4 @@ ENTRY(__cpu_setup)
475475
#endif /* CONFIG_ARM64_HW_AFDBM */
476476
msr tcr_el1, x10
477477
ret // return to head.S
478-
ENDPROC(__cpu_setup)
478+
SYM_FUNC_END(__cpu_setup)

0 commit comments

Comments
 (0)