Skip to content

Commit

Permalink
arm64: Switch to adrp for loading the stub vectors
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Marc Zyngier <[email protected]>
Tested-by: Mark Rutland <[email protected]>
Tested-by: Kees Cook <[email protected]>
Signed-off-by: Laura Abbott <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
labbott authored and wildea01 committed Nov 25, 2014
1 parent fcff588 commit ac2dec5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm64/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,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 */
Expand Down

0 comments on commit ac2dec5

Please sign in to comment.