Message ID | 20221109045112.187069-7-bgray@linux.ibm.com (mailing list archive) |
---|---|
State | Accepted |
Commit | d34471c9bd5d47ab148dd68817631a4238f755c4 |
Headers | show |
Series | powerpc/code-patching: Use temporary mm for Radix MMU | expand |
Le 09/11/2022 à 05:51, Benjamin Gray a écrit : > These functions were introduced for "cxl: Enable global TLBIs for cxl > contexts" [1], which ended up using them for Radix only. They were never > implemented on Hash (and creating an implementation appears to be > difficult), so nothing can actually rely on them. > > They behave differently to the existing surrounding functions too, in > that they actually need to do something on Hash. The other functions > are primarily for use in generic code that expects their definitions, > but Hash updates the TLB during PTE updates. > > After replacing the only usage with the Radix specific version, there > are no more users of these functions, and given they are not implemented > anyway it is safe to delete them. > > [1]: https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170903181513.29635-1-fbarrat@linux.vnet.ibm.com/ > > Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Good cleanup Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> > --- > v10: * New in v10 to remove the hash__ set of functions > --- > .../include/asm/book3s/64/tlbflush-hash.h | 22 ------------------- > arch/powerpc/include/asm/book3s/64/tlbflush.h | 15 ------------- > 2 files changed, 37 deletions(-) > > diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h > index 38d31c2489d3..cdbb1a04bb52 100644 > --- a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h > +++ b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h > @@ -59,28 +59,6 @@ void flush_hash_range(unsigned long number, int local); > void flush_hash_hugepage(unsigned long vsid, unsigned long addr, pmd_t *pmdp, > unsigned int psize, int ssize, unsigned long flags); > > -static inline void hash__local_flush_all_mm(struct mm_struct *mm) > -{ > - /* > - * There's no Page Walk Cache for hash, so what is needed is > - * the same as flush_tlb_mm(), which doesn't really make sense > - * with hash. So the only thing we could do is flush the > - * entire LPID! Punt for now, as it's not being used. > - */ > - WARN_ON_ONCE(1); > -} > - > -static inline void hash__flush_all_mm(struct mm_struct *mm) > -{ > - /* > - * There's no Page Walk Cache for hash, so what is needed is > - * the same as flush_tlb_mm(), which doesn't really make sense > - * with hash. So the only thing we could do is flush the > - * entire LPID! Punt for now, as it's not being used. > - */ > - WARN_ON_ONCE(1); > -} > - > struct mmu_gather; > void hash__tlb_flush(struct mmu_gather *tlb); > > diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush.h b/arch/powerpc/include/asm/book3s/64/tlbflush.h > index 2254a40f0564..c56a0aee8124 100644 > --- a/arch/powerpc/include/asm/book3s/64/tlbflush.h > +++ b/arch/powerpc/include/asm/book3s/64/tlbflush.h > @@ -86,13 +86,6 @@ static inline void local_flush_tlb_page(struct vm_area_struct *vma, > radix__local_flush_tlb_page(vma, vmaddr); > } > > -static inline void local_flush_all_mm(struct mm_struct *mm) > -{ > - if (radix_enabled()) > - return radix__local_flush_all_mm(mm); > - return hash__local_flush_all_mm(mm); > -} > - > static inline void tlb_flush(struct mmu_gather *tlb) > { > if (radix_enabled()) > @@ -112,17 +105,9 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, > if (radix_enabled()) > radix__flush_tlb_page(vma, vmaddr); > } > - > -static inline void flush_all_mm(struct mm_struct *mm) > -{ > - if (radix_enabled()) > - return radix__flush_all_mm(mm); > - return hash__flush_all_mm(mm); > -} > #else > #define flush_tlb_mm(mm) local_flush_tlb_mm(mm) > #define flush_tlb_page(vma, addr) local_flush_tlb_page(vma, addr) > -#define flush_all_mm(mm) local_flush_all_mm(mm) > #endif /* CONFIG_SMP */ > > #define flush_tlb_fix_spurious_fault flush_tlb_fix_spurious_fault
diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h index 38d31c2489d3..cdbb1a04bb52 100644 --- a/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h +++ b/arch/powerpc/include/asm/book3s/64/tlbflush-hash.h @@ -59,28 +59,6 @@ void flush_hash_range(unsigned long number, int local); void flush_hash_hugepage(unsigned long vsid, unsigned long addr, pmd_t *pmdp, unsigned int psize, int ssize, unsigned long flags); -static inline void hash__local_flush_all_mm(struct mm_struct *mm) -{ - /* - * There's no Page Walk Cache for hash, so what is needed is - * the same as flush_tlb_mm(), which doesn't really make sense - * with hash. So the only thing we could do is flush the - * entire LPID! Punt for now, as it's not being used. - */ - WARN_ON_ONCE(1); -} - -static inline void hash__flush_all_mm(struct mm_struct *mm) -{ - /* - * There's no Page Walk Cache for hash, so what is needed is - * the same as flush_tlb_mm(), which doesn't really make sense - * with hash. So the only thing we could do is flush the - * entire LPID! Punt for now, as it's not being used. - */ - WARN_ON_ONCE(1); -} - struct mmu_gather; void hash__tlb_flush(struct mmu_gather *tlb); diff --git a/arch/powerpc/include/asm/book3s/64/tlbflush.h b/arch/powerpc/include/asm/book3s/64/tlbflush.h index 2254a40f0564..c56a0aee8124 100644 --- a/arch/powerpc/include/asm/book3s/64/tlbflush.h +++ b/arch/powerpc/include/asm/book3s/64/tlbflush.h @@ -86,13 +86,6 @@ static inline void local_flush_tlb_page(struct vm_area_struct *vma, radix__local_flush_tlb_page(vma, vmaddr); } -static inline void local_flush_all_mm(struct mm_struct *mm) -{ - if (radix_enabled()) - return radix__local_flush_all_mm(mm); - return hash__local_flush_all_mm(mm); -} - static inline void tlb_flush(struct mmu_gather *tlb) { if (radix_enabled()) @@ -112,17 +105,9 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, if (radix_enabled()) radix__flush_tlb_page(vma, vmaddr); } - -static inline void flush_all_mm(struct mm_struct *mm) -{ - if (radix_enabled()) - return radix__flush_all_mm(mm); - return hash__flush_all_mm(mm); -} #else #define flush_tlb_mm(mm) local_flush_tlb_mm(mm) #define flush_tlb_page(vma, addr) local_flush_tlb_page(vma, addr) -#define flush_all_mm(mm) local_flush_all_mm(mm) #endif /* CONFIG_SMP */ #define flush_tlb_fix_spurious_fault flush_tlb_fix_spurious_fault
These functions were introduced for "cxl: Enable global TLBIs for cxl contexts" [1], which ended up using them for Radix only. They were never implemented on Hash (and creating an implementation appears to be difficult), so nothing can actually rely on them. They behave differently to the existing surrounding functions too, in that they actually need to do something on Hash. The other functions are primarily for use in generic code that expects their definitions, but Hash updates the TLB during PTE updates. After replacing the only usage with the Radix specific version, there are no more users of these functions, and given they are not implemented anyway it is safe to delete them. [1]: https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170903181513.29635-1-fbarrat@linux.vnet.ibm.com/ Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> --- v10: * New in v10 to remove the hash__ set of functions --- .../include/asm/book3s/64/tlbflush-hash.h | 22 ------------------- arch/powerpc/include/asm/book3s/64/tlbflush.h | 15 ------------- 2 files changed, 37 deletions(-)