diff options
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r-- | arch/powerpc/mm/pgtable-radix.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c index ce24d72ea679..a6eec41dd347 100644 --- a/arch/powerpc/mm/pgtable-radix.c +++ b/arch/powerpc/mm/pgtable-radix.c @@ -1084,3 +1084,25 @@ int radix__has_transparent_hugepage(void) return 0; } #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ + +void radix__ptep_set_access_flags(struct mm_struct *mm, + pte_t *ptep, pte_t entry, + unsigned long address) +{ + unsigned long set = pte_val(entry) & (_PAGE_DIRTY | _PAGE_ACCESSED | + _PAGE_RW | _PAGE_EXEC); + + if (cpu_has_feature(CPU_FTR_POWER9_DD1)) { + unsigned long old_pte, new_pte; + + old_pte = __radix_pte_update(ptep, ~0, 0); + /* + * new value of pte + */ + new_pte = old_pte | set; + radix__flush_tlb_pte_p9_dd1(old_pte, mm, address); + __radix_pte_update(ptep, 0, new_pte); + } else + __radix_pte_update(ptep, 0, set); + asm volatile("ptesync" : : : "memory"); +} |