Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-16 Thread Daniel Vetter
Ok, confusion around backend is I think cleared up. The other confusion seems to be around dma-buf: dma-buf is the cross subsystem zerocopy abstraction. PRIME is the drm-specific support for it, 100% based on top of the generic struct dma_buf. You need a dma_buf exporter to convert a xen grant

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-16 Thread Oleksandr Andrushchenko
On 04/16/2018 12:32 PM, Daniel Vetter wrote: On Mon, Apr 16, 2018 at 10:22 AM, Oleksandr Andrushchenko wrote: On 04/16/2018 10:43 AM, Daniel Vetter wrote: On Mon, Apr 16, 2018 at 10:16:31AM +0300, Oleksandr Andrushchenko wrote: On 04/13/2018 06:37 PM, Daniel Vetter wrote:

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-16 Thread Daniel Vetter
On Mon, Apr 16, 2018 at 10:22 AM, Oleksandr Andrushchenko wrote: > On 04/16/2018 10:43 AM, Daniel Vetter wrote: >> >> On Mon, Apr 16, 2018 at 10:16:31AM +0300, Oleksandr Andrushchenko wrote: >>> >>> On 04/13/2018 06:37 PM, Daniel Vetter wrote: On Wed, Apr 11, 2018 at

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-16 Thread Oleksandr Andrushchenko
On 04/16/2018 10:43 AM, Daniel Vetter wrote: On Mon, Apr 16, 2018 at 10:16:31AM +0300, Oleksandr Andrushchenko wrote: On 04/13/2018 06:37 PM, Daniel Vetter wrote: On Wed, Apr 11, 2018 at 08:59:32AM +0300, Oleksandr Andrushchenko wrote: On 04/10/2018 08:26 PM, Dongwon Kim wrote: On Tue, Apr

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-16 Thread Daniel Vetter
On Mon, Apr 16, 2018 at 10:16:31AM +0300, Oleksandr Andrushchenko wrote: > On 04/13/2018 06:37 PM, Daniel Vetter wrote: > > On Wed, Apr 11, 2018 at 08:59:32AM +0300, Oleksandr Andrushchenko wrote: > > > On 04/10/2018 08:26 PM, Dongwon Kim wrote: > > > > On Tue, Apr 10, 2018 at 09:37:53AM +0300,

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-16 Thread Oleksandr Andrushchenko
On 04/13/2018 06:37 PM, Daniel Vetter wrote: On Wed, Apr 11, 2018 at 08:59:32AM +0300, Oleksandr Andrushchenko wrote: On 04/10/2018 08:26 PM, Dongwon Kim wrote: On Tue, Apr 10, 2018 at 09:37:53AM +0300, Oleksandr Andrushchenko wrote: On 04/06/2018 09:57 PM, Dongwon Kim wrote: On Fri, Apr 06,

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-13 Thread Daniel Vetter
On Wed, Apr 11, 2018 at 08:59:32AM +0300, Oleksandr Andrushchenko wrote: > On 04/10/2018 08:26 PM, Dongwon Kim wrote: > > On Tue, Apr 10, 2018 at 09:37:53AM +0300, Oleksandr Andrushchenko wrote: > > > On 04/06/2018 09:57 PM, Dongwon Kim wrote: > > > > On Fri, Apr 06, 2018 at 03:36:03PM +0300,

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-11 Thread Oleksandr Andrushchenko
On 04/10/2018 08:26 PM, Dongwon Kim wrote: On Tue, Apr 10, 2018 at 09:37:53AM +0300, Oleksandr Andrushchenko wrote: On 04/06/2018 09:57 PM, Dongwon Kim wrote: On Fri, Apr 06, 2018 at 03:36:03PM +0300, Oleksandr Andrushchenko wrote: On 04/06/2018 02:57 PM, Gerd Hoffmann wrote: Hi, I fail

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-10 Thread Dongwon Kim
On Tue, Apr 10, 2018 at 09:37:53AM +0300, Oleksandr Andrushchenko wrote: > On 04/06/2018 09:57 PM, Dongwon Kim wrote: > >On Fri, Apr 06, 2018 at 03:36:03PM +0300, Oleksandr Andrushchenko wrote: > >>On 04/06/2018 02:57 PM, Gerd Hoffmann wrote: > >>> Hi, > >>> > >I fail to see any common

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-10 Thread Gerd Hoffmann
Hi, > Generally we try to cache mappings as much as possible. And wrt finding a > slot: Create a sufficiently sized BAR on the virgl device, just for that? Well. virtio has no concept of "bars" ... The most common virtio transport layer happens to be pci, which actually has bars. But we

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-10 Thread Oleksandr Andrushchenko
On 04/06/2018 09:57 PM, Dongwon Kim wrote: On Fri, Apr 06, 2018 at 03:36:03PM +0300, Oleksandr Andrushchenko wrote: On 04/06/2018 02:57 PM, Gerd Hoffmann wrote: Hi, I fail to see any common ground for xen-zcopy and udmabuf ... Does the above mean you can assume that xen-zcopy and udmabuf

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-09 Thread Daniel Vetter
On Thu, Apr 05, 2018 at 05:11:17PM -0700, Matt Roper wrote: > On Thu, Apr 05, 2018 at 10:32:04PM +0200, Daniel Vetter wrote: > > Pulling this out of the shadows again. > > > > We now also have xen-zcopy from Oleksandr and the hyper dmabuf stuff > > from Matt and Dongwong. > > > > At least from

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-09 Thread Daniel Vetter
On Fri, Apr 06, 2018 at 12:54:22PM +0200, Gerd Hoffmann wrote: > On Fri, Apr 06, 2018 at 10:52:21AM +0100, Daniel Stone wrote: > > Hi Gerd, > > > > On 14 March 2018 at 08:03, Gerd Hoffmann wrote: > > >> Either mlock account (because it's mlocked defacto), and get_user_pages >

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-06 Thread Dongwon Kim
On Fri, Apr 06, 2018 at 03:36:03PM +0300, Oleksandr Andrushchenko wrote: > On 04/06/2018 02:57 PM, Gerd Hoffmann wrote: > > Hi, > > > >>>I fail to see any common ground for xen-zcopy and udmabuf ... > >>Does the above mean you can assume that xen-zcopy and udmabuf > >>can co-exist as two

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-06 Thread Daniel Stone
Hi Gerd, On 14 March 2018 at 08:03, Gerd Hoffmann wrote: >> Either mlock account (because it's mlocked defacto), and get_user_pages >> won't do that for you. >> >> Or you write the full-blown userptr implementation, including mmu_notifier >> support (see i915 or amdgpu), but

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-06 Thread Oleksandr Andrushchenko via Qemu-devel
On 04/06/2018 03:11 AM, Matt Roper wrote: On Thu, Apr 05, 2018 at 10:32:04PM +0200, Daniel Vetter wrote: Pulling this out of the shadows again. We now also have xen-zcopy from Oleksandr and the hyper dmabuf stuff from Matt and Dongwong. At least from the intel side there seems to be the idea

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-06 Thread Oleksandr Andrushchenko
On 04/06/2018 02:57 PM, Gerd Hoffmann wrote: Hi, I fail to see any common ground for xen-zcopy and udmabuf ... Does the above mean you can assume that xen-zcopy and udmabuf can co-exist as two different solutions? Well, udmabuf route isn't fully clear yet, but yes. See also gvt (intel

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-06 Thread Gerd Hoffmann
Hi, > > I fail to see any common ground for xen-zcopy and udmabuf ... > Does the above mean you can assume that xen-zcopy and udmabuf > can co-exist as two different solutions? Well, udmabuf route isn't fully clear yet, but yes. See also gvt (intel vgpu), where the hypervisor interface is

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-06 Thread Oleksandr Andrushchenko
On 04/06/2018 12:07 PM, Gerd Hoffmann wrote: I'm not sure we can create something which works on both kvm and xen. The memory management model is quite different ... On xen the hypervisor manages all memory. Guests can allow other guests to access specific pages (using grant tables). In

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-06 Thread Gerd Hoffmann
On Fri, Apr 06, 2018 at 10:52:21AM +0100, Daniel Stone wrote: > Hi Gerd, > > On 14 March 2018 at 08:03, Gerd Hoffmann wrote: > >> Either mlock account (because it's mlocked defacto), and get_user_pages > >> won't do that for you. > >> > >> Or you write the full-blown userptr

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-06 Thread Oleksandr Andrushchenko
On 04/06/2018 12:07 PM, Gerd Hoffmann wrote: Hi, * The general interface should be able to express sharing from any guest:guest, not just guest:host. Arbitrary G:G sharing might be something some hypervisors simply aren't able to support, but the userspace API itself

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-06 Thread Gerd Hoffmann
Hi, > > * The general interface should be able to express sharing from any > > guest:guest, not just guest:host. Arbitrary G:G sharing might be > > something some hypervisors simply aren't able to support, but the > > userspace API itself shouldn't make assumptions or restrict

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-05 Thread Matt Roper
On Thu, Apr 05, 2018 at 10:32:04PM +0200, Daniel Vetter wrote: > Pulling this out of the shadows again. > > We now also have xen-zcopy from Oleksandr and the hyper dmabuf stuff > from Matt and Dongwong. > > At least from the intel side there seems to be the idea to just have 1 > special device

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-04-05 Thread Daniel Vetter
Pulling this out of the shadows again. We now also have xen-zcopy from Oleksandr and the hyper dmabuf stuff from Matt and Dongwong. At least from the intel side there seems to be the idea to just have 1 special device that can handle cross-gues/host sharing for all kinds of hypervisors, so I

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-03-14 Thread Gerd Hoffmann
Hi, > Either mlock account (because it's mlocked defacto), and get_user_pages > won't do that for you. > > Or you write the full-blown userptr implementation, including mmu_notifier > support (see i915 or amdgpu), but that also requires Christian Königs > latest ->invalidate_mapping RFC for

Re: [Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-03-13 Thread Daniel Vetter
On Tue, Mar 13, 2018 at 04:48:26PM +0100, Gerd Hoffmann wrote: > A driver to let userspace turn iovecs into dma-bufs. > > Use case: Allows qemu pass around dmabufs for the guest framebuffer. > https://www.kraxel.org/cgit/qemu/log/?h=sirius/udmabuf has an > experimental patch. > > Also allows

[Qemu-devel] [RfC PATCH] Add udmabuf misc device

2018-03-13 Thread Gerd Hoffmann
A driver to let userspace turn iovecs into dma-bufs. Use case: Allows qemu pass around dmabufs for the guest framebuffer. https://www.kraxel.org/cgit/qemu/log/?h=sirius/udmabuf has an experimental patch. Also allows qemu to export guest virtio-gpu resources as host dmabufs. Should be possible