From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PATCH v5 2/3] virtio_pci: Use the DMA API for virtqueues when possible Date: Thu, 25 Sep 2014 08:04:57 +1000 Message-ID: <1411596297.4184.50.camel@pasglop> References: <6c31406005160303a7ee291a933c267f8e55fa85.1410931077.git.luto@amacapital.net> <1410955351.30672.27.camel@pasglop> <20140917141639.GA13684@redhat.com> <1411162406.30672.64.camel@pasglop> <1411275788.30672.79.camel@pasglop> <1411275943.30672.81.camel@pasglop> <1411595404.4184.48.camel@pasglop> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Archive: List-Post: To: Andy Lutomirski Cc: "linux-s390@vger.kernel.org" , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Linux Virtualization , Christian Borntraeger , "linux390@de.ibm.com" , Paolo Bonzini , David Woodhouse List-ID: On Wed, 2014-09-24 at 14:59 -0700, Andy Lutomirski wrote: > Scratch that idea, then. > > The best that I can currently come up with is to say that pre-1.0 > devices on PPC bypass the IOMMU and that 1.0 devices on PPC and all > devices on all other architectures do not bypass the IOMMU. Well, the thing is, we *want* them to bypass the IOMMU for performance reasons in the long run. Today we have no ways to tell our guests that a PCI bus doesn't have an IOMMU, they always do ! Also qemu can mix and match devices on a given PCI bus so making this a bus property wouldn't work either. > I agree that this is far from ideal. Any ideas? Is there any other > channel that QEMU can use to signal to a PPC guest that a specific PCI > virtio device isn't really behind an IOMMU? Any reason why this can't be a virtio capability ? > From my POV, the main > consideration is that existing QEMU versions hosting Xen hypervisors > should work, which is not the case in current kernels, but which is > the case with my patches without any known regressions. > > Is there some evil trick that a PPC guest could use to detect whether > the IOMMU is honored? As an example that I don't like at all, the > guest could program the IOMMU so that the ring's physical address maps > to a second copy of the ring and then see which one works. Cheers, Ben.