diff options
Diffstat (limited to 'include/asm-s390/pgtable.h')
-rw-r--r-- | include/asm-s390/pgtable.h | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h index 26215a97612..1039bf6b657 100644 --- a/include/asm-s390/pgtable.h +++ b/include/asm-s390/pgtable.h @@ -707,16 +707,19 @@ static inline void __ptep_ipte(unsigned long address, pte_t *ptep) pte_val(*ptep) = _PAGE_TYPE_EMPTY; } -static inline pte_t -ptep_clear_flush(struct vm_area_struct *vma, - unsigned long address, pte_t *ptep) +static inline void ptep_invalidate(unsigned long address, pte_t *ptep) { - pte_t pte = *ptep; - pte_t *shadow_pte = get_shadow_pte(ptep); - __ptep_ipte(address, ptep); - if (shadow_pte) - __ptep_ipte(address, shadow_pte); + ptep = get_shadow_pte(ptep); + if (ptep) + __ptep_ipte(address, ptep); +} + +static inline pte_t ptep_clear_flush(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep) +{ + pte_t pte = *ptep; + ptep_invalidate(address, ptep); return pte; } @@ -726,21 +729,14 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte)); } -static inline void -ptep_establish(struct vm_area_struct *vma, - unsigned long address, pte_t *ptep, - pte_t entry) -{ - ptep_clear_flush(vma, address, ptep); - set_pte(ptep, entry); -} - -#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty) \ -({ \ - int __changed = !pte_same(*(__ptep), __entry); \ - if (__changed) \ - ptep_establish(__vma, __address, __ptep, __entry); \ - __changed; \ +#define ptep_set_access_flags(__vma, __addr, __ptep, __entry, __dirty) \ +({ \ + int __changed = !pte_same(*(__ptep), __entry); \ + if (__changed) { \ + ptep_invalidate(__addr, __ptep); \ + set_pte_at((__vma)->vm_mm, __addr, __ptep, __entry); \ + } \ + __changed; \ }) /* @@ -940,7 +936,6 @@ extern int remove_shared_memory(unsigned long start, unsigned long size); #define __HAVE_ARCH_MEMMAP_INIT extern void memmap_init(unsigned long, int, unsigned long, unsigned long); -#define __HAVE_ARCH_PTEP_ESTABLISH #define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH |