{"id":815315,"url":"http://patchwork.ozlabs.org/api/covers/815315/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/cover/1505807208-9063-1-git-send-email-eric.auger@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<1505807208-9063-1-git-send-email-eric.auger@redhat.com>","list_archive_url":null,"date":"2017-09-19T07:46:32","name":"[RFC,v4,00/16] VIRTIO-IOMMU device","submitter":{"id":69187,"url":"http://patchwork.ozlabs.org/api/people/69187/?format=json","name":"Eric Auger","email":"eric.auger@redhat.com"},"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/cover/1505807208-9063-1-git-send-email-eric.auger@redhat.com/mbox/","series":[{"id":3796,"url":"http://patchwork.ozlabs.org/api/series/3796/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=3796","date":"2017-09-19T07:46:32","name":"VIRTIO-IOMMU device","version":4,"mbox":"http://patchwork.ozlabs.org/series/3796/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/815315/comments/","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx03.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eric.auger@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xxFNY30NJz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 19 Sep 2017 17:48:13 +1000 (AEST)","from localhost ([::1]:40580 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1duDGN-0007g8-7l\n\tfor incoming@patchwork.ozlabs.org; Tue, 19 Sep 2017 03:48:11 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47065)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1duDFb-0007dJ-C2\n\tfor qemu-devel@nongnu.org; Tue, 19 Sep 2017 03:47:24 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1duDFa-0000UV-5J\n\tfor qemu-devel@nongnu.org; Tue, 19 Sep 2017 03:47:23 -0400","from mx1.redhat.com ([209.132.183.28]:38302)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eric.auger@redhat.com>)\n\tid 1duDFU-0000QO-0i; Tue, 19 Sep 2017 03:47:16 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id CA5B47E44D;\n\tTue, 19 Sep 2017 07:47:14 +0000 (UTC)","from localhost.localdomain.com (ovpn-116-197.ams2.redhat.com\n\t[10.36.116.197])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 2C4A761348;\n\tTue, 19 Sep 2017 07:46:58 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com CA5B47E44D","From":"Eric Auger <eric.auger@redhat.com>","To":"eric.auger.pro@gmail.com, eric.auger@redhat.com, peter.maydell@linaro.org,\n\talex.williamson@redhat.com, mst@redhat.com, qemu-arm@nongnu.org,\n\tqemu-devel@nongnu.org, jean-philippe.brucker@arm.com","Date":"Tue, 19 Sep 2017 09:46:32 +0200","Message-Id":"<1505807208-9063-1-git-send-email-eric.auger@redhat.com>","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.27]);\n\tTue, 19 Sep 2017 07:47:15 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"[Qemu-devel] [RFC v4 00/16] VIRTIO-IOMMU device","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"wei@redhat.com, kevin.tian@intel.com, marc.zyngier@arm.com,\n\ttn@semihalf.com, \n\twill.deacon@arm.com, drjones@redhat.com, peterx@redhat.com,\n\tlinuc.decode@gmail.com, bharat.bhushan@nxp.com,\n\tchristoffer.dall@linaro.org","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"This series implements the virtio-iommu device.\n\nThis v4 is an upgrade to v0.4 spec [1] and applies on QEMU v2.10.0.\n- probe request support although no reserved region is returned at\n  the moment\n- unmap semantics less strict, as specified in v0.4\n- device registration, attach/detach revisited\n- split into smaller patches to ease review\n- propose a way to inform the IOMMU mr about the page_size_mask\n  of underlying HW IOMMU, if any\n- remove warning associated with the translation of the MSI doorbell\n\nThe device gets instantiated using the \"-device virtio-iommu-device\"\noption. It currently works with ARM virt machine only, as the machine\nmust handle the dt binding between the virtio-mmio \"iommu\" node and\nthe PCI host bridge node.\n\nThe associated VHOST/VFIO adaptation is available on the branch\nbelow but is not officially delivered as part of this series.\n\nBest Regards\n\nEric\n\nThis series can be found at:\nhttps://github.com/eauger/qemu/tree/v2.10.0-virtio-iommu-v4\n\nReferences:\n[1] [RFC] virtio-iommu version 0.4\n    git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n\nTesting:\n- guest kernel with v0.4 virtio-iommu driver (4kB page)\n- tested with guest using virtio-pci-net and vhost-net\n  (,vhost=on/off,iommu_platform,disable-modern=off,disable-legacy=on  )\n- tested with VFIO and guest assigned with 2 VFs\n- tested with DPDK on guest with 2 assigned VFs\n\nNot tested:\n- hot-plug/hot-unplug of EP: not implemented\n\nHistory:\nv2-> v4:\n- see above\n\nv2 -> v3:\n- rebase on top of 2.10-rc0 and especially\n  [PATCH qemu v9 0/2] memory/iommu: QOM'fy IOMMU MemoryRegion\n- add mutex init\n- fix as->mappings deletion using g_tree_ref/unref\n- when a dev is attached whereas it is already attached to\n  another address space, first detach it\n- fix some error values\n- page_sizes = TARGET_PAGE_MASK;\n- I haven't changed the unmap() semantics yet, waiting for the\n  next virtio-iommu spec revision.\n\nv1 -> v2:\n- fix redifinition of viommu_as typedef\n\nEric Auger (16):\n  update-linux-headers: import virtio_iommu.h\n  linux-headers: Update for virtio-iommu\n  virtio-iommu: add skeleton\n  virtio-iommu: Decode the command payload\n  virtio-iommu: Add the iommu regions\n  virtio-iommu: Register attached devices\n  virtio-iommu: Implement attach/detach command\n  virtio-iommu: Implement map/unmap\n  virtio-iommu: Implement translate\n  virtio-iommu: Implement probe request\n  hw/arm/virt: Add 2.11 machine type\n  hw/arm/virt: Add virtio-iommu to the virt board\n  memory.h: Add set_page_size_mask IOMMUMemoryRegion callback\n  hw/vfio/common: Set the IOMMUMemoryRegion supported page sizes\n  virtio-iommu: Implement set_page_size_mask\n  hw/vfio/common: Do not print error when viommu translates into an mmio\n    region\n\n hw/arm/virt.c                                 | 115 +++-\n hw/vfio/common.c                              |   7 +-\n hw/virtio/Makefile.objs                       |   1 +\n hw/virtio/trace-events                        |  24 +\n hw/virtio/virtio-iommu.c                      | 923 ++++++++++++++++++++++++++\n include/exec/memory.h                         |   4 +\n include/hw/arm/virt.h                         |   5 +\n include/hw/vfio/vfio-common.h                 |   1 +\n include/hw/virtio/virtio-iommu.h              |  61 ++\n include/standard-headers/linux/virtio_ids.h   |   1 +\n include/standard-headers/linux/virtio_iommu.h | 177 +++++\n linux-headers/linux/virtio_iommu.h            |   1 +\n scripts/update-linux-headers.sh               |   3 +\n 13 files changed, 1312 insertions(+), 11 deletions(-)\n create mode 100644 hw/virtio/virtio-iommu.c\n create mode 100644 include/hw/virtio/virtio-iommu.h\n create mode 100644 include/standard-headers/linux/virtio_iommu.h\n create mode 100644 linux-headers/linux/virtio_iommu.h"}