]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - include/asm-generic/tlb.h
tlb: mmu_gather: Introduce tlb_gather_mmu_fullmm()
authorWill Deacon <will@kernel.org>
Wed, 27 Jan 2021 23:53:44 +0000 (23:53 +0000)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 29 Jan 2021 19:02:29 +0000 (20:02 +0100)
commitd8b450530b90f8845ab962af18b8a10ed77fc889
tree5399ddb38a5f0a743c07866a32bec5ce46175b61
parentae8eba8b5d723a4ca543024b6e51f4d0f4fb6b6b
tlb: mmu_gather: Introduce tlb_gather_mmu_fullmm()

Passing the range '0, -1' to tlb_gather_mmu() sets the 'fullmm' flag,
which indicates that the mm_struct being operated on is going away. In
this case, some architectures (such as arm64) can elide TLB invalidation
by ensuring that the TLB tag (ASID) associated with this mm is not
immediately reclaimed. Although this behaviour is documented in
asm-generic/tlb.h, it's subtle and easily missed.

Introduce tlb_gather_mmu_fullmm() to make it clearer that this is for the
entire mm and WARN() if tlb_gather_mmu() is called with the 'fullmm'
address range.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Yu Zhao <yuzhao@google.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lkml.kernel.org/r/20210127235347.1402-4-will@kernel.org
include/asm-generic/tlb.h
include/linux/mm_types.h
mm/mmap.c
mm/mmu_gather.c