Skip to content

Commit aa246c0

Browse files
committed
Merge branch 'for-next/asm-annotations' into for-next/core
* for-next/asm-annotations: (6 commits) arm64: kernel: Correct annotation of end of el0_sync ...
2 parents 4f6cdf2 + 73d6890 commit aa246c0

25 files changed

+112
-104
lines changed

arch/arm64/include/asm/assembler.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -448,17 +448,6 @@ USER(\label, ic ivau, \tmp2) // invalidate I line PoU
448448
b.ne 9998b
449449
.endm
450450

451-
/*
452-
* Annotate a function as position independent, i.e., safe to be called before
453-
* the kernel virtual mapping is activated.
454-
*/
455-
#define ENDPIPROC(x) \
456-
.globl __pi_##x; \
457-
.type __pi_##x, %function; \
458-
.set __pi_##x, x; \
459-
.size __pi_##x, . - x; \
460-
ENDPROC(x)
461-
462451
/*
463452
* Annotate a function as being unsuitable for kprobes.
464453
*/

arch/arm64/include/asm/linkage.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,20 @@
44
#define __ALIGN .align 2
55
#define __ALIGN_STR ".align 2"
66

7+
/*
8+
* Annotate a function as position independent, i.e., safe to be called before
9+
* the kernel virtual mapping is activated.
10+
*/
11+
#define SYM_FUNC_START_PI(x) \
12+
SYM_FUNC_START_ALIAS(__pi_##x); \
13+
SYM_FUNC_START(x)
14+
15+
#define SYM_FUNC_START_WEAK_PI(x) \
16+
SYM_FUNC_START_ALIAS(__pi_##x); \
17+
SYM_FUNC_START_WEAK(x)
18+
19+
#define SYM_FUNC_END_PI(x) \
20+
SYM_FUNC_END(x); \
21+
SYM_FUNC_END_ALIAS(__pi_##x)
22+
723
#endif

arch/arm64/kernel/entry.S

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ el0_sync:
650650
mov x0, sp
651651
bl el0_sync_handler
652652
b ret_to_user
653+
ENDPROC(el0_sync)
653654

654655
#ifdef CONFIG_COMPAT
655656
.align 6
@@ -658,16 +659,18 @@ el0_sync_compat:
658659
mov x0, sp
659660
bl el0_sync_compat_handler
660661
b ret_to_user
661-
ENDPROC(el0_sync)
662+
ENDPROC(el0_sync_compat)
662663

663664
.align 6
664665
el0_irq_compat:
665666
kernel_entry 0, 32
666667
b el0_irq_naked
668+
ENDPROC(el0_irq_compat)
667669

668670
el0_error_compat:
669671
kernel_entry 0, 32
670672
b el0_error_naked
673+
ENDPROC(el0_error_compat)
671674
#endif
672675

673676
.align 6

arch/arm64/lib/clear_page.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Parameters:
1515
* x0 - dest
1616
*/
17-
ENTRY(clear_page)
17+
SYM_FUNC_START(clear_page)
1818
mrs x1, dczid_el0
1919
and w1, w1, #0xf
2020
mov x2, #4
@@ -25,5 +25,5 @@ ENTRY(clear_page)
2525
tst x0, #(PAGE_SIZE - 1)
2626
b.ne 1b
2727
ret
28-
ENDPROC(clear_page)
28+
SYM_FUNC_END(clear_page)
2929
EXPORT_SYMBOL(clear_page)

arch/arm64/lib/clear_user.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
* Alignment fixed up by hardware.
2121
*/
22-
ENTRY(__arch_clear_user)
22+
SYM_FUNC_START(__arch_clear_user)
2323
mov x2, x1 // save the size for fixup return
2424
subs x1, x1, #8
2525
b.mi 2f
@@ -40,7 +40,7 @@ uao_user_alternative 9f, strh, sttrh, wzr, x0, 2
4040
uao_user_alternative 9f, strb, sttrb, wzr, x0, 0
4141
5: mov x0, #0
4242
ret
43-
ENDPROC(__arch_clear_user)
43+
SYM_FUNC_END(__arch_clear_user)
4444
EXPORT_SYMBOL(__arch_clear_user)
4545

4646
.section .fixup,"ax"

arch/arm64/lib/copy_from_user.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@
5353
.endm
5454

5555
end .req x5
56-
ENTRY(__arch_copy_from_user)
56+
SYM_FUNC_START(__arch_copy_from_user)
5757
add end, x0, x2
5858
#include "copy_template.S"
5959
mov x0, #0 // Nothing to copy
6060
ret
61-
ENDPROC(__arch_copy_from_user)
61+
SYM_FUNC_END(__arch_copy_from_user)
6262
EXPORT_SYMBOL(__arch_copy_from_user)
6363

6464
.section .fixup,"ax"

arch/arm64/lib/copy_in_user.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@
5555

5656
end .req x5
5757

58-
ENTRY(__arch_copy_in_user)
58+
SYM_FUNC_START(__arch_copy_in_user)
5959
add end, x0, x2
6060
#include "copy_template.S"
6161
mov x0, #0
6262
ret
63-
ENDPROC(__arch_copy_in_user)
63+
SYM_FUNC_END(__arch_copy_in_user)
6464
EXPORT_SYMBOL(__arch_copy_in_user)
6565

6666
.section .fixup,"ax"

arch/arm64/lib/copy_page.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* x0 - dest
1818
* x1 - src
1919
*/
20-
ENTRY(copy_page)
20+
SYM_FUNC_START(copy_page)
2121
alternative_if ARM64_HAS_NO_HW_PREFETCH
2222
// Prefetch three cache lines ahead.
2323
prfm pldl1strm, [x1, #128]
@@ -75,5 +75,5 @@ alternative_else_nop_endif
7575
stnp x16, x17, [x0, #112 - 256]
7676

7777
ret
78-
ENDPROC(copy_page)
78+
SYM_FUNC_END(copy_page)
7979
EXPORT_SYMBOL(copy_page)

arch/arm64/lib/copy_to_user.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
.endm
5353

5454
end .req x5
55-
ENTRY(__arch_copy_to_user)
55+
SYM_FUNC_START(__arch_copy_to_user)
5656
add end, x0, x2
5757
#include "copy_template.S"
5858
mov x0, #0
5959
ret
60-
ENDPROC(__arch_copy_to_user)
60+
SYM_FUNC_END(__arch_copy_to_user)
6161
EXPORT_SYMBOL(__arch_copy_to_user)
6262

6363
.section .fixup,"ax"

arch/arm64/lib/crc32.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,17 @@ CPU_BE( rev16 w3, w3 )
8585
.endm
8686

8787
.align 5
88-
ENTRY(crc32_le)
88+
SYM_FUNC_START(crc32_le)
8989
alternative_if_not ARM64_HAS_CRC32
9090
b crc32_le_base
9191
alternative_else_nop_endif
9292
__crc32
93-
ENDPROC(crc32_le)
93+
SYM_FUNC_END(crc32_le)
9494

9595
.align 5
96-
ENTRY(__crc32c_le)
96+
SYM_FUNC_START(__crc32c_le)
9797
alternative_if_not ARM64_HAS_CRC32
9898
b __crc32c_le_base
9999
alternative_else_nop_endif
100100
__crc32 c
101-
ENDPROC(__crc32c_le)
101+
SYM_FUNC_END(__crc32c_le)

0 commit comments

Comments
 (0)