Fixup page directory freeing
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest11 patches 2 repliesIn review
- v117 patches 19 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/11 | asm-generic/tlb: Fix MMU_GATHER_TABLE_FREEinclude/ | +19 | 1 reply | |
| 2/11 | sh/tlb: Fix PGTABLE_LEVELS > 2arch/ | +1 | 0 replies | |
| 3/11 | sh/tlb: Fix __pmd_free_tlb()arch/ arch/ arch/ | +9 | 0 replies | |
| 4/11 | sparc32/tlb: Fix __p*_free_tlb()arch/ arch/ arch/ | +34 | 0 replies | |
| 5/11 | parisc/tlb: Fix __p*_free_tlb()arch/ arch/ arch/ | +26 | 0 replies | |
| 6/11 | mips/tlb: Fix __p*_free_tlb()arch/ arch/ arch/ | +41 | 0 replies | |
| 7/11 | ia64/tlb: Fix __p*_free_tlb()arch/ | +10 | 0 replies | |
| 8/11 | alpha/tlb: Fix __p*_free_tlb()arch/ | +11 | 0 replies | |
| 9/11 | nds32/tlb: Fix __p*_free_tlb()arch/ | +6 | 0 replies | |
| 10/11 | riscv/tlb: Fix __p*_free_tlb()arch/ | +6 | 0 replies | |
| 11/11 | m68k/tlb: Fix __p*_free_tlb()arch/ arch/ arch/ +1 more | +30 | 0 replies |
Reviews trailers per patch
1 of 11 patches has a Reviewed-by or Acked-by.
| Patch | Geert Uytterhoeven |
|---|---|
| 1/11 | |
| 2/11 | R-b T-b |
| 3/11 | |
| 4/11 | |
| 5/11 | |
| 6/11 | |
| 7/11 | |
| 8/11 | |
| 9/11 | |
| 10/11 | |
| 11/11 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 00/11] Fixup page directory freeing
Hi All,
While fixing a silly bug on SH (patch #1), I realized that even with the trivial patch to restore prior behaviour, page directory freeing was still broken.
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.
So I've converted everything to always observe the above order, simply so we don't have to worry about it.
If however I've been over zealous and your arch/mmu really doesn't need this and you're offended by this potentially superfluous code, please let me know and I'll replace the patch with one that adds a comment describing your rationale for why it is not needed.