]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: unexport follow_pfn
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 16 Mar 2021 15:33:03 +0000 (16:33 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 8 Apr 2021 14:54:38 +0000 (16:54 +0200)
commitac8b8400620a4b0d9ca903ee9ad440bec736f5fa
tree9496daecd86a4acd64fa9a1f1a6c01357627124c
parent3f7448dde3364e30c6aa169930e88f0f2f0f00ac
mm: unexport follow_pfn

Both kvm (in bd2fae8da794 ("KVM: do not assume PTE is writable after
follow_pfn")) and vfio (in 07956b6269d3 ("vfio/type1: Use
follow_pte()")) have lost their callsites of follow_pfn(). All the
other ones have been switched over to unsafe_follow_pfn because they
cannot be fixed without breaking userspace api.

Argueably the vfio and kvm code is still racy, but that's kinda a
bigger picture. But since it does leak the pte beyond where it drops
the pt lock, without anything else like an mmu notifier guaranteeing
coherence, the problem is at least clearly visible in the vfio code.
So good enough with me.

I've decided to keep the explanation that after dropping the pt lock
you must have an mmu notifier if you keep using the pte somehow by
adjusting it and moving it into the kerneldoc for the new follow_pte()
function.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Cc: 3pvd@google.com
Cc: Jann Horn <jannh@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Cornelia Huck <cohuck@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: linux-mm@kvack.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-media@vger.kernel.org
Cc: kvm@vger.kernel.org
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210316153303.3216674-4-daniel.vetter@ffwll.ch
include/linux/mm.h
mm/memory.c
mm/nommu.c