arm64: avoid dynamic relocations in early boot code
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Sat, 26 Dec 2015 11:46:40 +0000 (12:46 +0100)
committerAlex Shi <alex.shi@linaro.org>
Wed, 11 May 2016 14:52:52 +0000 (22:52 +0800)
commit63f9fbe469f17deee50491bc293bb3d2843f3e4a
tree1e52cc0c083fa1ae3ff0e07d39cd4df4ed73875c
parent9bd7f88a1dd7b6c513b6f7cf39154e69d0cbf62e
arm64: avoid dynamic relocations in early boot code

Before implementing KASLR for arm64 by building a self-relocating PIE
executable, we have to ensure that values we use before the relocation
routine is executed are not subject to dynamic relocation themselves.
This applies not only to virtual addresses, but also to values that are
supplied by the linker at build time and relocated using R_AARCH64_ABS64
relocations.

So instead, use assemble time constants, or force the use of static
relocations by folding the constants into the instructions.

Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 2bf31a4a05f5b00f37d65ba029d36a0230286cb7)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/kernel/efi-entry.S
arch/arm64/kernel/head.S