Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-12-17 Thread David Stevens
> > > Of course only virtio drivers would try step (2), other drivers (when > > > sharing buffers between intel gvt device and virtio-gpu for example) > > > would go straight to (3). > > > > For virtio-gpu as it is today, it's not clear to me that they're > > equivalent. As I read it, the virtio-gp

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-12-16 Thread Gerd Hoffmann
Hi, > > Of course only virtio drivers would try step (2), other drivers (when > > sharing buffers between intel gvt device and virtio-gpu for example) > > would go straight to (3). > > For virtio-gpu as it is today, it's not clear to me that they're > equivalent. As I read it, the virtio-gpu sp

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-12-12 Thread David Stevens
> > > Without buffer sharing support the driver importing a virtio-gpu dma-buf > > > can send the buffer scatter list to the host. So both virtio-gpu and > > > the other device would actually access the same guest pages, but they > > > are not aware that the buffer is shared between devices. > > >

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-12-12 Thread Gerd Hoffmann
On Thu, Dec 12, 2019 at 09:26:32PM +0900, David Stevens wrote: > > > > Second I think it is a bad idea > > > > from the security point of view. When explicitly exporting buffers it > > > > is easy to restrict access to the actual exports. > > > > > > Restricting access to actual exports could perh

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-12-12 Thread David Stevens
> > > Second I think it is a bad idea > > > from the security point of view. When explicitly exporting buffers it > > > is easy to restrict access to the actual exports. > > > > Restricting access to actual exports could perhaps help catch bugs. > > However, I don't think it provides any security

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-12-12 Thread Gerd Hoffmann
Hi, > > First the addressing is non-trivial, especially with the "transport > > specific device address" in the tuple. > > There is complexity here, but I think it would also be present in the > buffer sharing device case. With a buffer sharing device, the same > identifying information would n

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-12-11 Thread David Stevens
> First the addressing is non-trivial, especially with the "transport > specific device address" in the tuple. There is complexity here, but I think it would also be present in the buffer sharing device case. With a buffer sharing device, the same identifying information would need to be provided

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-12-11 Thread Enrico Granata
On Wed, Dec 11, 2019 at 1:26 AM Gerd Hoffmann wrote: > > Hi, > > > None of the proposals directly address the use case of sharing host > > allocated buffers between devices, but I think they can be extended to > > support it. Host buffers can be identified by the following tuple: > > (transport

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-26 Thread Gerd Hoffmann
> > I'm not convinced this is useful for audio ... > > > > I basically see two modes of operation which are useful: > > > > (1) send audio data via virtqueue. > > (2) map host audio buffers into the guest address space. > > > > The audio driver api (i.e. alsa) typically allows to mmap() the

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-25 Thread Liam Girdwood
On Wed, 2019-11-20 at 10:53 +0100, Gerd Hoffmann wrote: > Hi, > > > > > DSP FW has no access to userspace so we would need some > > > > additional > > > > API > > > > on top of DMA_BUF_SET_NAME etc to get physical hardware pages ? > > > > > > The dma-buf api currently can share guest memory sg-

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-20 Thread Gerd Hoffmann
Hi, > > > DSP FW has no access to userspace so we would need some additional > > > API > > > on top of DMA_BUF_SET_NAME etc to get physical hardware pages ? > > > > The dma-buf api currently can share guest memory sg-lists. > > Ok, IIUC buffers can either be shared using the GPU proposed APIs

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-19 Thread Gurchetan Singh
On Tue, Nov 19, 2019 at 7:31 AM Liam Girdwood wrote: > > On Tue, 2019-11-12 at 14:55 -0800, Gurchetan Singh wrote: > > On Tue, Nov 12, 2019 at 5:56 AM Liam Girdwood > > wrote: > > > > > > On Mon, 2019-11-11 at 16:54 -0800, Gurchetan Singh wrote: > > > > On Tue, Nov 5, 2019 at 2:55 AM Gerd Hoffman

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-19 Thread Liam Girdwood
On Tue, 2019-11-12 at 14:55 -0800, Gurchetan Singh wrote: > On Tue, Nov 12, 2019 at 5:56 AM Liam Girdwood > wrote: > > > > On Mon, 2019-11-11 at 16:54 -0800, Gurchetan Singh wrote: > > > On Tue, Nov 5, 2019 at 2:55 AM Gerd Hoffmann > > > wrote: > > > > Each buffer also has some properties to car

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-12 Thread Gurchetan Singh
On Tue, Nov 12, 2019 at 5:56 AM Liam Girdwood wrote: > > On Mon, 2019-11-11 at 16:54 -0800, Gurchetan Singh wrote: > > On Tue, Nov 5, 2019 at 2:55 AM Gerd Hoffmann > > wrote: > > > Each buffer also has some properties to carry metadata, some fixed > > > (id, size, application), but > > > also all

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-12 Thread Liam Girdwood
On Mon, 2019-11-11 at 16:54 -0800, Gurchetan Singh wrote: > On Tue, Nov 5, 2019 at 2:55 AM Gerd Hoffmann > wrote: > > Each buffer also has some properties to carry metadata, some fixed > > (id, size, application), but > > also allow free form (name = value, framebuffers would have > > width/height

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-11 Thread Gurchetan Singh
On Tue, Nov 5, 2019 at 2:55 AM Gerd Hoffmann wrote: > Each buffer also has some properties to carry metadata, some fixed (id, size, > application), but > also allow free form (name = value, framebuffers would have > width/height/stride/format for example). Sounds a lot like the recently added DM

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-11 Thread Liam Girdwood
On Mon, 2019-11-11 at 12:04 +0900, David Stevens wrote: > Having a centralized buffer allocator device is one way to deal with > sharing buffers, since it gives a definitive buffer identifier that > can be used by all drivers/devices to refer to the buffer. That being > said, I think the device as

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-07 Thread Gerd Hoffmann
On Thu, Nov 07, 2019 at 11:16:18AM +, Dr. David Alan Gilbert wrote: > * Gerd Hoffmann (kra...@redhat.com) wrote: > > Hi, > > > > > > This is not about host memory, buffers are in guest ram, everything else > > > > would make sharing those buffers between drivers inside the guest (as > > > >

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-07 Thread Dr. David Alan Gilbert
* Gerd Hoffmann (kra...@redhat.com) wrote: > Hi, > > > > This is not about host memory, buffers are in guest ram, everything else > > > would make sharing those buffers between drivers inside the guest (as > > > dma-buf) quite difficult. > > > > Given it's just guest memory, can the guest just

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-07 Thread Gerd Hoffmann
Hi, > > This is not about host memory, buffers are in guest ram, everything else > > would make sharing those buffers between drivers inside the guest (as > > dma-buf) quite difficult. > > Given it's just guest memory, can the guest just have a virt queue on > which it places pointers to the me

Re: [virtio-dev] Re: guest / host buffer sharing ...

2019-11-06 Thread Dr. David Alan Gilbert
* Gerd Hoffmann (kra...@redhat.com) wrote: > Hi, > > > > Reason is: Meanwhile I'm wondering whenever "just use virtio-gpu > > > resources" is really a good answer for all the different use cases > > > we have collected over time. Maybe it is better to have a dedicated > > > buffer sharing virt