ARM: 7953/1: mm: ensure TLB invalidation is complete before enabling MMU
authorWill Deacon <will.deacon@arm.com>
Fri, 7 Feb 2014 18:12:20 +0000 (19:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 05:30:01 +0000 (21:30 -0800)
commit1266f2d31159a79507aa299defeee54afccf1e15
tree6f9b3b8e31b7a30a42f0dff8e1a5756f39ae45df
parent1dca10b4c8528298fe5cf40cdbf4a480f9b0a429
ARM: 7953/1: mm: ensure TLB invalidation is complete before enabling MMU

commit bae0ca2bc550d1ec6a118fb8f2696f18c4da3d8e upstream.

During __v{6,7}_setup, we invalidate the TLBs since we are about to
enable the MMU on return to head.S. Unfortunately, without a subsequent
dsb instruction, the invalidation is not guaranteed to have completed by
the time we write to the sctlr, potentially exposing us to junk/stale
translations cached in the TLB.

This patch reworks the init functions so that the dsb used to ensure
completion of cache/predictor maintenance is also used to ensure
completion of the TLB invalidation.

Reported-by: Albin Tonnerre <Albin.Tonnerre@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mm/proc-v6.S
arch/arm/mm/proc-v7.S