Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: lib: Annotate {clear, copy}_page() as position-independent

clear_page() and copy_page() are suitable for use outside of the kernel
address space, so annotate them as position-independent code.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210319100146.1149909-2-qperret@google.com

authored by

Will Deacon and committed by
Marc Zyngier
8d990205 a1baa01f

+4 -4
+2 -2
arch/arm64/lib/clear_page.S
··· 14 14 * Parameters: 15 15 * x0 - dest 16 16 */ 17 - SYM_FUNC_START(clear_page) 17 + SYM_FUNC_START_PI(clear_page) 18 18 mrs x1, dczid_el0 19 19 and w1, w1, #0xf 20 20 mov x2, #4 ··· 25 25 tst x0, #(PAGE_SIZE - 1) 26 26 b.ne 1b 27 27 ret 28 - SYM_FUNC_END(clear_page) 28 + SYM_FUNC_END_PI(clear_page) 29 29 EXPORT_SYMBOL(clear_page)
+2 -2
arch/arm64/lib/copy_page.S
··· 17 17 * x0 - dest 18 18 * x1 - src 19 19 */ 20 - SYM_FUNC_START(copy_page) 20 + SYM_FUNC_START_PI(copy_page) 21 21 alternative_if ARM64_HAS_NO_HW_PREFETCH 22 22 // Prefetch three cache lines ahead. 23 23 prfm pldl1strm, [x1, #128] ··· 75 75 stnp x16, x17, [x0, #112 - 256] 76 76 77 77 ret 78 - SYM_FUNC_END(copy_page) 78 + SYM_FUNC_END_PI(copy_page) 79 79 EXPORT_SYMBOL(copy_page)