Skip to content

Commit d0d6e7e

Browse files
jgoulywilldeacon
authored andcommitted
arm64: enable POE and PIE to coexist
Permission Indirection Extension and Permission Overlay Extension can be enabled independently. When PIE is disabled and POE is enabled, the permissions set by POR_EL0 will be applied on top of the permissions set in the PTE. When both PIE and POE are enabled, the permissions set by POR_EL0 will be applied on top of the permissions set by the PIRE0_EL1 register. However PIRE0_EL1 has encodings that specifically enable and disable the overlay from applying. For example: 0001 Read, Overlay applied. 1000 Read, Overlay not applied. Switch to using the 'Overlay applied' encodings in PIRE0_EL1, so that PIE and POE can coexist. Signed-off-by: Joey Gouly <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 1751981 commit d0d6e7e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/arm64/include/asm/pgtable-prot.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ static inline bool __pure lpa2_is_enabled(void)
154154

155155
#define PIE_E0 ( \
156156
PIRx_ELx_PERM(pte_pi_index(_PAGE_EXECONLY), PIE_X_O) | \
157-
PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY_EXEC), PIE_RX) | \
158-
PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED_EXEC), PIE_RWX) | \
159-
PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY), PIE_R) | \
160-
PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED), PIE_RW))
157+
PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY_EXEC), PIE_RX_O) | \
158+
PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED_EXEC), PIE_RWX_O) | \
159+
PIRx_ELx_PERM(pte_pi_index(_PAGE_READONLY), PIE_R_O) | \
160+
PIRx_ELx_PERM(pte_pi_index(_PAGE_SHARED), PIE_RW_O))
161161

162162
#define PIE_E1 ( \
163163
PIRx_ELx_PERM(pte_pi_index(_PAGE_EXECONLY), PIE_NONE_O) | \

0 commit comments

Comments
 (0)