Michael S. Tsirkin
2015-Jul-28 13:06 UTC
[PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API
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 non-PPC, either have virtio always honor IOMMU, or enforce that > >> > virtio is not under IOMMU. > >> > > > I dislike having PPC special cased. > > > > In fact, today x86 guests also assume that virtio bypasses IOMMU I > > believe. In fact *all* guests do. > > 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.> > I would much prefer if the information as to whether it honors or not > > gets passed to the guest somewhat. My preference goes for passing it via > > the virtio config space but there were objections that it should be a > > bus property (which is tricky to do with PCI and doesn't properly > > reflect the fact that in qemu you can mix & match IOMMU-honoring devices > > and bypassing-virtio on the same bus). > > Yes, for example on x86 it must be passed through the DMAR table. > virtio-pci device must have a separate DRHD for them. In QEMU, you > could add an "under-iommu" property to PCI bridges, and walk the > hierarchy of bridges to build the DRHDs. > > Paolo-- MST
Jan Kiszka
2015-Jul-28 13:11 UTC
[PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API
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 never honors IOMMU >>>>> >>>>> - for non-PPC, either have virtio always honor IOMMU, or enforce that >>>>> virtio is not under IOMMU. >>>>> >>> I dislike having PPC special cased. >>> >>> In fact, today x86 guests also assume that virtio bypasses IOMMU I >>> believe. In fact *all* guests do. >> >> 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, no known issues with vt-d emulation for almost a year now. Error reporting could be improved, and interrupt remapping is still missing, but those are minor issues in this context. In my testing setups, I also have virtio devices in use, passed through to an L2 guest, but only in 1:1 mapping so that their broken IOMMU support causes no practical problems. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux
Andy Lutomirski
2015-Jul-28 16:11 UTC
[PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API
On Jul 28, 2015 6:11 AM, "Jan Kiszka" <jan.kiszka at siemens.com> 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 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 under IOMMU. > >>>>> > >>> I dislike having PPC special cased. > >>> > >>> In fact, today x86 guests also assume that virtio bypasses IOMMU I > >>> believe. In fact *all* guests do. > >> > >> 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, no known issues with vt-d emulation for almost a year now. Error > reporting could be improved, and interrupt remapping is still missing, > but those are minor issues in this context. > > In my testing setups, I also have virtio devices in use, passed through > to an L2 guest, but only in 1:1 mapping so that their broken IOMMU > support causes no practical problems. >How are you getting 1:1 to work? Is it something that L0 QEMU can advertise to L1? If so, can we just do that unconditionally, which would make my patch work? I have no objection to 1:1 devices in general. It's only devices that the PCI code on the guest identifies as not 1:1 but that are nonetheless 1:1 that cause problems.
Paolo Bonzini
2015-Jul-28 16:36 UTC
[PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API
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, no known issues with vt-d emulation for almost a year now. Error > reporting could be improved, and interrupt remapping is still missing, > but those are minor issues in this context.On the other hand interrupt remapping is absolutely necessary for production use, hence my point that x86 does not promise API stability. ("Any kind of stability" actually didn't include crashes; those are not expected :)) The Google patches for userspace PIC and IOAPIC are proceeding well, so hopefully we can have interrupt remapping soon. Paolo
Maybe Matching Threads
- [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API
- [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API
- [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API
- [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API
- [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API