]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerJiri Slaby <jslaby@suse.cz>
Wed, 19 Nov 2014 17:38:19 +0000 (18:38 +0100)
commitf0a72a0e7c682320fa38e71612008de3e3d796ca
tree8987f1dbbd08df327a34da9a2af4ec168175fa43
parentd8149279a2ec936d50ab54e51b803477fefc55dd
ARM: 8191/1: decompressor: ensure I-side picks up relocated code

commit 238962ac71910d6c20162ea5230685fead1836a4 upstream.

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.

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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/arm/boot/compressed/head.S