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

2020-11-25 Thread Daniel Vetter
On Wed, Nov 25, 2020 at 9:13 AM Jason Gunthorpe wrote: > > On Tue, Nov 24, 2020 at 03:28:14PM +0100, Daniel Vetter wrote: > > 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: > > > > @@ -4805,21 +4824,15 @@ EXPORT

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

2020-11-24 Thread Jason Gunthorpe
On Tue, Nov 24, 2020 at 03:28:14PM +0100, Daniel Vetter wrote: > 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: > > > @@ -4805,21 +4824,15 @@ EXPORT_SYMBOL(follow_pte_pmd); > > > * Return: zero and the pfn at @pf

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

2020-11-24 Thread Daniel Vetter
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: > > @@ -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_are

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

2020-11-20 Thread Jason Gunthorpe
On Thu, Nov 19, 2020 at 03:41:46PM +0100, Daniel Vetter wrote: > @@ -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) > + u

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

2020-11-19 Thread Daniel Vetter
The only safe way for non core/arch code to use follow_pfn() is together with an mmu_notifier subscription. follow_pfn() is already marked as _GPL and the kerneldoc explains this restriction. This patch here enforces all this by adding a mmu_notifier argument and verifying that it is registered fo