From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v4 0/4] virtio: Clean up scatterlists and use the DMA API Date: Wed, 29 Jul 2015 10:17:18 +0200 Message-ID: <55B88C0E.9050104@redhat.com> References: <55B7799C.3060908@redhat.com> <20150728160358-mutt-send-email-mst@redhat.com> <55B77F8C.7010804@siemens.com> <55B7B15C.4010101@siemens.com> <55B7B91E.40200@siemens.com> <55B7D2A9.6040700@siemens.com> <55B7D8F5.1000902@siemens.com> <1438125694.7562.177.camel@kernel.crashing.org> <1438130185.7562.186.camel@kernel.crashing.org> 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 , Benjamin Herrenschmidt Cc: "linux-s390@vger.kernel.org" , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Jan Kiszka , xen-devel , Christian Borntraeger , "linux390@de.ibm.com" , Linux Virtualization List-ID: 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 included. > > > > Are there many virtio physical devices out there ? We are talking about > > a virtio flag right ? Or have you been considering something else ? > > 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. No, a virtio flag doesn't make sense. Blindly using system memory is a bug in QEMU; it has to be fixed to use the right address space, and then whatever the system provides to describe "the right address space" can be used (like the DMAR table on x86). On PPC I suppose you could use the host bridge's device tree? If you need a hook, you can add a bool virtio_should_bypass_iommu(void) { /* lookup something in the device tree?!? */ } EXPORT_SYMBOL_GPL(virtio_should_bypass_iommu); in some pseries.c file, and in the driver: static bool virtio_bypass_iommu(void) { bool (*fn)(void); fn = symbol_get(virtio_should_bypass_iommu); return fn && fn(); } Awful, but that's what this thing is. Paolo