diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-04-03 06:25:39 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-04-14 17:26:52 -0400 |
commit | d3cd451dfb579367b4c5968256b3d8342dd0b0e8 (patch) | |
tree | fa411df2beabfe0378906882f026c03560ea1b97 /arch/arm/mm | |
parent | cd8b24d9e852b53e68c69a086358c81423dfb8d1 (diff) |
ARM: cache-v7: optimise branches in v7_flush_cache_louis
Optimise the branches such that for the majority of unaffected devices,
we avoid needing to execute the errata work-around code path by
branching to start_flush_levels early.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/cache-v7.S | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index 5b5d0c00bca7..793d061b4dce 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S | |||
@@ -93,17 +93,18 @@ ENTRY(v7_flush_dcache_louis) | |||
93 | ALT_SMP(mov r3, r0, lsr #20) @ move LoUIS into position | 93 | ALT_SMP(mov r3, r0, lsr #20) @ move LoUIS into position |
94 | ALT_UP( mov r3, r0, lsr #26) @ move LoUU into position | 94 | ALT_UP( mov r3, r0, lsr #26) @ move LoUU into position |
95 | ands r3, r3, #7 << 1 @ extract LoU*2 field from clidr | 95 | ands r3, r3, #7 << 1 @ extract LoU*2 field from clidr |
96 | bne start_flush_levels @ LoU != 0, start flushing | ||
96 | #ifdef CONFIG_ARM_ERRATA_643719 | 97 | #ifdef CONFIG_ARM_ERRATA_643719 |
97 | ALT_SMP(mrceq p15, 0, r2, c0, c0, 0) @ read main ID register | 98 | ALT_SMP(mrc p15, 0, r2, c0, c0, 0) @ read main ID register |
98 | ALT_UP(reteq lr) @ LoUU is zero, so nothing to do | 99 | ALT_UP( ret lr) @ LoUU is zero, so nothing to do |
99 | movweq r1, #:lower16:0x410fc090 @ ID of ARM Cortex A9 r0p? | 100 | movw r1, #:lower16:0x410fc090 @ ID of ARM Cortex A9 r0p? |
100 | movteq r1, #:upper16:0x410fc090 | 101 | movt r1, #:upper16:0x410fc090 |
101 | biceq r2, r2, #0x0000000f @ clear minor revision number | 102 | bic r2, r2, #0x0000000f @ clear minor revision number |
102 | teqeq r2, r1 @ test for errata affected core and if so... | 103 | teq r2, r1 @ test for errata affected core and if so... |
103 | moveqs r3, #1 << 1 @ fix LoUIS value (and set flags state to 'ne') | 104 | moveq r3, #1 << 1 @ fix LoUIS value |
105 | beq start_flush_levels @ start flushing cache levels | ||
104 | #endif | 106 | #endif |
105 | reteq lr @ return if level == 0 | 107 | ret lr |
106 | b start_flush_levels @ start flushing cache levels | ||
107 | ENDPROC(v7_flush_dcache_louis) | 108 | ENDPROC(v7_flush_dcache_louis) |
108 | 109 | ||
109 | /* | 110 | /* |