Skip to content

Commit

Permalink
arm64: enable Permission Indirection Extension (PIE)
Browse files Browse the repository at this point in the history
Now that the necessary changes have been made, set the Permission Indirection
registers and enable the Permission Indirection Extension.

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20230606145859.697944-17-joey.gouly@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Joey Gouly authored and Catalin Marinas committed Jun 6, 2023
1 parent eeda243 commit 9e9bb6e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arch/arm64/mm/proc.S
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,21 @@ SYM_FUNC_START(__cpu_setup)
#endif /* CONFIG_ARM64_HW_AFDBM */
msr mair_el1, mair
msr tcr_el1, tcr

mrs_s x1, SYS_ID_AA64MMFR3_EL1
ubfx x1, x1, #ID_AA64MMFR3_EL1_S1PIE_SHIFT, #4
cbz x1, .Lskip_indirection

mov_q x0, PIE_E0
msr REG_PIRE0_EL1, x0
mov_q x0, PIE_E1
msr REG_PIR_EL1, x0

mov x0, TCR2_EL1x_PIE
msr REG_TCR2_EL1, x0

.Lskip_indirection:

/*
* Prepare SCTLR
*/
Expand Down

0 comments on commit 9e9bb6e

Please sign in to comment.