0001
0002 #ifndef _S390_TLB_H
0003 #define _S390_TLB_H
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 void __tlb_remove_table(void *_table);
0026 static inline void tlb_flush(struct mmu_gather *tlb);
0027 static inline bool __tlb_remove_page_size(struct mmu_gather *tlb,
0028 struct page *page, int page_size);
0029
0030 #define tlb_flush tlb_flush
0031 #define pte_free_tlb pte_free_tlb
0032 #define pmd_free_tlb pmd_free_tlb
0033 #define p4d_free_tlb p4d_free_tlb
0034 #define pud_free_tlb pud_free_tlb
0035
0036 #include <asm/tlbflush.h>
0037 #include <asm-generic/tlb.h>
0038
0039
0040
0041
0042
0043
0044 static inline bool __tlb_remove_page_size(struct mmu_gather *tlb,
0045 struct page *page, int page_size)
0046 {
0047 free_page_and_swap_cache(page);
0048 return false;
0049 }
0050
0051 static inline void tlb_flush(struct mmu_gather *tlb)
0052 {
0053 __tlb_flush_mm_lazy(tlb->mm);
0054 }
0055
0056
0057
0058
0059
0060 static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
0061 unsigned long address)
0062 {
0063 __tlb_adjust_range(tlb, address, PAGE_SIZE);
0064 tlb->mm->context.flush_mm = 1;
0065 tlb->freed_tables = 1;
0066 tlb->cleared_pmds = 1;
0067
0068
0069
0070
0071
0072 page_table_free_rcu(tlb, (unsigned long *) pte, address);
0073 }
0074
0075
0076
0077
0078
0079
0080
0081
0082 static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
0083 unsigned long address)
0084 {
0085 if (mm_pmd_folded(tlb->mm))
0086 return;
0087 pgtable_pmd_page_dtor(virt_to_page(pmd));
0088 __tlb_adjust_range(tlb, address, PAGE_SIZE);
0089 tlb->mm->context.flush_mm = 1;
0090 tlb->freed_tables = 1;
0091 tlb->cleared_puds = 1;
0092 tlb_remove_table(tlb, pmd);
0093 }
0094
0095
0096
0097
0098
0099
0100
0101
0102 static inline void p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d,
0103 unsigned long address)
0104 {
0105 if (mm_p4d_folded(tlb->mm))
0106 return;
0107 __tlb_adjust_range(tlb, address, PAGE_SIZE);
0108 tlb->mm->context.flush_mm = 1;
0109 tlb->freed_tables = 1;
0110 tlb_remove_table(tlb, p4d);
0111 }
0112
0113
0114
0115
0116
0117
0118
0119
0120 static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
0121 unsigned long address)
0122 {
0123 if (mm_pud_folded(tlb->mm))
0124 return;
0125 tlb->mm->context.flush_mm = 1;
0126 tlb->freed_tables = 1;
0127 tlb->cleared_p4ds = 1;
0128 tlb_remove_table(tlb, pud);
0129 }
0130
0131
0132 #endif