Commit 6580a36d authored by Joey Gouly's avatar Joey Gouly Committed by Will Deacon
Browse files

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: default avatarJoey Gouly <joey.gouly@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Reviewed-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20240822151113.1479789-16-joey.gouly@arm.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent b3c03fe1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1103,7 +1103,8 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
	 */
	const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY |
			      PTE_PRESENT_INVALID | PTE_VALID | PTE_WRITE |
			      PTE_GP | PTE_ATTRINDX_MASK;
			      PTE_GP | PTE_ATTRINDX_MASK | PTE_PO_IDX_MASK;

	/* preserve the hardware dirty information */
	if (pte_hw_dirty(pte))
		pte = set_pte_bit(pte, __pgprot(PTE_DIRTY));