Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-20 Thread Andy Lutomirski
On Apr 20, 2016 6:14 AM, "Michael S. Tsirkin" wrote: > > On Tue, Apr 19, 2016 at 02:07:01PM -0700, Andy Lutomirski wrote: > > On Tue, Apr 19, 2016 at 1:54 PM, Michael S. Tsirkin wrote: > > > On Tue, Apr 19, 2016 at 01:27:29PM -0700, Andy Lutomirski wrote: > > >>

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-20 Thread Michael S. Tsirkin
On Tue, Apr 19, 2016 at 02:07:01PM -0700, Andy Lutomirski wrote: > On Tue, Apr 19, 2016 at 1:54 PM, Michael S. Tsirkin wrote: > > On Tue, Apr 19, 2016 at 01:27:29PM -0700, Andy Lutomirski wrote: > >> On Tue, Apr 19, 2016 at 1:16 PM, Michael S. Tsirkin > >>

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Andy Lutomirski
On Tue, Apr 19, 2016 at 1:54 PM, Michael S. Tsirkin wrote: > On Tue, Apr 19, 2016 at 01:27:29PM -0700, Andy Lutomirski wrote: >> On Tue, Apr 19, 2016 at 1:16 PM, Michael S. Tsirkin wrote: >> > On Tue, Apr 19, 2016 at 11:01:38AM -0700, Andy Lutomirski wrote: >>

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Michael S. Tsirkin
On Tue, Apr 19, 2016 at 01:27:29PM -0700, Andy Lutomirski wrote: > On Tue, Apr 19, 2016 at 1:16 PM, Michael S. Tsirkin wrote: > > On Tue, Apr 19, 2016 at 11:01:38AM -0700, Andy Lutomirski wrote: > >> On Tue, Apr 19, 2016 at 10:49 AM, Michael S. Tsirkin > >>

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Andy Lutomirski
On Tue, Apr 19, 2016 at 1:16 PM, Michael S. Tsirkin wrote: > On Tue, Apr 19, 2016 at 11:01:38AM -0700, Andy Lutomirski wrote: >> On Tue, Apr 19, 2016 at 10:49 AM, Michael S. Tsirkin wrote: >> > On Tue, Apr 19, 2016 at 12:26:44PM -0400, David Woodhouse wrote: >>

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Michael S. Tsirkin
On Tue, Apr 19, 2016 at 11:01:38AM -0700, Andy Lutomirski wrote: > On Tue, Apr 19, 2016 at 10:49 AM, Michael S. Tsirkin wrote: > > On Tue, Apr 19, 2016 at 12:26:44PM -0400, David Woodhouse wrote: > >> On Tue, 2016-04-19 at 19:20 +0300, Michael S. Tsirkin wrote: > >> > > >> > > I

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Andy Lutomirski
On Tue, Apr 19, 2016 at 10:49 AM, Michael S. Tsirkin wrote: > On Tue, Apr 19, 2016 at 12:26:44PM -0400, David Woodhouse wrote: >> On Tue, 2016-04-19 at 19:20 +0300, Michael S. Tsirkin wrote: >> > >> > > I thought that PLATFORM served that purpose. Woudn't the host >> > >

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Michael S. Tsirkin
On Tue, Apr 19, 2016 at 12:26:44PM -0400, David Woodhouse wrote: > On Tue, 2016-04-19 at 19:20 +0300, Michael S. Tsirkin wrote: > > > > > I thought that PLATFORM served that purpose.  Woudn't the host > > > advertise PLATFORM support and, if the guest doesn't ack it, the host > > > device would

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread David Woodhouse
On Tue, 2016-04-19 at 19:20 +0300, Michael S. Tsirkin wrote: > > > I thought that PLATFORM served that purpose.  Woudn't the host > > advertise PLATFORM support and, if the guest doesn't ack it, the host > > device would skip translation?  Or is that problematic for vfio? > > Exactly that's

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Michael S. Tsirkin
On Tue, Apr 19, 2016 at 09:12:03AM -0700, Andy Lutomirski wrote: > On Tue, Apr 19, 2016 at 9:09 AM, Michael S. Tsirkin wrote: > > On Tue, Apr 19, 2016 at 09:02:14AM -0700, Andy Lutomirski wrote: > >> On Tue, Apr 19, 2016 at 3:27 AM, Michael S. Tsirkin > >>

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Andy Lutomirski
On Tue, Apr 19, 2016 at 9:09 AM, Michael S. Tsirkin wrote: > On Tue, Apr 19, 2016 at 09:02:14AM -0700, Andy Lutomirski wrote: >> On Tue, Apr 19, 2016 at 3:27 AM, Michael S. Tsirkin wrote: >> > On Mon, Apr 18, 2016 at 12:24:15PM -0700, Andy Lutomirski wrote: >>

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Michael S. Tsirkin
On Tue, Apr 19, 2016 at 09:02:14AM -0700, Andy Lutomirski wrote: > On Tue, Apr 19, 2016 at 3:27 AM, Michael S. Tsirkin wrote: > > On Mon, Apr 18, 2016 at 12:24:15PM -0700, Andy Lutomirski wrote: > >> On Mon, Apr 18, 2016 at 11:29 AM, David Woodhouse > >>

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Andy Lutomirski
On Apr 19, 2016 2:13 AM, "Michael S. Tsirkin" wrote: > > > I guess you are right in that we should split this part out. > What I wanted is really the combination > PASSTHROUGH && !PLATFORM so that we can say "ok we don't > need to guess, this device actually bypasses the IOMMU".

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Michael S. Tsirkin
On Tue, Apr 19, 2016 at 09:00:27AM -0700, Andy Lutomirski wrote: > On Apr 19, 2016 2:13 AM, "Michael S. Tsirkin" wrote: > > > > > > I guess you are right in that we should split this part out. > > What I wanted is really the combination > > PASSTHROUGH && !PLATFORM so that we can

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Andy Lutomirski
On Tue, Apr 19, 2016 at 3:27 AM, Michael S. Tsirkin wrote: > On Mon, Apr 18, 2016 at 12:24:15PM -0700, Andy Lutomirski wrote: >> On Mon, Apr 18, 2016 at 11:29 AM, David Woodhouse >> wrote: >> > For x86, you *can* enable virtio-behind-IOMMU if your DMAR

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Alex Williamson
On Tue, 19 Apr 2016 12:13:29 +0300 "Michael S. Tsirkin" wrote: > On Mon, Apr 18, 2016 at 02:29:33PM -0400, David Woodhouse wrote: > > On Mon, 2016-04-18 at 19:27 +0300, Michael S. Tsirkin wrote: > > > I balk at adding more hacks to a broken system. My goals are > > > merely to

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Michael S. Tsirkin
On Mon, Apr 18, 2016 at 12:24:15PM -0700, Andy Lutomirski wrote: > On Mon, Apr 18, 2016 at 11:29 AM, David Woodhouse wrote: > > For x86, you *can* enable virtio-behind-IOMMU if your DMAR tables tell > > the truth, and even legacy kernels ought to cope with that. > > FSVO

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-19 Thread Michael S. Tsirkin
On Mon, Apr 18, 2016 at 02:29:33PM -0400, David Woodhouse wrote: > On Mon, 2016-04-18 at 19:27 +0300, Michael S. Tsirkin wrote: > > I balk at adding more hacks to a broken system. My goals are > > merely to > > - make things work correctly with an IOMMU and new guests, > >   so people can use

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread Andy Lutomirski
On Mon, Apr 18, 2016 at 11:29 AM, David Woodhouse wrote: > For x86, you *can* enable virtio-behind-IOMMU if your DMAR tables tell > the truth, and even legacy kernels ought to cope with that. > FSVO 'ought to' where I suspect some of them will actually crash with a > NULL

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread David Woodhouse
On Mon, 2016-04-18 at 19:27 +0300, Michael S. Tsirkin wrote: > I balk at adding more hacks to a broken system. My goals are > merely to > - make things work correctly with an IOMMU and new guests, >   so people can use userspace drivers with virtio devices > - prevent security risks when guest

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread Michael S. Tsirkin
On Mon, Apr 18, 2016 at 11:51:41AM -0400, David Woodhouse wrote: > On Mon, 2016-04-18 at 18:30 +0300, Michael S. Tsirkin wrote: > > > > > Setting (only) VIRTIO_F_IOMMU_PASSTHROUGH indicates to the guest that > > > its own operating system's IOMMU code is expected to be broken, and > > > that the

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread David Woodhouse
On Mon, 2016-04-18 at 18:30 +0300, Michael S. Tsirkin wrote: > > > Setting (only) VIRTIO_F_IOMMU_PASSTHROUGH indicates to the guest that > > its own operating system's IOMMU code is expected to be broken, and > > that the virtio driver should eschew the DMA API? > > No - it tells guest that e.g.

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread Michael S. Tsirkin
On Mon, Apr 18, 2016 at 11:22:03AM -0400, David Woodhouse wrote: > On Mon, 2016-04-18 at 17:23 +0300, Michael S. Tsirkin wrote: > > > > This patch doesn't change DMAR tables, it creates a way for virtio > > device to tell guest "I obey what DMAR tables tell you, you can stop > > doing hacks". > >

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread David Woodhouse
On Mon, 2016-04-18 at 17:23 +0300, Michael S. Tsirkin wrote: > > This patch doesn't change DMAR tables, it creates a way for virtio > device to tell guest "I obey what DMAR tables tell you, you can stop > doing hacks". > > And as PPC guys seem adamant that platform tools there are no good for >

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread Michael S. Tsirkin
On Mon, Apr 18, 2016 at 10:03:52AM -0400, David Woodhouse wrote: > On Mon, 2016-04-18 at 16:12 +0300, Michael S. Tsirkin wrote: > > I'm not sure I understand the issue.  The public API is not about how > > the driver works.  It doesn't say "don't use DMA API" anywhere, does it? > > It's about

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread David Woodhouse
On Mon, 2016-04-18 at 16:12 +0300, Michael S. Tsirkin wrote: > I'm not sure I understand the issue.  The public API is not about how > the driver works.  It doesn't say "don't use DMA API" anywhere, does it? > It's about telling device whether to obey the IOMMU and > about discovering whether a

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread Michael S. Tsirkin
On Mon, Apr 18, 2016 at 07:58:37AM -0400, David Woodhouse wrote: > On Mon, 2016-04-18 at 14:47 +0300, Michael S. Tsirkin wrote: > > This adds a flag to enable/disable bypassing the IOMMU by > > virtio devices. > > I'm still deeply unhappy with having this kind of hack in the virtio > code at all,

Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread David Woodhouse
On Mon, 2016-04-18 at 14:47 +0300, Michael S. Tsirkin wrote: > This adds a flag to enable/disable bypassing the IOMMU by > virtio devices. I'm still deeply unhappy with having this kind of hack in the virtio code at all, as you know. Drivers should just use the DMA API and if the *platform* wants

[Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api

2016-04-18 Thread Michael S. Tsirkin
This adds a flag to enable/disable bypassing the IOMMU by virtio devices. This is on top of patch http://article.gmane.org/gmane.comp.emulators.qemu/403467 virtio: convert to use DMA api Tested with patchset http://article.gmane.org/gmane.linux.kernel.virtualization/27545 virtio-pci: iommu