]> 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>
Fri, 28 Feb 2025 01:00:37 +0000 (17:00 -0800)
commit47cebeb53d727ea277b3a436a9b4446a4f22adc1
tree51e5112bb54cdc389501ffa963cd97e79be7ce03
parent3a32927c4f1653ebc1d74427df9e8386a361e474
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