lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZLrc+vEQcCEpI0wd@ziepe.ca>
Date:   Fri, 21 Jul 2023 16:31:06 -0300
From:   Jason Gunthorpe <jgg@...pe.ca>
To:     Alistair Popple <apopple@...dia.com>
Cc:     akpm@...ux-foundation.org, ajd@...ux.ibm.com,
        catalin.marinas@....com, fbarrat@...ux.ibm.com,
        iommu@...ts.linux.dev, jhubbard@...dia.com, kevin.tian@...el.com,
        kvm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linuxppc-dev@...ts.ozlabs.org, mpe@...erman.id.au,
        nicolinc@...dia.com, npiggin@...il.com, robin.murphy@....com,
        seanjc@...gle.com, will@...nel.org, x86@...nel.org,
        zhi.wang.linux@...il.com, sj@...nel.org
Subject: Re: [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@...dia.com>
> Suggested-by: Jason Gunthorpe <jgg@...dia.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@...dia.com>

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ