Re: [PATCH v5 08/15] mm: Add unsafe_follow_pfn

2020-11-03 Thread Jason Gunthorpe
On Mon, Nov 02, 2020 at 02:23:58PM +0100, Daniel Vetter wrote: > On Mon, Nov 2, 2020 at 2:01 PM Jason Gunthorpe wrote: > > > > On Mon, Nov 02, 2020 at 01:56:10PM +0100, Daniel Vetter wrote: > > > On Mon, Nov 2, 2020 at 8:29 AM Christoph Hellwig > > > wrote: > > > > > > > > On Fri, Oct 30, 2020 a

Re: [PATCH v5 08/15] mm: Add unsafe_follow_pfn

2020-11-03 Thread Jason Gunthorpe
On Mon, Nov 02, 2020 at 05:42:20PM +0100, Daniel Vetter wrote: > > Need to hold the lock to check that and there are two ways to register > > notifiers these days, so it feels to expensive to me. > > Uh I mixed stuff up all along, struct mmu_notifier *subcription that > all the mmu notifier users

Re: [PATCH v5 08/15] mm: Add unsafe_follow_pfn

2020-11-02 Thread Daniel Vetter
On Mon, Nov 2, 2020 at 4:52 PM Jason Gunthorpe wrote: > > On Mon, Nov 02, 2020 at 02:23:58PM +0100, Daniel Vetter wrote: > > On Mon, Nov 2, 2020 at 2:01 PM Jason Gunthorpe wrote: > > > > > > On Mon, Nov 02, 2020 at 01:56:10PM +0100, Daniel Vetter wrote: > > > > On Mon, Nov 2, 2020 at 8:29 AM Chri

Re: [PATCH v5 08/15] mm: Add unsafe_follow_pfn

2020-11-02 Thread Jason Gunthorpe
On Mon, Nov 02, 2020 at 01:56:10PM +0100, Daniel Vetter wrote: > On Mon, Nov 2, 2020 at 8:29 AM Christoph Hellwig wrote: > > > > On Fri, Oct 30, 2020 at 11:08:08AM +0100, Daniel Vetter wrote: > > > Also mark up follow_pfn as EXPORT_SYMBOL_GPL. The only safe way to use > > > that by drivers/modules

Re: [PATCH v5 08/15] mm: Add unsafe_follow_pfn

2020-11-02 Thread Daniel Vetter
On Mon, Nov 2, 2020 at 2:01 PM Jason Gunthorpe wrote: > > On Mon, Nov 02, 2020 at 01:56:10PM +0100, Daniel Vetter wrote: > > On Mon, Nov 2, 2020 at 8:29 AM Christoph Hellwig wrote: > > > > > > On Fri, Oct 30, 2020 at 11:08:08AM +0100, Daniel Vetter wrote: > > > > Also mark up follow_pfn as EXPORT

Re: [PATCH v5 08/15] mm: Add unsafe_follow_pfn

2020-11-02 Thread Daniel Vetter
On Mon, Nov 2, 2020 at 8:29 AM Christoph Hellwig wrote: > > On Fri, Oct 30, 2020 at 11:08:08AM +0100, Daniel Vetter wrote: > > Also mark up follow_pfn as EXPORT_SYMBOL_GPL. The only safe way to use > > that by drivers/modules is together with an mmu_notifier, and that's > > all _GPL stuff. > > I a

[PATCH v5 08/15] mm: Add unsafe_follow_pfn

2020-10-30 Thread Daniel Vetter
Way back it was a reasonable assumptions that iomem mappings never change the pfn range they point at. But this has changed: - gpu drivers dynamically manage their memory nowadays, invalidating ptes with unmap_mapping_range when buffers get moved - contiguous dma allocations have moved from dedic