]> git.baikalelectronics.ru Git - kernel.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)
commit5ecbf7f014b3a6e00d276d8c3e439a0bf6db5ec0
tree023f28096fec46dd5fc1b6c9141e8f5ed6f02e20
parentcb073534c277cf4c0d4eba8642bbfe78750fc20a
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