Re: [Intel-gfx] [PATCH] RFC: dma-buf: Require VM_SPECIAL vma for mmap

2021-02-05 Thread Daniel Vetter
On Thu, Feb 4, 2021 at 9:59 PM Jason Gunthorpe wrote: > > On Thu, Feb 04, 2021 at 09:19:57PM +0100, Daniel Vetter wrote: > > On Thu, Feb 4, 2021 at 9:09 PM Jason Gunthorpe wrote: > > > > > > On Thu, Feb 04, 2021 at 08:59:59PM +0100, Daniel Vetter wrote: > > > > > > > So I think just checking for

Re: [Intel-gfx] [PATCH] RFC: dma-buf: Require VM_SPECIAL vma for mmap

2021-02-05 Thread Christian König
Am 04.02.21 um 19:38 schrieb Jason Gunthorpe: On Thu, Feb 04, 2021 at 06:16:27PM +0100, Daniel Vetter wrote: On Thu, Feb 4, 2021 at 5:13 PM Jason Gunthorpe wrote: On Wed, Feb 03, 2021 at 10:19:48PM +0100, Daniel Vetter wrote: tldr; DMA buffers aren't normal memory, expecting that you can use

Re: [Intel-gfx] [PATCH] RFC: dma-buf: Require VM_SPECIAL vma for mmap

2021-02-04 Thread Daniel Vetter
On Thu, Feb 4, 2021 at 9:09 PM Jason Gunthorpe wrote: > > On Thu, Feb 04, 2021 at 08:59:59PM +0100, Daniel Vetter wrote: > > > So I think just checking for VM_PFNMAP after the vma is set up should > > be enough to guarantee we'll only have pte_special ptes in there, > > ever. But I'm not sure, thi

Re: [Intel-gfx] [PATCH] RFC: dma-buf: Require VM_SPECIAL vma for mmap

2021-02-04 Thread Daniel Vetter
On Thu, Feb 4, 2021 at 7:38 PM Jason Gunthorpe wrote: > > On Thu, Feb 04, 2021 at 06:16:27PM +0100, Daniel Vetter wrote: > > On Thu, Feb 4, 2021 at 5:13 PM Jason Gunthorpe wrote: > > > On Wed, Feb 03, 2021 at 10:19:48PM +0100, Daniel Vetter wrote: > > > > tldr; DMA buffers aren't normal memory, e

Re: [Intel-gfx] [PATCH] RFC: dma-buf: Require VM_SPECIAL vma for mmap

2021-02-04 Thread Daniel Vetter
On Thu, Feb 4, 2021 at 5:13 PM Jason Gunthorpe wrote: > On Wed, Feb 03, 2021 at 10:19:48PM +0100, Daniel Vetter wrote: > > tldr; DMA buffers aren't normal memory, expecting that you can use > > them like that (like calling get_user_pages works, or that they're > > accounting like any other normal

[Intel-gfx] [PATCH] RFC: dma-buf: Require VM_SPECIAL vma for mmap

2021-02-03 Thread Daniel Vetter
tldr; DMA buffers aren't normal memory, expecting that you can use them like that (like calling get_user_pages works, or that they're accounting like any other normal memory) cannot be guaranteed. Since some userspace only runs on integrated devices, where all buffers are actually all resident sys