]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 12 Apr 2019 21:34:18 +0000 (22:34 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Tue, 23 Apr 2019 16:28:37 +0000 (17:28 +0100)
commite17b1af96b2afc38e684aa2f1033387e2ed10029
tree023f28096fec46dd5fc1b6c9141e8f5ed6f02e20
parentc3143967807adb1357c36b68a7563fc0c4e1f615
ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache

The EFI stub is entered with the caches and MMU enabled by the
firmware, and once the stub is ready to hand over to the decompressor,
we clean and disable the caches.

The cache clean routines use CP15 barrier instructions, which can be
disabled via SCTLR. Normally, when using the provided cache handling
routines to enable the caches and MMU, this bit is enabled as well.
However, but since we entered the stub with the caches already enabled,
this routine is not executed before we call the cache clean routines,
resulting in undefined instruction exceptions if the firmware never
enabled this bit.

So set the bit explicitly in the EFI entry code, but do so in a way that
guarantees that the resulting code can still run on v6 cores as well
(which are guaranteed to have CP15 barriers enabled)

Cc: <stable@vger.kernel.org> # v4.9+
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/boot/compressed/head.S