|
@@ -85,11 +85,7 @@ extern unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)];
|
|
(__boundary - 1 < (end) - 1) ? __boundary : (end); \
|
|
(__boundary - 1 < (end) - 1) ? __boundary : (end); \
|
|
})
|
|
})
|
|
|
|
|
|
-#ifdef CONFIG_ARM64_HW_AFDBM
|
|
|
|
#define pte_hw_dirty(pte) (pte_write(pte) && !(pte_val(pte) & PTE_RDONLY))
|
|
#define pte_hw_dirty(pte) (pte_write(pte) && !(pte_val(pte) & PTE_RDONLY))
|
|
-#else
|
|
|
|
-#define pte_hw_dirty(pte) (0)
|
|
|
|
-#endif
|
|
|
|
#define pte_sw_dirty(pte) (!!(pte_val(pte) & PTE_DIRTY))
|
|
#define pte_sw_dirty(pte) (!!(pte_val(pte) & PTE_DIRTY))
|
|
#define pte_dirty(pte) (pte_sw_dirty(pte) || pte_hw_dirty(pte))
|
|
#define pte_dirty(pte) (pte_sw_dirty(pte) || pte_hw_dirty(pte))
|
|
|
|
|
|
@@ -228,8 +224,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
|
|
* hardware updates of the pte (ptep_set_access_flags safely changes
|
|
* hardware updates of the pte (ptep_set_access_flags safely changes
|
|
* valid ptes without going through an invalid entry).
|
|
* valid ptes without going through an invalid entry).
|
|
*/
|
|
*/
|
|
- if (IS_ENABLED(CONFIG_ARM64_HW_AFDBM) &&
|
|
|
|
- pte_valid(*ptep) && pte_valid(pte)) {
|
|
|
|
|
|
+ if (pte_valid(*ptep) && pte_valid(pte)) {
|
|
VM_WARN_ONCE(!pte_young(pte),
|
|
VM_WARN_ONCE(!pte_young(pte),
|
|
"%s: racy access flag clearing: 0x%016llx -> 0x%016llx",
|
|
"%s: racy access flag clearing: 0x%016llx -> 0x%016llx",
|
|
__func__, pte_val(*ptep), pte_val(pte));
|
|
__func__, pte_val(*ptep), pte_val(pte));
|
|
@@ -565,7 +560,6 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
|
|
return pte_pmd(pte_modify(pmd_pte(pmd), newprot));
|
|
return pte_pmd(pte_modify(pmd_pte(pmd), newprot));
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef CONFIG_ARM64_HW_AFDBM
|
|
|
|
#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
|
|
#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
|
|
extern int ptep_set_access_flags(struct vm_area_struct *vma,
|
|
extern int ptep_set_access_flags(struct vm_area_struct *vma,
|
|
unsigned long address, pte_t *ptep,
|
|
unsigned long address, pte_t *ptep,
|
|
@@ -670,7 +664,6 @@ static inline void pmdp_set_wrprotect(struct mm_struct *mm,
|
|
ptep_set_wrprotect(mm, address, (pte_t *)pmdp);
|
|
ptep_set_wrprotect(mm, address, (pte_t *)pmdp);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
-#endif /* CONFIG_ARM64_HW_AFDBM */
|
|
|
|
|
|
|
|
extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
|
|
extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
|
|
extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
|
|
extern pgd_t idmap_pg_dir[PTRS_PER_PGD];
|