|
15 | 15 | #define __HAVE_ARCH_PUD_FREE
|
16 | 16 | #include <asm-generic/pgalloc.h>
|
17 | 17 |
|
18 |
| -/* |
19 |
| - * While riscv platforms with riscv_ipi_for_rfence as true require an IPI to |
20 |
| - * perform TLB shootdown, some platforms with riscv_ipi_for_rfence as false use |
21 |
| - * SBI to perform TLB shootdown. To keep software pagetable walkers safe in this |
22 |
| - * case we switch to RCU based table free (MMU_GATHER_RCU_TABLE_FREE). See the |
23 |
| - * comment below 'ifdef CONFIG_MMU_GATHER_RCU_TABLE_FREE' in include/asm-generic/tlb.h |
24 |
| - * for more details. |
25 |
| - */ |
26 |
| -static inline void riscv_tlb_remove_ptdesc(struct mmu_gather *tlb, void *pt) |
27 |
| -{ |
28 |
| - if (riscv_use_sbi_for_rfence()) { |
29 |
| - tlb_remove_ptdesc(tlb, pt); |
30 |
| - } else { |
31 |
| - pagetable_dtor(pt); |
32 |
| - tlb_remove_page_ptdesc(tlb, pt); |
33 |
| - } |
34 |
| -} |
35 |
| - |
36 | 18 | static inline void pmd_populate_kernel(struct mm_struct *mm,
|
37 | 19 | pmd_t *pmd, pte_t *pte)
|
38 | 20 | {
|
@@ -108,14 +90,14 @@ static inline void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
|
108 | 90 | unsigned long addr)
|
109 | 91 | {
|
110 | 92 | if (pgtable_l4_enabled)
|
111 |
| - riscv_tlb_remove_ptdesc(tlb, virt_to_ptdesc(pud)); |
| 93 | + tlb_remove_ptdesc(tlb, virt_to_ptdesc(pud)); |
112 | 94 | }
|
113 | 95 |
|
114 | 96 | static inline void __p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d,
|
115 | 97 | unsigned long addr)
|
116 | 98 | {
|
117 | 99 | if (pgtable_l5_enabled)
|
118 |
| - riscv_tlb_remove_ptdesc(tlb, virt_to_ptdesc(p4d)); |
| 100 | + tlb_remove_ptdesc(tlb, virt_to_ptdesc(p4d)); |
119 | 101 | }
|
120 | 102 | #endif /* __PAGETABLE_PMD_FOLDED */
|
121 | 103 |
|
@@ -143,15 +125,15 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
|
143 | 125 | static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
|
144 | 126 | unsigned long addr)
|
145 | 127 | {
|
146 |
| - riscv_tlb_remove_ptdesc(tlb, virt_to_ptdesc(pmd)); |
| 128 | + tlb_remove_ptdesc(tlb, virt_to_ptdesc(pmd)); |
147 | 129 | }
|
148 | 130 |
|
149 | 131 | #endif /* __PAGETABLE_PMD_FOLDED */
|
150 | 132 |
|
151 | 133 | static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
|
152 | 134 | unsigned long addr)
|
153 | 135 | {
|
154 |
| - riscv_tlb_remove_ptdesc(tlb, page_ptdesc(pte)); |
| 136 | + tlb_remove_ptdesc(tlb, page_ptdesc(pte)); |
155 | 137 | }
|
156 | 138 | #endif /* CONFIG_MMU */
|
157 | 139 |
|
|
0 commit comments