Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Michael S. Tsirkin
On Wed, Oct 28, 2015 at 05:09:47PM +0900, David Woodhouse wrote: > On Wed, 2015-10-28 at 16:40 +0900, Christian Borntraeger wrote: > > Am 28.10.2015 um 16:17 schrieb Michael S. Tsirkin: > > > On Tue, Oct 27, 2015 at 11:38:57PM -0700, Andy Lutomirski wrote: > > > > This switches virtio to use the

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread David Woodhouse
On Wed, 2015-10-28 at 13:23 +0200, Michael S. Tsirkin wrote: > On Wed, Oct 28, 2015 at 05:36:53PM +0900, Benjamin Herrenschmidt > wrote: > > On Wed, 2015-10-28 at 16:40 +0900, Christian Borntraeger wrote: > > > We have discussed that at kernel summit. I will try to implement > > > a dummy dma_ops

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Michael S. Tsirkin
On Wed, Oct 28, 2015 at 05:36:53PM +0900, Benjamin Herrenschmidt wrote: > On Wed, 2015-10-28 at 16:40 +0900, Christian Borntraeger wrote: > > We have discussed that at kernel summit. I will try to implement a dummy > > dma_ops for > > s390 that does 1:1 mapping and Ben will look into doing some

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread David Woodhouse
On Wed, 2015-10-28 at 13:35 +0200, Michael S. Tsirkin wrote: > E.g. on intel x86, there's an option iommu=pt which does the 1:1 > thing for devices when used by kernel, but enables > the iommu if used by userspace/VMs. That's none of your business. You call the DMA API when you do DMA. That's

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Michael S. Tsirkin
On Wed, Oct 28, 2015 at 10:37:56PM +0900, David Woodhouse wrote: > On Wed, 2015-10-28 at 13:23 +0200, Michael S. Tsirkin wrote: > > On Wed, Oct 28, 2015 at 05:36:53PM +0900, Benjamin Herrenschmidt > > wrote: > > > On Wed, 2015-10-28 at 16:40 +0900, Christian Borntraeger wrote: > > > > We have

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Michael S. Tsirkin
On Wed, Oct 28, 2015 at 11:13:29PM +0900, David Woodhouse wrote: > On Wed, 2015-10-28 at 16:05 +0200, Michael S. Tsirkin wrote: > > > > Short answer - platforms need a way to discover, and express different > > security requirements of different devices. > > Sure. PLATFORMS need that. Do not let

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Michael S. Tsirkin
On Wed, Oct 28, 2015 at 10:35:27PM +0900, David Woodhouse wrote: > On Wed, 2015-10-28 at 13:35 +0200, Michael S. Tsirkin wrote: > > E.g. on intel x86, there's an option iommu=pt which does the 1:1 > > thing for devices when used by kernel, but enables > > the iommu if used by userspace/VMs. > >

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread David Woodhouse
On Wed, 2015-10-28 at 16:05 +0200, Michael S. Tsirkin wrote: > > Short answer - platforms need a way to discover, and express different > security requirements of different devices. Sure. PLATFORMS need that. Do not let it go anywhere near your device drivers. Including the virtio drivers. > If

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread David Woodhouse
On Tue, 2015-10-27 at 23:38 -0700, Andy Lutomirski wrote: > > Changes from v2: > - Fix really embarrassing bug. This version actually works. So embarrassing you didn't want to tell us what it was? ... --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -292,7 +292,7 @@

Re: [PATCH v2 1/3] virtio_net: Stop doing DMA from the stack

2015-10-28 Thread Michael S. Tsirkin
On Tue, Oct 27, 2015 at 10:30:19PM -0700, Andy Lutomirski wrote: > From: Andy Lutomirski > > Once virtio starts using the DMA API, we won't be able to safely DMA > from the stack. virtio-net does a couple of config DMA requests > from small stack buffers -- switch to using

Re: [PATCH v3 1/3] virtio_net: Stop doing DMA from the stack

2015-10-28 Thread Michael S. Tsirkin
On Tue, Oct 27, 2015 at 11:38:58PM -0700, Andy Lutomirski wrote: > From: Andy Lutomirski > > Once virtio starts using the DMA API, we won't be able to safely DMA > from the stack. virtio-net does a couple of config DMA requests > from small stack buffers -- switch to using

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Michael S. Tsirkin
On Tue, Oct 27, 2015 at 11:38:57PM -0700, Andy Lutomirski wrote: > This switches virtio to use the DMA API unconditionally. I'm sure > it breaks things, but it seems to work on x86 using virtio-pci, with > and without Xen, and using both the modern 1.0 variant and the > legacy variant. I'm very

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Christian Borntraeger
Am 28.10.2015 um 16:17 schrieb Michael S. Tsirkin: > On Tue, Oct 27, 2015 at 11:38:57PM -0700, Andy Lutomirski wrote: >> This switches virtio to use the DMA API unconditionally. I'm sure >> it breaks things, but it seems to work on x86 using virtio-pci, with >> and without Xen, and using both the

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Andy Lutomirski
On Tue, Oct 27, 2015 at 11:53 PM, David Woodhouse wrote: > On Tue, 2015-10-27 at 23:38 -0700, Andy Lutomirski wrote: >> >> Changes from v2: >> - Fix really embarrassing bug. This version actually works. > > So embarrassing you didn't want to tell us what it was? ... Shhh,

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread David Woodhouse
On Wed, 2015-10-28 at 16:40 +0900, Christian Borntraeger wrote: > Am 28.10.2015 um 16:17 schrieb Michael S. Tsirkin: > > On Tue, Oct 27, 2015 at 11:38:57PM -0700, Andy Lutomirski wrote: > > > This switches virtio to use the DMA API unconditionally. I'm sure > > > it breaks things, but it seems to

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Michael S. Tsirkin
On Wed, Oct 28, 2015 at 11:32:34PM +0900, David Woodhouse wrote: > > I don't have a problem with extending DMA API to address > > more usecases. > > No, this isn't an extension. This is fixing a bug, on certain platforms > where the DMA API has currently done the wrong thing. > > We have

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-10-28 Thread Andy Lutomirski
On Wed, Oct 28, 2015 at 9:12 AM, Michael S. Tsirkin wrote: > On Wed, Oct 28, 2015 at 11:32:34PM +0900, David Woodhouse wrote: >> > I don't have a problem with extending DMA API to address >> > more usecases. >> >> No, this isn't an extension. This is fixing a bug, on certain