Skip to content

Commit 6580a36

Browse files
jgoulywilldeacon
authored andcommitted
arm64: mask out POIndex when modifying a PTE
When a PTE is modified, the POIndex must be masked off so that it can be modified. Signed-off-by: Joey Gouly <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent b3c03fe commit 6580a36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/include/asm/pgtable.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,8 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
11031103
*/
11041104
const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY |
11051105
PTE_PRESENT_INVALID | PTE_VALID | PTE_WRITE |
1106-
PTE_GP | PTE_ATTRINDX_MASK;
1106+
PTE_GP | PTE_ATTRINDX_MASK | PTE_PO_IDX_MASK;
1107+
11071108
/* preserve the hardware dirty information */
11081109
if (pte_hw_dirty(pte))
11091110
pte = set_pte_bit(pte, __pgprot(PTE_DIRTY));

0 commit comments

Comments
 (0)