]> git.baikalelectronics.ru Git - kernel.git/commit
mm: provide a saner PTE walking API for modules
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Feb 2021 10:07:11 +0000 (05:07 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 9 Feb 2021 12:05:44 +0000 (07:05 -0500)
commit6fcd1971b336021bc09c9dd4b3e29df173f144b2
tree07a393402e4e9d938a094731c816ca3b54da8711
parent882e7071b022915dce4025ed8e448e59ee1eec1a
mm: provide a saner PTE walking API for modules

Currently, the follow_pfn function is exported for modules but
follow_pte is not.  However, follow_pfn is very easy to misuse,
because it does not provide protections (so most of its callers
assume the page is writable!) and because it returns after having
already unlocked the page table lock.

Provide instead a simplified version of follow_pte that does
not have the pmdpp and range arguments.  The older version
survives as follow_invalidate_pte() for use by fs/dax.c.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/s390/pci/pci_mmio.c
fs/dax.c
include/linux/mm.h
mm/memory.c
virt/kvm/kvm_main.c