arm64: Fix pte_modify() to preserve the hardware dirty information
[cascardo/linux.git] / arch / arm64 / include / asm / pgtable.h
index 69207f0..31df98a 100644 (file)
@@ -503,7 +503,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
                              PTE_PROT_NONE | PTE_WRITE | PTE_TYPE_MASK;
        /* preserve the hardware dirty information */
        if (pte_hw_dirty(pte))
-               newprot |= PTE_DIRTY;
+               pte = pte_mkdirty(pte);
        pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask);
        return pte;
 }