Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-29 Thread Benjamin Herrenschmidt
On Wed, 2015-07-29 at 10:17 +0200, Paolo Bonzini wrote: > > On 29/07/2015 02:47, Andy Lutomirski wrote: > > > > If new kernels ignore the IOMMU for devices that don't set the flag > > > > and there are physical devices that already exist and don't set the > > > > flag, then those devices won't wor

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-29 Thread Jan Kiszka
On 2015-07-29 10:17, Paolo Bonzini wrote: > > > On 29/07/2015 02:47, Andy Lutomirski wrote: If new kernels ignore the IOMMU for devices that don't set the flag and there are physical devices that already exist and don't set the flag, then those devices won't work reliably on most m

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-29 Thread Paolo Bonzini
On 29/07/2015 02:47, Andy Lutomirski wrote: > > > If new kernels ignore the IOMMU for devices that don't set the flag > > > and there are physical devices that already exist and don't set the > > > flag, then those devices won't work reliably on most modern > > > non-virtual platforms, PPC includ

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-29 Thread Jan Kiszka
On 2015-07-29 01:21, Benjamin Herrenschmidt wrote: > On Tue, 2015-07-28 at 15:43 -0700, Andy Lutomirski wrote: >> New QEMU >> always advertises this feature flag. If iommu=on, QEMU's virtio >> devices refuse to work unless the driver acknowledges the flag. > > This should be configurable. Adve

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Benjamin Herrenschmidt
On Tue, 2015-07-28 at 17:47 -0700, Andy Lutomirski wrote: > Yes, virtio flag. I dislike having a virtio flag at all, but so far > no one has come up with any better ideas. If there was a reliable, > cross-platform mechanism for per-device PCI bus properties, I'd be all > for using that instead.

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 5:36 PM, Benjamin Herrenschmidt wrote: > On Tue, 2015-07-28 at 16:33 -0700, Andy Lutomirski wrote: >> On Tue, Jul 28, 2015 at 4:21 PM, Benjamin Herrenschmidt >> wrote: >> > On Tue, 2015-07-28 at 15:43 -0700, Andy Lutomirski wrote: >> >> Let me try to summarize a proposal:

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Benjamin Herrenschmidt
On Tue, 2015-07-28 at 16:33 -0700, Andy Lutomirski wrote: > On Tue, Jul 28, 2015 at 4:21 PM, Benjamin Herrenschmidt > wrote: > > On Tue, 2015-07-28 at 15:43 -0700, Andy Lutomirski wrote: > >> Let me try to summarize a proposal: > >> > >> Add a feature flag that indicates IOMMU support. > >> > >> N

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 4:21 PM, Benjamin Herrenschmidt wrote: > On Tue, 2015-07-28 at 15:43 -0700, Andy Lutomirski wrote: >> Let me try to summarize a proposal: >> >> Add a feature flag that indicates IOMMU support. >> >> New kernels acknowledge that flag on any device that advertises it. >> >> N

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Benjamin Herrenschmidt
On Tue, 2015-07-28 at 15:43 -0700, Andy Lutomirski wrote: > Let me try to summarize a proposal: > > Add a feature flag that indicates IOMMU support. > > New kernels acknowledge that flag on any device that advertises it. > > New kernels always respect the IOMMU (except on PowerPC). Why ? I disa

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
Let me try to summarize a proposal: Add a feature flag that indicates IOMMU support. New kernels acknowledge that flag on any device that advertises it. New kernels always respect the IOMMU (except on PowerPC). New kernels optionally refuse to talk to devices that don't have that feature flag i

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 12:33 PM, Jan Kiszka wrote: > On 2015-07-28 21:24, Andy Lutomirski wrote: >> On Tue, Jul 28, 2015 at 12:06 PM, Jan Kiszka wrote: >>> On 2015-07-28 20:22, Andy Lutomirski wrote: On Tue, Jul 28, 2015 at 10:17 AM, Jan Kiszka wrote: > On 2015-07-28 19:10, Andy

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Jan Kiszka
On 2015-07-28 21:24, Andy Lutomirski wrote: > On Tue, Jul 28, 2015 at 12:06 PM, Jan Kiszka wrote: >> On 2015-07-28 20:22, Andy Lutomirski wrote: >>> On Tue, Jul 28, 2015 at 10:17 AM, Jan Kiszka wrote: On 2015-07-28 19:10, Andy Lutomirski wrote: > The trouble is that this is really a prop

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 12:06 PM, Jan Kiszka wrote: > On 2015-07-28 20:22, Andy Lutomirski wrote: >> On Tue, Jul 28, 2015 at 10:17 AM, Jan Kiszka wrote: >>> On 2015-07-28 19:10, Andy Lutomirski wrote: The trouble is that this is really a property of the bus and not of the device. If yo

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Jan Kiszka
On 2015-07-28 20:22, Andy Lutomirski wrote: > On Tue, Jul 28, 2015 at 10:17 AM, Jan Kiszka wrote: >> On 2015-07-28 19:10, Andy Lutomirski wrote: >>> The trouble is that this is really a property of the bus and not of >>> the device. If you build a virtio device that physically plugs into a >>> PC

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 10:17 AM, Jan Kiszka wrote: > On 2015-07-28 19:10, Andy Lutomirski wrote: >> The trouble is that this is really a property of the bus and not of >> the device. If you build a virtio device that physically plugs into a >> PCIe slot, the device has no concept of an IOMMU in

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 19:19, Jan Kiszka wrote: > On 2015-07-28 19:15, Paolo Bonzini wrote: >> >> >> On 28/07/2015 18:42, Jan Kiszka wrote: On the other hand interrupt remapping is absolutely necessary for production use, hence my point that x86 does not promise API stability. >>> >>> Well, we c

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Jan Kiszka
On 2015-07-28 19:15, Paolo Bonzini wrote: > > > On 28/07/2015 18:42, Jan Kiszka wrote: >>> On the other hand interrupt remapping is absolutely necessary for >>> production use, hence my point that x86 does not promise API stability. >> >> Well, we currently implement the features that the Q35 use

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Jan Kiszka
On 2015-07-28 19:10, Andy Lutomirski wrote: > On Tue, Jul 28, 2015 at 9:44 AM, Jan Kiszka wrote: >> The ability to have virtio on systems with IOMMU in place makes testing >> much more efficient for us. Ideally, we would have it in non-identity >> mapping scenarios as well, e.g. to start secondary

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 18:42, Jan Kiszka wrote: > > On the other hand interrupt remapping is absolutely necessary for > > production use, hence my point that x86 does not promise API stability. > > Well, we currently implement the features that the Q35 used to expose. > Adding interrupt remapping will re

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Tue, Jul 28, 2015 at 9:44 AM, Jan Kiszka wrote: > The ability to have virtio on systems with IOMMU in place makes testing > much more efficient for us. Ideally, we would have it in non-identity > mapping scenarios as well, e.g. to start secondary Linux instances in > the test VMs, giving them t

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Jan Kiszka
On 2015-07-28 18:11, Andy Lutomirski wrote: > On Jul 28, 2015 6:11 AM, "Jan Kiszka" wrote: >> >> On 2015-07-28 15:06, Michael S. Tsirkin wrote: >>> On Tue, Jul 28, 2015 at 02:46:20PM +0200, Paolo Bonzini wrote: On 28/07/2015 12:12, Benjamin Herrenschmidt wrote: >>> That is an ex

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Jan Kiszka
On 2015-07-28 18:36, Paolo Bonzini wrote: > On 28/07/2015 15:11, Jan Kiszka wrote: >> >> This doesn't matter much, since the only guests that implement an IOMMU >> in QEMU are (afaik) PPC and x86, and x86 does not yet promise any kind >> of stability. Hmm I think Jan (cc)

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 15:11, Jan Kiszka wrote: >>> >> >>> >> This doesn't matter much, since the only guests that implement an IOMMU >>> >> in QEMU are (afaik) PPC and x86, and x86 does not yet promise any kind >>> >> of stability. >> > >> > Hmm I think Jan (cc) said it was already used out there. > Yes

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Andy Lutomirski
On Jul 28, 2015 6:11 AM, "Jan Kiszka" wrote: > > On 2015-07-28 15:06, Michael S. Tsirkin wrote: > > On Tue, Jul 28, 2015 at 02:46:20PM +0200, Paolo Bonzini wrote: > >> > >> > >> On 28/07/2015 12:12, Benjamin Herrenschmidt wrote: > > That is an experimental feature (it's x-iommu), so it can cha

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Jan Kiszka
On 2015-07-28 15:06, Michael S. Tsirkin wrote: > On Tue, Jul 28, 2015 at 02:46:20PM +0200, Paolo Bonzini wrote: >> >> >> On 28/07/2015 12:12, Benjamin Herrenschmidt wrote: > That is an experimental feature (it's x-iommu), so it can change. > > The plan was: > > - for PPC, virtio

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Michael S. Tsirkin
On Mon, Jul 27, 2015 at 06:08:59PM -0700, Andy Lutomirski wrote: > On Mon, Sep 1, 2014 at 10:39 AM, Andy Lutomirski wrote: > > This fixes virtio on Xen guests as well as on any other platform > > that uses virtio_pci on which physical addresses don't match bus > > addresses. > > > > This can be te

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Michael S. Tsirkin
On Tue, Jul 28, 2015 at 02:46:20PM +0200, Paolo Bonzini wrote: > > > On 28/07/2015 12:12, Benjamin Herrenschmidt wrote: > >> > That is an experimental feature (it's x-iommu), so it can change. > >> > > >> > The plan was: > >> > > >> > - for PPC, virtio never honors IOMMU > >> > > >> > - for no

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 12:12, Benjamin Herrenschmidt wrote: >> > That is an experimental feature (it's x-iommu), so it can change. >> > >> > The plan was: >> > >> > - for PPC, virtio never honors IOMMU >> > >> > - for non-PPC, either have virtio always honor IOMMU, or enforce that >> > virtio is not un

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Benjamin Herrenschmidt
On Tue, 2015-07-28 at 10:16 +0200, Paolo Bonzini wrote: > > On 28/07/2015 03:08, Andy Lutomirski wrote: > > On Mon, Sep 1, 2014 at 10:39 AM, Andy Lutomirski > > wrote: > >> This fixes virtio on Xen guests as well as on any other platform > >> that uses virtio_pci on which physical addresses don'

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Paolo Bonzini
On 28/07/2015 03:08, Andy Lutomirski wrote: > On Mon, Sep 1, 2014 at 10:39 AM, Andy Lutomirski wrote: >> This fixes virtio on Xen guests as well as on any other platform >> that uses virtio_pci on which physical addresses don't match bus >> addresses. >> >> This can be tested with: >> >> vir

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-28 Thread Christian Borntraeger
Am 28.07.2015 um 03:08 schrieb Andy Lutomirski: > On Mon, Sep 1, 2014 at 10:39 AM, Andy Lutomirski wrote: >> This fixes virtio on Xen guests as well as on any other platform >> that uses virtio_pci on which physical addresses don't match bus >> addresses. >> >> This can be tested with: >> >> v

Re: [Xen-devel] [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API

2015-07-27 Thread Andy Lutomirski
On Mon, Sep 1, 2014 at 10:39 AM, Andy Lutomirski wrote: > This fixes virtio on Xen guests as well as on any other platform > that uses virtio_pci on which physical addresses don't match bus > addresses. > > This can be tested with: > > virtme-run --xen xen --kimg arch/x86/boot/bzImage --consol