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 <joey.gouly@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Will Deacon <will@kernel.org> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com> Link: https://lore.kernel.org/r/20240822151113.1479789-16-joey.gouly@arm.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent b3c03fe commit 6580a36

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)