Fixup page directory freeing
Status from this message: [merged] asm-generic-tlb-provide-mmu_gather_table_free.patch removed from -mm tree
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest9 patches 5 repliesApplied 9/9
- v39 patches 4 repliesSuperseded
- v23 patches 6 repliesSuperseded
Changes in v4 from the cover letter
* Added Cc:stable for first two patches
* Explained why we have sparc related changes in patch 2
Patches in v4 All 9 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | powerpc/mmu_gather: Enable RCU_TABLE_FREE even for !SMP casearch/ arch/ arch/ +2 more | +1 | 1 reply | Applied |
| 2/9 | mm/mmu_gather: Invalidate TLB correctly on batch allocation failure and flusharch/ arch/ arch/ +4 more | +43 | 1 reply | Applied |
| 3/9 | asm-generic/tlb: Avoid potential double flushinclude/ | +6 | 2 replies | Applied |
| 4/9 | asm-gemeric/tlb: Remove stray function declarationsinclude/ | +0 | 0 replies | Applied |
| 5/9 | asm-generic/tlb: Add missing CONFIG symbolarch/ | +3 | 0 replies | Applied |
| 6/9 | asm-generic/tlb: Rename HAVE_RCU_TABLE_FREEarch/ arch/ arch/ +10 more | +21 | 1 reply | Applied |
| 7/9 | asm-generic/tlb: Rename HAVE_MMU_GATHER_PAGE_SIZEarch/ arch/ include/ +1 more | +10 | 0 replies | Applied |
| 8/9 | asm-generic/tlb: Rename HAVE_MMU_GATHER_NO_GATHERarch/ arch/ include/ +1 more | +19 | 0 replies | Applied |
| 9/9 | asm-generic/tlb: Provide MMU_GATHER_TABLE_FREEarch/ arch/ include/ +1 more | +130 | 0 replies | Applied |
Reviews trailers per patch
2 of 9 patches have a Reviewed-by or Acked-by.
| Patch | Peter Zijlstra (Intel) | Michael Ellerman |
|---|---|---|
| 1/9 | A-b | A-b |
| 2/9 | A-b | |
| 3/9 | ||
| 4/9 | ||
| 5/9 | ||
| 6/9 | ||
| 7/9 | ||
| 8/9 | ||
| 9/9 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/9] Fixup page directory freeing
This is a repost of patch series from Peter with the arch specific changes except ppc64 dropped. ppc64 changes are added here because we are redoing the patch series on top of ppc64 changes. This makes it easy to backport these changes. Only the first 2 patches need to be backported to stable.
The thing is, on anything SMP, freeing page directories should observe the exact same order as normal page freeing:
1) unhook page/directory
2) TLB invalidate
3) free page/directory
Without this, any concurrent page-table walk could end up with a Use-after-Free. This is esp. trivial for anything that has software page-table walkers (HAVE_FAST_GUP / software TLB fill) or the hardware caches partial page-walks (ie. caches page directories).
Even on UP this might give issues since mmu_gather is preemptible these days. An interrupt or preempted task accessing user pages might stumble into the free page if the hardware caches page directories.
This patch series fixup ppc64 and add generic MMU_GATHER changes to support the conversion of other architectures. I haven't added patches w.r.t other architecture because they are yet to be acked.
Changes from V3:
* Added Cc:stable for first two patches
* Explained why we have sparc related changes in patch 2
Aneesh Kumar K.V (1):
powerpc/mmu_gather: Enable RCU_TABLE_FREE even for !SMP case
Peter Zijlstra (8):
mm/mmu_gather: Invalidate TLB correctly on batch allocation failure
and flush
asm-generic/tlb: Avoid potential double flush asm-gemeric/tlb: Remove stray function declarations asm-generic/tlb: Add missing CONFIG symbol asm-generic/tlb: Rename HAVE_RCU_TABLE_FREE asm-generic/tlb: Rename HAVE_MMU_GATHER_PAGE_SIZE asm-generic/tlb: Rename HAVE_MMU_GATHER_NO_GATHER asm-generic/tlb: Provide MMU_GATHER_TABLE_FREE
arch/Kconfig | 13 +- arch/arm/Kconfig | 2 +- arch/arm/include/asm/tlb.h | 4 - arch/arm64/Kconfig | 2 +- arch/powerpc/Kconfig | 5 +- arch/powerpc/include/asm/book3s/32/pgalloc.h | 8 -- arch/powerpc/include/asm/book3s/64/pgalloc.h | 2 - arch/powerpc/include/asm/nohash/pgalloc.h | 8 -- arch/powerpc/include/asm/tlb.h | 11 ++ arch/powerpc/mm/book3s64/pgtable.c | 7 - arch/s390/Kconfig | 4 +- arch/sparc/Kconfig | 3 +- arch/sparc/include/asm/tlb_64.h | 9 ++ arch/x86/Kconfig | 2 +- arch/x86/include/asm/tlb.h | 4 +- include/asm-generic/tlb.h | 120 ++++++++++------- mm/gup.c | 2 +- mm/mmu_gather.c | 134 +++++++++++++------ 18 files changed, 207 insertions(+), 133 deletions(-)
Signature · 1 line
2.24.1