diff options
authorLaura Abbott <lauraa@codeaurora.org>2014-11-21 21:50:39 +0000
committerKees Cook <keescook@google.com>2015-10-07 13:11:58 -0700
commitded3940586eaa0a2527e4c44cb33c7ef676639ae (patch)
parente025cf3e255ff6aa000c148e3f31e6f285d361b6 (diff)
UPSTREAM: arm64: Switch to adrp for loading the stub vectors
The hyp stub vectors are currently loaded using adr. This instruction has a +/- 1MB range for the loading address. If the alignment for sections is changed the address may be more than 1MB away, resulting in reclocation errors. Switch to using adrp for getting the address to ensure we aren't affected by the location of the __hyp_stub_vectors. Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Marc Zyngier <marc.zyngier@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Kees Cook <keescook@chromium.org> Signed-off-by: Laura Abbott <lauraa@codeaurora.org> Signed-off-by: Will Deacon <will.deacon@arm.com> (cherry picked from commit ac2dec5f6c27a581f8571da605d9ba04df18330d) Signed-off-by: Tomasz Figa <tfiga@chromium.org> Bug: 24475017 Change-Id: I40ad3adfa5773e8ee22f53fb755143fdd7db0487 Signed-off-by: Kees Cook <keescook@google.com>
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 0a6e4f924df8..10f5cc0889bb 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -331,7 +331,8 @@ CPU_LE( movk x0, #0x30d0, lsl #16 ) // Clear EE and E0E on LE systems
msr vttbr_el2, xzr
/* Hypervisor stub */
- adr x0, __hyp_stub_vectors
+ adrp x0, __hyp_stub_vectors
+ add x0, x0, #:lo12:__hyp_stub_vectors
msr vbar_el2, x0
/* spsr */