ARM: 9058/1: cache-v7: refactor v7_invalidate_l1 to avoid clobbering r5/r6
authorArd Biesheuvel <ardb@kernel.org>
Thu, 11 Feb 2021 08:23:09 +0000 (09:23 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Tue, 9 Mar 2021 10:25:18 +0000 (10:25 +0000)
commitf9e7a99fb6b86aa6a00e53b34ee6973840e005aa
tree4620fee2de35c3224d77328ccd3f5fc0540ca74e
parentc0e50736e826b51ddc437e6cf0dc68f07e4ad16b
ARM: 9058/1: cache-v7: refactor v7_invalidate_l1 to avoid clobbering r5/r6

The cache invalidation code in v7_invalidate_l1 can be tweaked to
re-read the associativity from CCSIDR, and keep the way identifier
component in a single register that is assigned in the outer loop. This
way, we need 2 registers less.

Given that the number of sets is typically much larger than the
associativity, rearrange the code so that the outer loop has the fewer
number of iterations, ensuring that the re-read of CCSIDR only occurs a
handful of times in practice.

Fix the whitespace while at it, and update the comment to indicate that
this code is no longer a clone of anything else.

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/mm/cache-v7.S