]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mmu_notifier: use MMU_NOTIFY_CLEAR in remove_device_exclusive_entry()
authorDavid Hildenbrand <david@redhat.com>
Wed, 26 Feb 2025 13:22:57 +0000 (14:22 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 4 Mar 2025 05:50:36 +0000 (21:50 -0800)
commit5e8d4e0c47c44cdfde985b665790655554340fde
treed064db334ded7225c1d3b14c9f15c5c49bd2ac8b
parentdbb2af488c7a84e45242f8529d70ebd078230232
mm/mmu_notifier: use MMU_NOTIFY_CLEAR in remove_device_exclusive_entry()

Let's limit the use of MMU_NOTIFY_EXCLUSIVE to the case where we convert a
present PTE to device-exclusive.  For the other case, we can simply use
MMU_NOTIFY_CLEAR, because it really is clearing the device-exclusive entry
first, to then install the present entry.

Update the documentation of MMU_NOTIFY_EXCLUSIVE, to document the single
use case more thoroughly.

If ever required, we could add a separate MMU_NOTIFY_CLEAR_EXCLUSIVE; for
now using MMU_NOTIFY_CLEAR seems to be sufficient.

Link: https://lkml.kernel.org/r/20250226132257.2826043-6-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Jérôme Glisse <jglisse@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/mmu_notifier.h
mm/memory.c