Re: [RFC 7/11] virtio_pci: new, capability-aware driver.
From: Stefan Hajnoczi <hidden>
Date: 2012-01-12 10:37:58
On Wed, Jan 11, 2012 at 8:46 PM, Benjamin Herrenschmidt [off-list ref] wrote:
On Wed, 2012-01-11 at 14:28 +0000, Stefan Hajnoczi wrote:quoted
On Wed, Jan 11, 2012 at 9:10 AM, Benjamin Herrenschmidt [off-list ref] wrote:quoted
On Wed, 2012-01-11 at 08:47 +0000, Stefan Hajnoczi wrote:quoted
This is also an opportunity to stop using CPU physical addresses in the ring and instead perform DMA like a normal PCI device (use bus addresses).Euh why ?Because it's a paravirt hack that ends up hitting corner cases. It's not possible to do virtio-pci passthrough under nested virtualization unless we use an IOMMU. Imagine passing virtio-net from L0 into the L2 guest (i.e. PCI-passthrough). If virtio-pci is really "PCI" this should be possible but it's not when we use physical addresses instead of bus addresses.Is this just an academic exercise or is there any actual value in doing this ?
It's a corner case, the value is small. I also hit this with virtio on SPARC which is made difficult by the fact that the Solaris kernel assumes there is an IOMMU for scatter-gather and doesn't provide functions for allocating physically contiguous memory in drivers. It's another instance where this shortcut comes up against problems and behaving like a real PCI device would work fine.
Using an iommu is going to slaugher your performance, so at the very least it should be kept an option.
That's a good idea. By default it can continue to use physical addresses. I guess there's no point in worrying about it until we have a real user. Stefan