]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: kernel: avoid literal load of virtual address with MMU off
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 17 Aug 2016 15:54:41 +0000 (17:54 +0200)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 17 Aug 2016 16:37:37 +0000 (17:37 +0100)
commitfbdc3ce4a7dc7e80156c4e3f4a1a6d7771215f47
tree31bb9bddbf43207842221dff70d83a21389e4e1f
parent08a1bead81a521e5dedd00a0abb5cb75717d355f
arm64: kernel: avoid literal load of virtual address with MMU off

Literal loads of virtual addresses are subject to runtime relocation when
CONFIG_RELOCATABLE=y, and given that the relocation routines run with the
MMU and caches enabled, literal loads of relocated values performed with
the MMU off are not guaranteed to return the latest value unless the
memory covering the literal is cleaned to the PoC explicitly.

So defer the literal load until after the MMU has been enabled, just like
we do for primary_switch() and secondary_switch() in head.S.

Fixes: a21c6c4760d2 ("arm64: add support for building vmlinux as a relocatable PIE binary")
Cc: <stable@vger.kernel.org> # 4.6+
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/sleep.S