summaryrefslogtreecommitdiff
path: root/arch/arm/mm/cache-v7.S
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2021-02-11 11:25:34 +0300
committerRussell King <rmk+kernel@armlinux.org.uk>2021-03-09 13:25:18 +0300
commit95731b8ee63ec9419822a51cd9878fa32582fdd2 (patch)
tree64c4734315d802c18d6f8346246fe274457c71ec /arch/arm/mm/cache-v7.S
parentf9e7a99fb6b86aa6a00e53b34ee6973840e005aa (diff)
downloadlinux-95731b8ee63ec9419822a51cd9878fa32582fdd2.tar.xz
ARM: 9059/1: cache-v7: get rid of mini-stack
Now that we have reduced the number of registers that we need to preserve when calling v7_invalidate_l1 from the boot code, we can use scratch registers to preserve the remaining ones, and get rid of the mini stack entirely. This works around any issues regarding cache behavior in relation to the uncached accesses to this memory, which is hard to get right in the general case (i.e., both bare metal and under virtualization) While at it, switch v7_invalidate_l1 to using ip as a scratch register instead of r4. This makes the function AAPCS compliant, and removes the need to stash r4 in ip across the call. Acked-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/mm/cache-v7.S')
-rw-r--r--arch/arm/mm/cache-v7.S10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index 76201ee9ee59..830bbfb26ca5 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -53,12 +53,12 @@ ENTRY(v7_invalidate_l1)
and r2, r0, #0x7
add r2, r2, #4 @ SetShift
-1: movw r4, #0x7fff
- and r0, r4, r0, lsr #13 @ 'NumSets' in CCSIDR[27:13]
+1: movw ip, #0x7fff
+ and r0, ip, r0, lsr #13 @ 'NumSets' in CCSIDR[27:13]
-2: mov r4, r0, lsl r2 @ NumSet << SetShift
- orr r4, r4, r3 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
- mcr p15, 0, r4, c7, c6, 2
+2: mov ip, r0, lsl r2 @ NumSet << SetShift
+ orr ip, ip, r3 @ Reg = (Temp<<WayShift)|(NumSets<<SetShift)
+ mcr p15, 0, ip, c7, c6, 2
subs r0, r0, #1 @ Set--
bpl 2b
subs r3, r3, r1 @ Way--