arm64: assembler: make adr_l work in modules under KASLR
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Wed, 11 Jan 2017 14:54:53 +0000 (14:54 +0000)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 03:05:52 +0000 (03:05 +0000)
commit6cdc7e9487857c155fa7b3fbc9a4a1c72409ffc6
tree1ba6302281d529e05b16655af901ff5cd7081f72
parent14e21b6c2a0af4bef07bd0fee8ee683813390227
arm64: assembler: make adr_l work in modules under KASLR

[ Upstream commit 41c066f2c4d436c535616fe182331766c57838f0 ]

When CONFIG_RANDOMIZE_MODULE_REGION_FULL=y, the offset between loaded
modules and the core kernel may exceed 4 GB, putting symbols exported
by the core kernel out of the reach of the ordinary adrp/add instruction
pairs used to generate relative symbol references. So make the adr_l
macro emit a movz/movk sequence instead when executing in module context.

While at it, remove the pointless special case for the stack pointer.

Acked-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/assembler.h