aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/lib
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2016-09-07 06:07:09 -0400
committerWill Deacon <will.deacon@arm.com>2016-09-12 05:46:07 -0400
commit6ba3b554f5b9b53cb99c0edb93f0ea855fbc712a (patch)
treee9dc583beb65d3deb66fa72184afe4ed8550f9af /arch/arm64/lib
parent792d47379f4d4c76692f1795f33d38582f8907fa (diff)
arm64: use alternative auto-nop
Make use of the new alternative_if and alternative_else_nop_endif and get rid of our homebew NOP sleds, making the code simpler to read. Note that for cpu_do_switch_mm the ret has been moved out of the alternative sequence, and in the default case there will be three additional NOPs executed. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: James Morse <james.morse@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/lib')
-rw-r--r--arch/arm64/lib/copy_page.S13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/arm64/lib/copy_page.S b/arch/arm64/lib/copy_page.S
index 4c1e700840b6..c3cd65e31814 100644
--- a/arch/arm64/lib/copy_page.S
+++ b/arch/arm64/lib/copy_page.S
@@ -29,14 +29,11 @@
29 * x1 - src 29 * x1 - src
30 */ 30 */
31ENTRY(copy_page) 31ENTRY(copy_page)
32alternative_if_not ARM64_HAS_NO_HW_PREFETCH 32alternative_if ARM64_HAS_NO_HW_PREFETCH
33 nop
34 nop
35alternative_else
36 # Prefetch two cache lines ahead. 33 # Prefetch two cache lines ahead.
37 prfm pldl1strm, [x1, #128] 34 prfm pldl1strm, [x1, #128]
38 prfm pldl1strm, [x1, #256] 35 prfm pldl1strm, [x1, #256]
39alternative_endif 36alternative_else_nop_endif
40 37
41 ldp x2, x3, [x1] 38 ldp x2, x3, [x1]
42 ldp x4, x5, [x1, #16] 39 ldp x4, x5, [x1, #16]
@@ -52,11 +49,9 @@ alternative_endif
521: 491:
53 subs x18, x18, #128 50 subs x18, x18, #128
54 51
55alternative_if_not ARM64_HAS_NO_HW_PREFETCH 52alternative_if ARM64_HAS_NO_HW_PREFETCH
56 nop
57alternative_else
58 prfm pldl1strm, [x1, #384] 53 prfm pldl1strm, [x1, #384]
59alternative_endif 54alternative_else_nop_endif
60 55
61 stnp x2, x3, [x0] 56 stnp x2, x3, [x0]
62 ldp x2, x3, [x1] 57 ldp x2, x3, [x1]