]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 8191/1: decompressor: ensure I-side picks up relocated code
authorWill Deacon <will.deacon@arm.com>
Tue, 4 Nov 2014 10:40:46 +0000 (11:40 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 13 Nov 2014 23:45:20 +0000 (23:45 +0000)
commitdf509ac631c1d3fd0a473778694e301eb9142c0e
tree4dcd3ffbc4dbbad6d78280ffd209dcb29962ef55
parentf700a23d0e0fc1645d8a98c9c7944b27bb7c88bc
ARM: 8191/1: decompressor: ensure I-side picks up relocated code

To speed up decompression, the decompressor sets up a flat, cacheable
mapping of memory. However, when there is insufficient space to hold
the page tables for this mapping, we don't bother to enable the caches
and subsequently skip all the cache maintenance hooks.

Skipping the cache maintenance before jumping to the relocated code
allows the processor to predict the branch and populate the I-cache
with stale data before the relocation loop has completed (since a
bootloader may have SCTLR.I set, which permits normal, cacheable
instruction fetches regardless of SCTLR.M).

This patch moves the cache maintenance check into the maintenance
routines themselves, allowing the v6/v7 versions to invalidate the
I-cache regardless of the MMU state.

Cc: <stable@vger.kernel.org>
Reported-by: Marc Carino <marc.ceeeee@gmail.com>
Tested-by: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/boot/compressed/head.S