From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asA66-0007eL-Dm for qemu-devel@nongnu.org; Mon, 18 Apr 2016 10:24:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asA62-0006Pq-VQ for qemu-devel@nongnu.org; Mon, 18 Apr 2016 10:24:18 -0400 Date: Mon, 18 Apr 2016 17:23:54 +0300 From: "Michael S. Tsirkin" Message-ID: <20160418170534-mutt-send-email-mst@redhat.com> References: <1460979793-6621-1-git-send-email-mst@redhat.com> <1460980717.12793.43.camel@infradead.org> <20160418160731-mutt-send-email-mst@redhat.com> <1460988232.22654.7.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1460988232.22654.7.camel@infradead.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH RFC] fixup! virtio: convert to use DMA api List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Woodhouse Cc: qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, peterx@redhat.com, cornelia.huck@de.ibm.com, Stefan Hajnoczi , Kevin Wolf , Amit Shah , qemu-block@nongnu.org, Jason Wang , Alex Williamson , Andy Lutomirski , Christian Borntraeger , Wei Liu , virtualization@lists.linux-foundation.org, kvm@vger.kernel.org On Mon, Apr 18, 2016 at 10:03:52AM -0400, David Woodhouse wrote: > On Mon, 2016-04-18 at 16:12 +0300, Michael S. Tsirkin wrote: > > I'm not sure I understand the issue.=A0=A0The public API is not about= how > > the driver works.=A0=A0It doesn't say "don't use DMA API" anywhere, d= oes it? > > It's about telling device whether to obey the IOMMU and > > about discovering whether a device is in fact under the IOMMU. >=20 > Apologies, I was wrongly reading this as a kernel patch. >=20 > After a brief struggle with "telling device whether to obey the IOMMU", > which is obviously completely impossible from the guest kernel, I > realise my mistake :) >=20 > So... on x86 how does this get reflected in the DMAR tables that the > guest BIOS presents to the guest kernel, so that the guest kernel > *knows* which devices are behind which IOMMU? This patch doesn't change DMAR tables, it creates a way for virtio device to tell guest "I obey what DMAR tables tell you, you can stop doing hacks". And as PPC guys seem adamant that platform tools there are no good for that purpose, there's another bit that says "ignore what platform tells you, I'm not a real device - I'm part of hypervisor and I bypass the IOMMU". > (And are you fixing the case of assigned PCI devices, which aren't > behind any IOMMU, at the same time as you answer that? :) No - Aviv B.D. has patches on list to fix that. --=20 MST