ARM: 9059/1: cache-v7: get rid of mini-stack
authorArd Biesheuvel <ardb@kernel.org>
Thu, 11 Feb 2021 08:25:34 +0000 (09:25 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Tue, 9 Mar 2021 10:25:18 +0000 (10:25 +0000)
commit95731b8ee63ec9419822a51cd9878fa32582fdd2
tree64c4734315d802c18d6f8346246fe274457c71ec
parentf9e7a99fb6b86aa6a00e53b34ee6973840e005aa
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>
arch/arm/include/asm/memory.h
arch/arm/mm/cache-v7.S
arch/arm/mm/proc-v7.S