lkml.org 
[lkml]   [2023]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 5/5] mmu_notifiers: Rename invalidate_range notifier
On Thu, Jul 20, 2023 at 06:39:27PM +1000, Alistair Popple wrote:
> There are two main use cases for mmu notifiers. One is by KVM which
> uses mmu_notifier_invalidate_range_start()/end() to manage a software
> TLB.
>
> The other is to manage hardware TLBs which need to use the
> invalidate_range() callback because HW can establish new TLB entries
> at any time. Hence using start/end() can lead to memory corruption as
> these callbacks happen too soon/late during page unmap.
>
> mmu notifier users should therefore either use the start()/end()
> callbacks or the invalidate_range() callbacks. To make this usage
> clearer rename the invalidate_range() callback to
> arch_invalidate_secondary_tlbs() and update documention.
>
> Signed-off-by: Alistair Popple <apopple@nvidia.com>
> Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> arch/arm64/include/asm/tlbflush.h | 6 +-
> arch/powerpc/mm/book3s64/radix_hugetlbpage.c | 2 +-
> arch/powerpc/mm/book3s64/radix_tlb.c | 10 ++--
> arch/x86/include/asm/tlbflush.h | 2 +-
> arch/x86/mm/tlb.c | 2 +-
> drivers/iommu/amd/iommu_v2.c | 10 ++--
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c | 13 ++---
> drivers/iommu/intel/svm.c | 8 +--
> drivers/misc/ocxl/link.c | 8 +--
> include/linux/mmu_notifier.h | 48 +++++++++---------
> mm/huge_memory.c | 4 +-
> mm/hugetlb.c | 7 +--
> mm/mmu_notifier.c | 20 ++++++--
> 13 files changed, 76 insertions(+), 64 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

\
 
 \ /
  Last update: 2023-07-21 21:32    [W:0.073 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site