Thread (39 messages) 39 messages, 7 authors, 2020-11-27

Re: [PATCH v6 17/17] RFC: mm: add mmu_notifier argument to follow_pfn

From: Daniel Vetter <hidden>
Date: 2020-11-24 14:28:37
Also in: dri-devel, kvm, linux-media, linux-mm, linux-samsung-soc, lkml

On Fri, Nov 20, 2020 at 02:30:29PM -0400, Jason Gunthorpe wrote:
On Thu, Nov 19, 2020 at 03:41:46PM +0100, Daniel Vetter wrote:
quoted
@@ -4805,21 +4824,15 @@ EXPORT_SYMBOL(follow_pte_pmd);
  * Return: zero and the pfn at @pfn on success, -ve otherwise.
  */
 int follow_pfn(struct vm_area_struct *vma, unsigned long address,
-	unsigned long *pfn)
+	unsigned long *pfn, struct mmu_notifier *subscription)
 {
-	int ret = -EINVAL;
-	spinlock_t *ptl;
-	pte_t *ptep;
+	if (WARN_ON(!subscription->mm))
+		return -EINVAL;
 
+	if (WARN_ON(subscription->mm != vma->vm_mm))
+		return -EINVAL;
These two things are redundant right? vma->vm_mm != NULL?
Yup, will remove.
BTW, why do we even have this for nommu? If the only caller is kvm,
can you even compile kvm on nommu??
Kinda makes sense, but I have no idea how to make sure with compile
testing this is really the case. And I didn't see any hard evidence in
Kconfig or Makefile that mmu notifiers requires CONFIG_MMU. So not sure
what to do here.

Should I just remove the nommu version of follow_pfn and see what happens?
We can't remove it earlier since it's still used by other subsystems.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help