From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0nYf-0007LQ-7e for qemu-devel@nongnu.org; Mon, 23 Nov 2015 04:37:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0nYa-0000vj-7b for qemu-devel@nongnu.org; Mon, 23 Nov 2015 04:37:13 -0500 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:43656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0nYZ-0000vQ-VI for qemu-devel@nongnu.org; Mon, 23 Nov 2015 04:37:08 -0500 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Nov 2015 09:37:05 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id CFE2B2190067 for ; Mon, 23 Nov 2015 09:36:41 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAN9aled3473900 for ; Mon, 23 Nov 2015 09:36:47 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAN9al76031006 for ; Mon, 23 Nov 2015 02:36:47 -0700 Date: Mon, 23 Nov 2015 10:36:45 +0100 From: Cornelia Huck Message-ID: <20151123103645.4c899f97.cornelia.huck@de.ibm.com> In-Reply-To: <1448264471-25066-1-git-send-email-jasowang@redhat.com> References: <1448264471-25066-1-git-send-email-jasowang@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] virtio: convert to use DMA api List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: qemu-devel@nongnu.org, mst@redhat.com On Mon, 23 Nov 2015 15:41:11 +0800 Jason Wang wrote: > Currently, all virtio devices bypass IOMMU completely. This is because > address_space_memory is assumed and used during DMA emulation. This > patch converts the virtio core API to use DMA API. This idea is > > - introducing a new transport specific helper to query the dma address > space. (only pci version is implemented). > - query and use this address space during virtio device guest memory > accessing > > With this virtiodevices will not bypass IOMMU anymore. Little tested with > intel_iommu=on with virtio guest DMA series posted in > https://lkml.org/lkml/2015/10/28/64. > > TODO: > - Feature bit for this I'm still not convinced about that feature bit stuff. It just feels wrong to use a mechanism that conveys negotiable device features to configure what is basically a platform/hypervisor feature. I'd rather see this out of the virtio layer and into the pci layer. > - Implement this for all transports Is it OK to just keep a fallback to today's implementation for transports for which the iommu concept doesn't make sense and that will always have an identity mapping? > > Signed-off-by: Jason Wang > --- > hw/block/virtio-blk.c | 2 +- > hw/char/virtio-serial-bus.c | 2 +- > hw/scsi/virtio-scsi.c | 2 +- > hw/virtio/virtio-pci.c | 9 +++++++++ > hw/virtio/virtio.c | 36 +++++++++++++++++++-------------- > include/hw/virtio/virtio-access.h | 42 +++++++++++++++++++++++++++++---------- > include/hw/virtio/virtio-bus.h | 1 + > include/hw/virtio/virtio.h | 2 +- > 8 files changed, 67 insertions(+), 29 deletions(-) FWIW, this doesn't seem to break for the s390-ccw-virtio machine (only snifftested).