Skip to content

tlb: Fix access and (soft-)dirty bit management

Will Deacon linux-arm-kernel linux-mm lkml stable 1 version Applied

Status from this message: The following commit has been merged into the core/mm branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 35 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6arm64: pgtable: Fix pte_accessible()arch/arm64/include/asm/pgtable.h+1 -34 replies
2/6arm64: pgtable: Ensure dirty bit is preserved across pte_wrprotect()arch/arm64/include/asm/pgtable.h+14 -133 replies
3/6tlb: mmu_gather: Remove unused start/end arguments from tlb_finish_mmu()arch/ia64/include/asm/tlb.h arch/x86/kernel/ldt.c fs/exec.c +8 more+16 -202 replies
4/6mm: proc: Invalidate TLB after clearing soft-dirty page statefs/proc/task_mmu.c+11 -712 replies
5/6tlb: mmu_gather: Introduce tlb_gather_mmu_fullmm()fs/proc/task_mmu.c include/asm-generic/tlb.h include/linux/mm_types.h +2 more+21 -64 replies
6/6mm: proc: Avoid fullmm flush for young/dirty bit togglingfs/proc/task_mmu.c+1 -110 replies

Reviews trailers per patch

2 of 6 patches have a Reviewed-by or Acked-by.

PatchMinchan KimYu ZhaoCatalin Marinas
1/6R-b A-b R-b
2/6R-b
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/6] tlb: Fix access and (soft-)dirty bit management

Hi all,

This series attempts to fix some issues relating to our access and (soft-)dirty bit management relating to TLB invalidation. It's a bit all over the place because I kept running into new issues as I was trying to figure it out.

The first patch fixes a crash we've seen in practice. The other patches are all addressing things that I found by code inspection and I would _really_ appreciate others having a look. In particular, what can go wrong in practice if a CPU has a stale, writable entry in the TLB for a pte which is !pte_write()? It feels intuitively bad, but I couldn't find anywhere that would explode (the CoW path looks alright, for example).

Cheers,

Will

Cc Catalin Marinas <[email protected]>
Cc Yu Zhao <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Andrew Morton <[email protected]
Cc Anshuman Khandual <[email protected]>

--->8

Will Deacon (6):
arm64: pgtable: Fix pte_accessible()
arm64: pgtable: Ensure dirty bit is preserved across pte_wrprotect()
tlb: mmu_gather: Remove unused start/end arguments from
tlb_finish_mmu()
mm: proc: Invalidate TLB after clearing soft-dirty page state
tlb: mmu_gather: Introduce tlb_gather_mmu_fullmm()
mm: proc: Avoid fullmm flush for young/dirty bit toggling

 arch/arm64/include/asm/pgtable.h | 31 +++++++++++++++----------------
 arch/ia64/include/asm/tlb.h      |  2 +-
 arch/x86/kernel/ldt.c            |  2 +-
 fs/exec.c                        |  2 +-
 fs/proc/task_mmu.c               | 22 +++++++++++++---------
 include/asm-generic/tlb.h        |  6 ++++--
 include/linux/mm_types.h         |  4 ++--
 mm/hugetlb.c                     |  2 +-
 mm/madvise.c                     |  6 +++---
 mm/memory.c                      |  4 ++--
 mm/mmap.c                        |  6 +++---
 mm/mmu_gather.c                  | 21 +++++++++++++++------
 mm/oom_kill.c                    |  4 ++--
 13 files changed, 63 insertions(+), 49 deletions(-)
Signature · 1 line
2.29.2.454.gaff20da3a2-goog