[{"id":1776065,"web_url":"http://patchwork.ozlabs.org/comment/1776065/","msgid":"<AM5PR0401MB25458FFED2D7D405A71F954C9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-09-27T06:46:18","subject":"Re: [Qemu-devel] [PATCH v4 0/5] virtio-iommu: VFIO integration","submitter":{"id":70741,"url":"http://patchwork.ozlabs.org/api/people/70741/","name":"Bharat Bhushan","email":"bharat.bhushan@nxp.com"},"content":"Hi Peter,\n\nWhile vfio with virtio-iommu I observed one issue,  When virtio-iommu device exists but guest kernel does not have virtio-iommu driver (not enabled in Config) then IOMMU faults are reported on host.\n\nThis is because no mapping is created in IOMMU, not even default guest-physical to real-physical. While looking at vfio_listener_region_add(), it does not create initial mapping in IOMMU and relies on guest to create mapping. Is this something known or I am missing something?\n\nThanks\n-Bharat\n\n> -----Original Message-----\n> From: Bharat Bhushan [mailto:Bharat.Bhushan@nxp.com]\n> Sent: Wednesday, September 27, 2017 12:03 PM\n> To: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n> qemu-arm@nongnu.org; qemu-devel@nongnu.org\n> Cc: wei@redhat.com; kevin.tian@intel.com; marc.zyngier@arm.com;\n> tn@semihalf.com; will.deacon@arm.com; drjones@redhat.com;\n> robin.murphy@arm.com; christoffer.dall@linaro.org;\n> bharatb.yadav@gmail.com; Bharat Bhushan <bharat.bhushan@nxp.com>\n> Subject: [PATCH v4 0/5] virtio-iommu: VFIO integration\n> \n> This patch series integrates VFIO/VHOST with virtio-iommu.\n> \n> This version is mainly about rebasing on v4 version on virtio-iommu device\n> framework from Eric Augur and addresing review comments.\n> \n> This patch series allows PCI pass-through using virtio-iommu.\n> \n> This series is based on:\n>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n>     [1] [RFC] virtio-iommu version 0.4\n>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n> \n>  - virtio-iommu device emulation by Eric Augur.\n>    [RFC v4 00/16] VIRTIO-IOMMU device\n>    https://github.com/eauger/qemu/tree/v2.10.0-virtio-iommu-v4\n> \n> Changes are available at : https://github.com/bharaty/qemu.git virtio-\n> iommu-vfio-integration-v4\n> \n> v3->v4:\n>  - Rebase to v4 version from Eric\n>  - Fixes from Eric with DPDK in VM\n>  - Logical division in multiple patches\n> \n> v2->v3:\n>  - This series is based on \"[RFC v3 0/8] VIRTIO-IOMMU device\"\n>    Which is based on top of v2.10-rc0 that\n>  - Fixed issue with two PCI devices\n>  - Addressed review comments\n> \n> v1->v2:\n>   - Added trace events\n>   - removed vSMMU3 link in patch description\n> \n> Bharat Bhushan (5):\n>   target/arm/kvm: Translate the MSI doorbell in kvm_arch_fixup_msi_route\n>   virtio-iommu: Add iommu notifier for map/unmap\n>   virtio-iommu: Call iommu notifier for attach/detach\n>   virtio-iommu: add iommu replay\n>   virtio-iommu: add iommu notifier memory-region\n> \n>  hw/virtio/trace-events           |   5 ++\n>  hw/virtio/virtio-iommu.c         | 181\n> ++++++++++++++++++++++++++++++++++++++-\n>  include/hw/virtio/virtio-iommu.h |   6 ++\n>  target/arm/kvm.c                 |  27 ++++++\n>  target/arm/trace-events          |   3 +\n>  5 files changed, 219 insertions(+), 3 deletions(-)\n> \n> --\n> 1.9.3","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"CxycgCKl\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.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 3y27hV1twjz9t3x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 16:48:58 +1000 (AEST)","from localhost ([::1]:52473 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 1dx69Q-0007rA-BF\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 02:48:56 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:38212)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1dx674-0006jM-Of\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 02:46:32 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1dx673-0003S2-Ms\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 02:46:30 -0400","from mail-ve1eur01on0084.outbound.protection.outlook.com\n\t([104.47.1.84]:49568\n\thelo=EUR01-VE1-obe.outbound.protection.outlook.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <bharat.bhushan@nxp.com>)\n\tid 1dx66x-0003QW-Lk; Wed, 27 Sep 2017 02:46:24 -0400","from AM5PR0401MB2545.eurprd04.prod.outlook.com (10.169.245.8) by\n\tAM5PR0401MB2548.eurprd04.prod.outlook.com (10.169.245.11) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.77.7; Wed, 27 Sep 2017 06:46:19 +0000","from AM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327]) by\n\tAM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327%18]) with mapi id 15.20.0077.016;\n\tWed, 27 Sep 2017 06:46:18 +0000"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=bkjcFu9+cHvjCxwZ8nVMFBZ51GXYG3J1CvVcVGIXIZA=;\n\tb=CxycgCKlDxhK9i1pHmXUW6DtTl4RkgOoqh8Bo0jhyP1NLym5DNW71hyhYa2hNGRiNCqzu5LzNPunO3zW1xF0pszbTHjS+nol4DdCa4K0394qF9AkeLO/1UEbYsqs4JahaxewFqGdU3HqrxzVrKpMWr71ZsVG0LctjGSt7fEZNlI=","From":"Bharat Bhushan <bharat.bhushan@nxp.com>","To":"Bharat Bhushan <bharat.bhushan@nxp.com>, \"eric.auger@redhat.com\"\n\t<eric.auger@redhat.com>, \"eric.auger.pro@gmail.com\"\n\t<eric.auger.pro@gmail.com>, \"peter.maydell@linaro.org\"\n\t<peter.maydell@linaro.org>, \"alex.williamson@redhat.com\"\n\t<alex.williamson@redhat.com>, \"mst@redhat.com\" <mst@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>, \"qemu-devel@nongnu.org\"\n\t<qemu-devel@nongnu.org>, \"peterx@redhat.com\" <peterx@redhat.com>","Thread-Topic":"[PATCH v4 0/5] virtio-iommu: VFIO integration","Thread-Index":"AQHTN1rqdMCSmFjsv0elJFTnh6rDzqLIR3Yg","Date":"Wed, 27 Sep 2017 06:46:18 +0000","Message-ID":"<AM5PR0401MB25458FFED2D7D405A71F954C9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>","In-Reply-To":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"CxycgCKl\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.com; "],"x-originating-ip":"[192.88.169.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; AM5PR0401MB2548;\n\t6:gFys2/lOfDrhWyYCRCg0jE1D5tBbe4M/xpKpUhiV+JY4LlTn0XpFhaGcgZS/kZSYYMIgYMW7oTFndDT5Jmjm+Gvv5mVsIsxA+Ll25PHZTvvUWYP4fYB1exD23uIBZPgUDQrkgabHFy6A6o5wSsjamVfrRVMdTCJixP6f3gZ5R00y62m49G7AF6Us0MT5E1fyQAVxsLCCYanMwaFRDICQ/pcyATE9TBgH9478CM7sKusBoiavpbUpH533WwAgWh06c3J1YPJsQgxbppNNZvVoX9M2E+OF+fPw3AxNLmzJSz6n7ITF7mzZndwc7FQ44VW09UvF9mOZwhLap5dFhSWPPg==;\n\t5:VrVHRR6NS9BQkaHuPgyKshDIQ4kQOoV18N2DgANowBhPQPNSCkLSDOby+WaCBjR0pB6fGyuSNTIzRpFTYR2PHmfavs7CCe1XwRni88YTNLS094wScIFtDB3/uOHIVhGQB5hNqvdZzCdTzxQwIJpJWg==;\n\t24:R03RyknZas6oqGmLCQWcC1n0vwRWZOwLaT9erUS5hCIgDUDQC7thdCB3apD3hwiZHLNgFhZ/vwQ2Az+hlG0uC8i3JMv3ZYXsKs3PLBXEr9o=;\n\t7:ud1EcA8efsSrJ3PS1gJKUkrOm01vrdGOvDaOrwae1DCQyWoHXjWPM6P/0LnGU0Bwj5jqmunuQD2sX12kN1J1EO1Wssuszl3Is59U6bnDM2sV9++vy/t3P5MGf6cRuEyCfC/HLtp0xLvbB+ddte9Zq2sVDSo4Hu+aNYhiqBMDjVvE60SGtNIOm95oN+2p+UnSz75PP9frvjI7T9HROS67LDKK0q7fOG4J3MR/uTmvqn4=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(39860400002)(376002)(346002)(189002)(13464003)(199003)(377454003)(6246003)(305945005)(7416002)(53936002)(5890100001)(53546010)(97736004)(5250100002)(2501003)(39060400002)(2201001)(7736002)(2900100001)(966005)(81156014)(8676002)(8936002)(189998001)(99286003)(6306002)(55016002)(9686003)(81166006)(74316002)(5660300001)(2950100002)(14454004)(4326008)(7696004)(54906003)(106356001)(105586002)(110136005)(101416001)(6436002)(478600001)(86362001)(6506006)(76176999)(25786009)(3660700001)(33656002)(3280700002)(68736007)(316002)(229853002)(102836003)(2906002)(50986999)(54356999)(6116002)(3846002)(66066001);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0401MB2548;\n\tH:AM5PR0401MB2545.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; MX:1; A:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"af013446-6d97-4c08-d311-08d50573751f","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075);\n\tSRVR:AM5PR0401MB2548; ","x-ms-traffictypediagnostic":"AM5PR0401MB2548:","x-exchange-antispam-report-test":"UriScan:(180628864354917)(166708455590820)(185117386973197)(228905959029699);","x-microsoft-antispam-prvs":"<AM5PR0401MB25485E817A24B439934E4E3D9A780@AM5PR0401MB2548.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:AM5PR0401MB2548; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:AM5PR0401MB2548; ","x-forefront-prvs":"04433051BF","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"27 Sep 2017 06:46:18.5941\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"AM5PR0401MB2548","X-detected-operating-system":"by eggs.gnu.org: Windows 7 or 8 [fuzzy]","X-Received-From":"104.47.1.84","Subject":"Re: [Qemu-devel] [PATCH v4 0/5] virtio-iommu: VFIO integration","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\" <wei@redhat.com>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>","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>"}},{"id":1776071,"web_url":"http://patchwork.ozlabs.org/comment/1776071/","msgid":"<20170927070133.GB25011@pxdev.xzpeter.org>","list_archive_url":null,"date":"2017-09-27T07:01:33","subject":"Re: [Qemu-devel] [PATCH v4 0/5] virtio-iommu: VFIO integration","submitter":{"id":67717,"url":"http://patchwork.ozlabs.org/api/people/67717/","name":"Peter Xu","email":"peterx@redhat.com"},"content":"On Wed, Sep 27, 2017 at 06:46:18AM +0000, Bharat Bhushan wrote:\n> Hi Peter,\n\nHi, Bharat!\n\n> \n> While vfio with virtio-iommu I observed one issue,  When virtio-iommu device exists but guest kernel does not have virtio-iommu driver (not enabled in Config) then IOMMU faults are reported on host.\n> \n> This is because no mapping is created in IOMMU, not even default\nguest-physical to real-physical. While looking at vfio_listener_region_add(), it does not create initial mapping in IOMMU and relies on guest to create mapping. Is this something known or I am missing something?\n\nFor VT-d, the trick is played using dynamic IOMMU memory region.\nPlease refer to commit 558e0024a428 (\"intel_iommu: allow dynamic\nswitch of IOMMU region\") for more information.\n\nThe whole idea is that, the IOMMU region will not be enabled only if\nthe guest enables that explicitly for the device.  Otherwise (for your\ncase, when guest driver is not loaded at all), the IOMMU region is by\ndefault off, then the default GPA region will be used to build up the\nmapping (just like when we don't have vIOMMU at all).  Thanks,","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-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=peterx@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 3y280S2BHYz9t4Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 17:02:47 +1000 (AEST)","from localhost ([::1]:52509 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 1dx6Mm-0002hz-B2\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 03:02:44 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:40480)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dx6MB-0002dH-Kb\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 03:02:13 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <peterx@redhat.com>) id 1dx6M7-0000Pg-OZ\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 03:02:07 -0400","from mx1.redhat.com ([209.132.183.28]:33614)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <peterx@redhat.com>)\n\tid 1dx6Lw-0000Jv-1C; Wed, 27 Sep 2017 03:01:52 -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 2707F883CE;\n\tWed, 27 Sep 2017 07:01:50 +0000 (UTC)","from pxdev.xzpeter.org (ovpn-12-134.pek2.redhat.com [10.72.12.134])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id E75617E672;\n\tWed, 27 Sep 2017 07:01:35 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 2707F883CE","Date":"Wed, 27 Sep 2017 15:01:33 +0800","From":"Peter Xu <peterx@redhat.com>","To":"Bharat Bhushan <bharat.bhushan@nxp.com>","Message-ID":"<20170927070133.GB25011@pxdev.xzpeter.org>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<AM5PR0401MB25458FFED2D7D405A71F954C9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<AM5PR0401MB25458FFED2D7D405A71F954C9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","User-Agent":"Mutt/1.5.24 (2015-08-30)","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.26]);\n\tWed, 27 Sep 2017 07:01:50 +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":"Re: [Qemu-devel] [PATCH v4 0/5] virtio-iommu: VFIO integration","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\" <wei@redhat.com>,\n\t\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"eric.auger@redhat.com\" <eric.auger@redhat.com>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1776098,"web_url":"http://patchwork.ozlabs.org/comment/1776098/","msgid":"<20170927074109.GA31587@virtx40>","list_archive_url":null,"date":"2017-09-27T07:41:10","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":72195,"url":"http://patchwork.ozlabs.org/api/people/72195/","name":"Linu Cherian","email":"linuc.decode@gmail.com"},"content":"Hi,\n\nOn Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n> This patch series integrates VFIO/VHOST with virtio-iommu.\n> \n> This version is mainly about rebasing on v4 version on\n> virtio-iommu device framework from Eric Augur and\n> addresing review comments.\n> \n> This patch series allows PCI pass-through using virtio-iommu.\n>   \n> This series is based on:\n>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n>     [1] [RFC] virtio-iommu version 0.4\n>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n> \n>  - virtio-iommu device emulation by Eric Augur.\n>    [RFC v4 00/16] VIRTIO-IOMMU device\n>    https://github.com/eauger/qemu/tree/v2.10.0-virtio-iommu-v4\n> \n> Changes are available at : https://github.com/bharaty/qemu.git virtio-iommu-vfio-integration-v4\n> \n\n# With the above sources, was trying to test the vfio-pci device assigned to \n  guest using Qemu.\n# Both guest and host kernels are configured with 4k as page size.\n# releavant qemu command snippet,\n  -device virtio-iommu-device -device virtio-blk-device,drive=hd0 \\\n  -net none -device vfio-pci,host=xxx\n\n\nOn guest booting, observed mutliple messages as below,\n\nqemu-system-aarch64: iommu has granularity incompatible with target AS\n\n# On adding necessary prints, 0x5000 is len, 0x4fff is address mask\n  and the code expects the address mask to be 0xfff.\n\nif (len & iotlb->addr_mask) {\n        error_report\n\n# vfio_dma_map is failing due to this error.\n\nAny pointers ?\n\n\n> v3->v4:\n>  - Rebase to v4 version from Eric\n>  - Fixes from Eric with DPDK in VM\n>  - Logical division in multiple patches\n> \n> v2->v3:\n>  - This series is based on \"[RFC v3 0/8] VIRTIO-IOMMU device\"\n>    Which is based on top of v2.10-rc0 that\n>  - Fixed issue with two PCI devices\n>  - Addressed review comments\n> \n> v1->v2:\n>   - Added trace events\n>   - removed vSMMU3 link in patch description\n> \n> Bharat Bhushan (5):\n>   target/arm/kvm: Translate the MSI doorbell in kvm_arch_fixup_msi_route\n>   virtio-iommu: Add iommu notifier for map/unmap\n>   virtio-iommu: Call iommu notifier for attach/detach\n>   virtio-iommu: add iommu replay\n>   virtio-iommu: add iommu notifier memory-region\n> \n>  hw/virtio/trace-events           |   5 ++\n>  hw/virtio/virtio-iommu.c         | 181 ++++++++++++++++++++++++++++++++++++++-\n>  include/hw/virtio/virtio-iommu.h |   6 ++\n>  target/arm/kvm.c                 |  27 ++++++\n>  target/arm/trace-events          |   3 +\n>  5 files changed, 219 insertions(+), 3 deletions(-)\n> \n> -- \n> 1.9.3\n> \n>","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"JF5vbp6W\"; dkim-atps=neutral"],"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 3y28tN2SGhz9sRg\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 17:42:36 +1000 (AEST)","from localhost ([::1]:52920 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 1dx6zK-00005e-ET\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 03:42:34 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:55324)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dx6yg-0008UY-JC\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 03:41:55 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dx6yd-0002gf-G4\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 03:41:54 -0400","from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:38487)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <linuc.decode@gmail.com>)\n\tid 1dx6yT-0002SK-TY; Wed, 27 Sep 2017 03:41:42 -0400","by mail-pf0-x241.google.com with SMTP id a7so6091836pfj.5;\n\tWed, 27 Sep 2017 00:41:40 -0700 (PDT)","from virtx40 ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id\n\ta29sm18589033pfj.88.2017.09.27.00.41.34\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 27 Sep 2017 00:41:38 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=5XWg9QzKjncdYCcV4bdklKMCePEET1KO708rxi9aLjA=;\n\tb=JF5vbp6WJwmoSXNNtU1l1Hc7sJo+3tgJrg6MwH8hJvjeN9pWMybIDQ9rADQavFbgzY\n\t8KktjjOM+p2WgqBxB9aGUaCUkThqFfmCZzdIL2s7hQsKqMeARqzhO/CgFkqVAp4XsXD3\n\tixgZ0XIjmABJN+K0g7P20gVvyvcSRD/PJPOcnBaVo2Wf//rWWaX17uPp4OgOyQLEVRU5\n\tuq3SXJ/v75vmcYTfVS6HCbfHmpUTSLs3rMjHE/tikirkwcbcTZZbKRR5xw52wT24jB9Z\n\tc/VoqNMYkpMgYkXaoQX0Yo7vZDoVZZKksVGnZ+YSO3D0F51G5rH9kRn/J6DxN+4Jj47p\n\t/jJA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=5XWg9QzKjncdYCcV4bdklKMCePEET1KO708rxi9aLjA=;\n\tb=HI9mlDSJUTEMEqtdYQezwKVDsIwc4sIAukNxZBpg6M7viTmZ1sooamdJvzXqu+2BLv\n\tFteQxvAVXnKZrMk+Ya1Qts+2Ha/uysmAY3Vg/VixhOsFLJDKeJHCeiiWSGXucXuLbBH2\n\tPhkW3VjMWsmZ9K1ywUNv/qDzCGcKo+yZCXTx9nvX4aaPjW0SCT1Py/aCedgblK4s1axf\n\trKzKqnKvJJ4AZ7+ZSrdNrC6poVaBvfdIi5Ipx3xAdv0/8+r5XoPileVkUkXXY0rPg5XK\n\tBGcski+03xX3bkBIYkBMxXgGkdnukMr/yitRDEf9Vq8v1MIAvFFf3ZqRlm1iemsDZCCW\n\t73Lg==","X-Gm-Message-State":"AHPjjUhzPPKYKCWYdWfsq/2VYVJiG69wLpDS4fSTMAcW5Ias7cNx6S0J\n\tU36rPGCZKfr5kR4BfruiBvc=","X-Google-Smtp-Source":"AOwi7QDFKZi+pGZV1bkiiC1hdxhezWWjDn9SnAcgi2lUOOuH4m0P48sLu/wVodjN6nlIKMwxk9ElxA==","X-Received":"by 10.159.247.131 with SMTP id e3mr504598pls.296.1506498099360; \n\tWed, 27 Sep 2017 00:41:39 -0700 (PDT)","Date":"Wed, 27 Sep 2017 13:11:10 +0530","From":"Linu Cherian <linuc.decode@gmail.com>","To":"Bharat Bhushan <Bharat.Bhushan@nxp.com>","Message-ID":"<20170927074109.GA31587@virtx40>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400e:c00::241","Subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"peter.maydell@linaro.org, kevin.tian@intel.com, drjones@redhat.com,\n\tmst@redhat.com, marc.zyngier@arm.com, tn@semihalf.com,\n\twill.deacon@arm.com, qemu-devel@nongnu.org,\n\teric.auger@redhat.com, alex.williamson@redhat.com,\n\tqemu-arm@nongnu.org, bharatb.yadav@gmail.com,\n\trobin.murphy@arm.com, christoffer.dall@linaro.org,\n\teric.auger.pro@gmail.com","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>"}},{"id":1776121,"web_url":"http://patchwork.ozlabs.org/comment/1776121/","msgid":"<AM5PR0401MB2545CCAEDA61222A171863F49A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-09-27T08:32:00","subject":"Re: [Qemu-devel] [PATCH v4 0/5] virtio-iommu: VFIO integration","submitter":{"id":70741,"url":"http://patchwork.ozlabs.org/api/people/70741/","name":"Bharat Bhushan","email":"bharat.bhushan@nxp.com"},"content":"Hi Peter,\r\n\r\n> -----Original Message-----\r\n> From: Peter Xu [mailto:peterx@redhat.com]\r\n> Sent: Wednesday, September 27, 2017 12:32 PM\r\n> To: Bharat Bhushan <bharat.bhushan@nxp.com>\r\n> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\r\n> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\r\n> qemu-arm@nongnu.org; qemu-devel@nongnu.org; wei@redhat.com;\r\n> kevin.tian@intel.com; marc.zyngier@arm.com; tn@semihalf.com;\r\n> will.deacon@arm.com; drjones@redhat.com; robin.murphy@arm.com;\r\n> christoffer.dall@linaro.org; bharatb.yadav@gmail.com\r\n> Subject: Re: [PATCH v4 0/5] virtio-iommu: VFIO integration\r\n> \r\n> On Wed, Sep 27, 2017 at 06:46:18AM +0000, Bharat Bhushan wrote:\r\n> > Hi Peter,\r\n> \r\n> Hi, Bharat!\r\n> \r\n> >\r\n> > While vfio with virtio-iommu I observed one issue,  When virtio-iommu\r\n> device exists but guest kernel does not have virtio-iommu driver (not\r\n> enabled in Config) then IOMMU faults are reported on host.\r\n> >\r\n> > This is because no mapping is created in IOMMU, not even default\r\n> guest-physical to real-physical. While looking at vfio_listener_region_add(), it\r\n> does not create initial mapping in IOMMU and relies on guest to create\r\n> mapping. Is this something known or I am missing something?\r\n> \r\n> For VT-d, the trick is played using dynamic IOMMU memory region.\r\n> Please refer to commit 558e0024a428 (\"intel_iommu: allow dynamic switch of\r\n> IOMMU region\") for more information.\r\n> \r\n> The whole idea is that, the IOMMU region will not be enabled only if the\r\n> guest enables that explicitly for the device.  Otherwise (for your case, when\r\n> guest driver is not loaded at all), the IOMMU region is by default off, then\r\n> the default GPA region will be used to build up the mapping (just like when\r\n> we don't have vIOMMU at all).  Thanks,\r\n\r\nThanks, I will analyze and see how we can use for virtio-iommu.\r\n\r\nRegards\r\n-Bharat\r\n\r\n> \r\n> --\r\n> Peter Xu","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"uNObebqs\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.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 3y2B0V17lcz9t3x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 18:32:56 +1000 (AEST)","from localhost ([::1]:53401 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 1dx7lz-0003X9-UL\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 04:32:51 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42894)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1dx7lJ-0003UZ-7M\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:32:10 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1dx7lI-0004dP-6h\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:32:09 -0400","from mail-eopbgr30057.outbound.protection.outlook.com\n\t([40.107.3.57]:15232\n\thelo=EUR03-AM5-obe.outbound.protection.outlook.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <bharat.bhushan@nxp.com>)\n\tid 1dx7lC-0004Zb-Ho; Wed, 27 Sep 2017 04:32:02 -0400","from AM5PR0401MB2545.eurprd04.prod.outlook.com (10.169.245.8) by\n\tAM5PR0401MB2548.eurprd04.prod.outlook.com (10.169.245.11) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.77.7; Wed, 27 Sep 2017 08:32:00 +0000","from AM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327]) by\n\tAM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327%18]) with mapi id 15.20.0077.016;\n\tWed, 27 Sep 2017 08:32:00 +0000"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=72BHgMzbdZPJQoj5nJKHq0yzavjxL5vupOF7napKojI=;\n\tb=uNObebqsfsX/DKVOre/Q98bu75eEPiKsVOHRPnIJDqyy7nq8Y8NgohE+wvRdgL7cnqPIxv01/AyOq7/6iti8LtLisLpZehKrQ9eklQFBp3Xx4/DMRvR7sXnaHKXvfPDuBAc42LSGZTqmQrVfHnXIwCm5iNWghht4KshqwT2rObY=","From":"Bharat Bhushan <bharat.bhushan@nxp.com>","To":"Peter Xu <peterx@redhat.com>","Thread-Topic":"[PATCH v4 0/5] virtio-iommu: VFIO integration","Thread-Index":"AQHTN1rqdMCSmFjsv0elJFTnh6rDzqLIR3YggAAGu4CAABj/UA==","Date":"Wed, 27 Sep 2017 08:32:00 +0000","Message-ID":"<AM5PR0401MB2545CCAEDA61222A171863F49A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<AM5PR0401MB25458FFED2D7D405A71F954C9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<20170927070133.GB25011@pxdev.xzpeter.org>","In-Reply-To":"<20170927070133.GB25011@pxdev.xzpeter.org>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"uNObebqs\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.com; "],"x-originating-ip":"[192.88.169.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; AM5PR0401MB2548;\n\t6:7M0J8XQ0S7ix4vJtIjrh9wh3/pw4R6xrEH6QbM/AybvpNmHZCdZUOezvD7cVS6/xuskGNH+KzpR5v6QRefdqgsXQxg7hCpX0jJ+8kbUDdJJj1abu3Cz02xZBoo1lJnodbjDBHORwvbwKOOh2zwa3vL11q++qabn0OEPus7EF0D/RQ9WlvJF2VTnsUoLwk4HO5teHQqe8Mo8elDQ6f659Lfmw3zTv5bJombPoXllobSbzrppUdX5Ezb4zHFmBNMVlc6XaeOv0OgTMX339hqNNmwRt93DhEIt7fnXBdzHYYFQNWzglAokA5Vw/bY3Slyn6fA+g5dMFD8SsPPcHjI20Tw==;\n\t5:L7TqLluqUUp4bNTMnGJIUw9WNZ0R+K/x7ujCu+Vv5qrJzmCP4tAw1yJg/BIetyDcpOZVfgfsq8TSl12tEMg0Z3QcOfia8718QsUxd/W5p8q2xtTYfYiv2eXqYusQ2qmpc3B61SuGXXQ8IYpzdunK7w==;\n\t24:zsg9F89yTBM+dbDx7W8t8QUI6Tga/Jz3rjF5ua9p98S4AXUJb+H24Kf8UKihhykNPNI3tI2goJfGcVAqMEm/aReXeOAOAx0OcJ9EjltSoyE=;\n\t7:ex5h6NhIGn+YRLA5L+41jx/8MUJZpkEREUECM1WhtMQ9OKtE4nwM+2iRjXwZRkaQmERLVs1bZoOoDzMA2IdteI8VuyD2Z998xk5LA6u3RL9a6QVmUpw6k6dHG1wKl+j7g/ANyOpBuZj7rfjU5aahTZnTyrv3stdX9GtMgOm/wkSr52fIw+tdRUwGPM8NWT0zLNnUgE4vchl1KlE4PTEaFm1hA3Tws4TEs+epaGyn1zo=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;","x-ms-office365-filtering-correlation-id":"db8f812b-f7f8-459d-4a6e-08d50582394b","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075);\n\tSRVR:AM5PR0401MB2548; ","x-ms-traffictypediagnostic":"AM5PR0401MB2548:","x-exchange-antispam-report-test":"UriScan:(180628864354917)(185117386973197)(228905959029699); ","x-microsoft-antispam-prvs":"<AM5PR0401MB254889BF92279479F3C168B99A780@AM5PR0401MB2548.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:AM5PR0401MB2548; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:AM5PR0401MB2548; ","x-forefront-prvs":"04433051BF","x-forefront-antispam-report":"SFV:NSPM;\n\tSFS:(10009020)(6009001)(376002)(346002)(39860400002)(199003)(377454003)(189002)(24454002)(13464003)(76176999)(86362001)(478600001)(6506006)(25786009)(105586002)(106356001)(54906003)(6436002)(101416001)(102836003)(229853002)(6116002)(50986999)(54356999)(3846002)(66066001)(68736007)(2906002)(33656002)(3660700001)(316002)(3280700002)(39060400002)(7736002)(53936002)(6246003)(305945005)(7416002)(5250100002)(53546010)(97736004)(14454004)(2950100002)(4326008)(74316002)(6916009)(5660300001)(7696004)(189998001)(2900100001)(8936002)(8676002)(81156014)(9686003)(81166006)(99286003)(55016002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0401MB2548;\n\tH:AM5PR0401MB2545.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; A:1; MX:1; LANG:en; ","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"27 Sep 2017 08:32:00.7291\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"AM5PR0401MB2548","X-detected-operating-system":"by eggs.gnu.org: Windows 7 or 8 [fuzzy]","X-Received-From":"40.107.3.57","Subject":"Re: [Qemu-devel] [PATCH v4 0/5] virtio-iommu: VFIO integration","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\" <wei@redhat.com>,\n\t\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"eric.auger@redhat.com\" <eric.auger@redhat.com>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1776122,"web_url":"http://patchwork.ozlabs.org/comment/1776122/","msgid":"<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-09-27T08:30:51","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":70741,"url":"http://patchwork.ozlabs.org/api/people/70741/","name":"Bharat Bhushan","email":"bharat.bhushan@nxp.com"},"content":"Hi,\n\n> -----Original Message-----\n> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n> Sent: Wednesday, September 27, 2017 1:11 PM\n> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n> bharatb.yadav@gmail.com\n> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n> \n> Hi,\n> \n> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n> > This patch series integrates VFIO/VHOST with virtio-iommu.\n> >\n> > This version is mainly about rebasing on v4 version on virtio-iommu\n> > device framework from Eric Augur and addresing review comments.\n> >\n> > This patch series allows PCI pass-through using virtio-iommu.\n> >\n> > This series is based on:\n> >  - virtio-iommu kernel driver by Jean-Philippe Brucker\n> >     [1] [RFC] virtio-iommu version 0.4\n> >     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n> >\n> >  - virtio-iommu device emulation by Eric Augur.\n> >    [RFC v4 00/16] VIRTIO-IOMMU device\n> >    https://github.com/eauger/qemu/tree/v2.10.0-virtio-iommu-v4\n> >\n> > Changes are available at : https://github.com/bharaty/qemu.git\n> > virtio-iommu-vfio-integration-v4\n> >\n> \n> # With the above sources, was trying to test the vfio-pci device assigned to\n>   guest using Qemu.\n> # Both guest and host kernels are configured with 4k as page size.\n> # releavant qemu command snippet,\n>   -device virtio-iommu-device -device virtio-blk-device,drive=hd0 \\\n>   -net none -device vfio-pci,host=xxx\n> \n> \n> On guest booting, observed mutliple messages as below,\n> \n> qemu-system-aarch64: iommu has granularity incompatible with target AS\n> \n> # On adding necessary prints, 0x5000 is len, 0x4fff is address mask\n>   and the code expects the address mask to be 0xfff.\n\nI have not seen these errors, I am also using 4K page-size on both host and guest. Can you share compete qemu command and log. \n\nThanks\n-Bharat\n\n> \n> if (len & iotlb->addr_mask) {\n>         error_report\n> \n> # vfio_dma_map is failing due to this error.\n> \n> Any pointers ?\n> \n> \n> > v3->v4:\n> >  - Rebase to v4 version from Eric\n> >  - Fixes from Eric with DPDK in VM\n> >  - Logical division in multiple patches\n> >\n> > v2->v3:\n> >  - This series is based on \"[RFC v3 0/8] VIRTIO-IOMMU device\"\n> >    Which is based on top of v2.10-rc0 that\n> >  - Fixed issue with two PCI devices\n> >  - Addressed review comments\n> >\n> > v1->v2:\n> >   - Added trace events\n> >   - removed vSMMU3 link in patch description\n> >\n> > Bharat Bhushan (5):\n> >   target/arm/kvm: Translate the MSI doorbell in\n> kvm_arch_fixup_msi_route\n> >   virtio-iommu: Add iommu notifier for map/unmap\n> >   virtio-iommu: Call iommu notifier for attach/detach\n> >   virtio-iommu: add iommu replay\n> >   virtio-iommu: add iommu notifier memory-region\n> >\n> >  hw/virtio/trace-events           |   5 ++\n> >  hw/virtio/virtio-iommu.c         | 181\n> ++++++++++++++++++++++++++++++++++++++-\n> >  include/hw/virtio/virtio-iommu.h |   6 ++\n> >  target/arm/kvm.c                 |  27 ++++++\n> >  target/arm/trace-events          |   3 +\n> >  5 files changed, 219 insertions(+), 3 deletions(-)\n> >\n> > --\n> > 1.9.3\n> >\n> >\n> \n> --\n> Linu cherian","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"k4jPQtH4\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.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 3y2B1N0HtXz9t3x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 18:33:44 +1000 (AEST)","from localhost ([::1]:53403 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 1dx7mn-0004LJ-U0\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 04:33:41 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42602)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1dx7kE-0002kz-8s\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:31:03 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1dx7kD-00042J-0P\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:31:02 -0400","from mail-db5eur01on0059.outbound.protection.outlook.com\n\t([104.47.2.59]:44672\n\thelo=EUR01-DB5-obe.outbound.protection.outlook.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <bharat.bhushan@nxp.com>)\n\tid 1dx7k6-0003ur-T0; Wed, 27 Sep 2017 04:30:55 -0400","from AM5PR0401MB2545.eurprd04.prod.outlook.com (10.169.245.8) by\n\tAM5PR0401MB2545.eurprd04.prod.outlook.com (10.169.245.8) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.77.7; Wed, 27 Sep 2017 08:30:51 +0000","from AM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327]) by\n\tAM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327%18]) with mapi id 15.20.0077.016;\n\tWed, 27 Sep 2017 08:30:51 +0000"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=KRP+50oJS/8XKyuXrXl0vCiSHaGm/qtxLfz+G1Tf45w=;\n\tb=k4jPQtH4mg/zm2BKesi2SImwf+hDPxmTSOfK7IFwMHuD1rmjDeD6h2MhaLfFfRm3ZpkKWFjWY0830hh7Kb/9IRZ6EDLoHaud+yaA6yl6zy/4CitSp5uSjDBex71viVHIBQL+6hTjn8MY3g1tktWuhQcA14MRusdAnfDhCW2LjpA=","From":"Bharat Bhushan <bharat.bhushan@nxp.com>","To":"Linu Cherian <linuc.decode@gmail.com>","Thread-Topic":"[Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration","Thread-Index":"AQHTN1rqdMCSmFjsv0elJFTnh6rDzqLIWUMAgAANSjA=","Date":"Wed, 27 Sep 2017 08:30:51 +0000","Message-ID":"<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>","In-Reply-To":"<20170927074109.GA31587@virtx40>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"k4jPQtH4\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.com; "],"x-originating-ip":"[192.88.169.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; AM5PR0401MB2545;\n\t6:Z9y531QBLGncwNJttwBKA6nETe1sDmLFdh658fWegiKucxDH78nTJHzHBd3ycPWMlbKwm1JSrBBxCu+/qBXikjKbY0TdsX6JkFdSGQhJ2veyy7vIziVy7w/pXtjmFPHj+jaQkJva+Kpbn932uOcTRUW+QDiPf+V7yC59LBjlTjOF9df1cvNFRyNpkiK4nseyxUvSjtnPG4ug9d0eXNxOVFT+RebYrBPPJ0Ebpfac2CpHozHABlQuE73DELKDgOPvNrIxoAC/SB0b6ESf0TKE4QSu9LjmWzxEgL/AvpprVVDwnqDJ/4NT7ZjvQi1oQhTPykwBItK6CC/TI2JNlCyvIw==;\n\t5:aBVT9Uwl4O2nqRfAMe7OyOvFJY6m4VIEVwaX0oIdHkBAY4Tl8lY//lxOthx3+xjPpmrzAjrVHTNVyLPDkvotPMxmW6TQH9cnrXKmw8W8LgMIPa0152nyePRjfSOa2PQRS7c570wwZQaVJ2q97yHPjg==;\n\t24:DIhp3QvSM/KnNBhE9kItgtqoeoEWHU8P2XTYjGnzK3ooCLAOX3dcmkOeu+MbwtppVA3cqMpkeVm/Fq/tUDKr2S9jh4rrQSOTC4CT6hqOG34=;\n\t7:DrspO077wlYBb8BpxZ2gFSHURciEyHuIi3FBE45X6o13XPiEcGrSHvxrwA8R9jtEDMQj2JRfOahOH6t4lgVEb1WfYwf867W00eEyZ+aGOTKbOOYLBTEz6wbGb6VBrGI1sxMJJDj8YdygWngyisqiy/MYCruyPEncUsUrbKeRJpe3NDU85kdqZ52MD/e0Qyfptl5BnLlRvsjwAV23NjGxYYY7wpspg7fAr9hohTZZNJA=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;","x-ms-office365-filtering-correlation-id":"f73c05ec-9a75-4446-6f01-08d505820ff1","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075);\n\tSRVR:AM5PR0401MB2545; ","x-ms-traffictypediagnostic":"AM5PR0401MB2545:","x-exchange-antispam-report-test":"UriScan:(180628864354917)(166708455590820)(185117386973197)(228905959029699);","x-microsoft-antispam-prvs":"<AM5PR0401MB25459251D45F12BBC66BC73C9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:AM5PR0401MB2545; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:AM5PR0401MB2545; ","x-forefront-prvs":"04433051BF","x-forefront-antispam-report":"SFV:NSPM;\n\tSFS:(10009020)(6009001)(376002)(346002)(39860400002)(199003)(377454003)(13464003)(189002)(24454002)(101416001)(105586002)(5660300001)(3660700001)(54356999)(189998001)(3280700002)(76176999)(50986999)(81156014)(229853002)(25786009)(2950100002)(66066001)(7696004)(99286003)(9686003)(305945005)(55016002)(97736004)(316002)(6506006)(6306002)(53936002)(74316002)(6246003)(4326008)(6916009)(6436002)(39060400002)(7736002)(53546010)(3846002)(6116002)(102836003)(2906002)(54906003)(478600001)(2900100001)(86362001)(68736007)(5250100002)(7416002)(81166006)(14454004)(5890100001)(966005)(8676002)(8936002)(33656002)(106356001)(21314002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0401MB2545;\n\tH:AM5PR0401MB2545.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; A:1; MX:1; LANG:en; ","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"27 Sep 2017 08:30:51.3692\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"AM5PR0401MB2545","X-detected-operating-system":"by eggs.gnu.org: Windows 7 or 8 [fuzzy]","X-Received-From":"104.47.2.59","Subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"eric.auger@redhat.com\" <eric.auger@redhat.com>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1776137,"web_url":"http://patchwork.ozlabs.org/comment/1776137/","msgid":"<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>","list_archive_url":null,"date":"2017-09-27T08:55:07","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":69187,"url":"http://patchwork.ozlabs.org/api/people/69187/","name":"Eric Auger","email":"eric.auger@redhat.com"},"content":"Hi Linu,\n\nOn 27/09/2017 10:30, Bharat Bhushan wrote:\n> Hi,\n> \n>> -----Original Message-----\n>> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n>> Sent: Wednesday, September 27, 2017 1:11 PM\n>> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n>> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n>> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n>> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n>> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n>> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n>> bharatb.yadav@gmail.com\n>> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n>>\n>> Hi,\n>>\n>> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n>>> This patch series integrates VFIO/VHOST with virtio-iommu.\n>>>\n>>> This version is mainly about rebasing on v4 version on virtio-iommu\n>>> device framework from Eric Augur and addresing review comments.\n>>>\n>>> This patch series allows PCI pass-through using virtio-iommu.\n>>>\n>>> This series is based on:\n>>>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n>>>     [1] [RFC] virtio-iommu version 0.4\n>>>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n\nJust to make sure, do you use the v0.4 virtio-iommu driver from above\nbranch?\n\nThanks\n\nEric\n>>>\n>>>  - virtio-iommu device emulation by Eric Augur.\n>>>    [RFC v4 00/16] VIRTIO-IOMMU device\n>>>    https://github.com/eauger/qemu/tree/v2.10.0-virtio-iommu-v4\n>>>\n>>> Changes are available at : https://github.com/bharaty/qemu.git\n>>> virtio-iommu-vfio-integration-v4\n>>>\n>>\n>> # With the above sources, was trying to test the vfio-pci device assigned to\n>>   guest using Qemu.\n>> # Both guest and host kernels are configured with 4k as page size.\n>> # releavant qemu command snippet,\n>>   -device virtio-iommu-device -device virtio-blk-device,drive=hd0 \\\n>>   -net none -device vfio-pci,host=xxx\n>>\n>>\n>> On guest booting, observed mutliple messages as below,\n>>\n>> qemu-system-aarch64: iommu has granularity incompatible with target AS\n>>\n>> # On adding necessary prints, 0x5000 is len, 0x4fff is address mask\n>>   and the code expects the address mask to be 0xfff.\n> \n> I have not seen these errors, I am also using 4K page-size on both host and guest. Can you share compete qemu command and log. \n> \n> Thanks\n> -Bharat\n> \n>>\n>> if (len & iotlb->addr_mask) {\n>>         error_report\n>>\n>> # vfio_dma_map is failing due to this error.\n>>\n>> Any pointers ?\n>>\n>>\n>>> v3->v4:\n>>>  - Rebase to v4 version from Eric\n>>>  - Fixes from Eric with DPDK in VM\n>>>  - Logical division in multiple patches\n>>>\n>>> v2->v3:\n>>>  - This series is based on \"[RFC v3 0/8] VIRTIO-IOMMU device\"\n>>>    Which is based on top of v2.10-rc0 that\n>>>  - Fixed issue with two PCI devices\n>>>  - Addressed review comments\n>>>\n>>> v1->v2:\n>>>   - Added trace events\n>>>   - removed vSMMU3 link in patch description\n>>>\n>>> Bharat Bhushan (5):\n>>>   target/arm/kvm: Translate the MSI doorbell in\n>> kvm_arch_fixup_msi_route\n>>>   virtio-iommu: Add iommu notifier for map/unmap\n>>>   virtio-iommu: Call iommu notifier for attach/detach\n>>>   virtio-iommu: add iommu replay\n>>>   virtio-iommu: add iommu notifier memory-region\n>>>\n>>>  hw/virtio/trace-events           |   5 ++\n>>>  hw/virtio/virtio-iommu.c         | 181\n>> ++++++++++++++++++++++++++++++++++++++-\n>>>  include/hw/virtio/virtio-iommu.h |   6 ++\n>>>  target/arm/kvm.c                 |  27 ++++++\n>>>  target/arm/trace-events          |   3 +\n>>>  5 files changed, 219 insertions(+), 3 deletions(-)\n>>>\n>>> --\n>>> 1.9.3\n>>>\n>>>\n>>\n>> --\n>> Linu cherian","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-mx01.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx01.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 3y2BWC5M7cz9t5x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 18:56:07 +1000 (AEST)","from localhost ([::1]:53464 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 1dx88T-0001Qk-8N\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 04:56:05 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:46782)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1dx883-0001Pw-QY\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:55:46 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1dx87x-0001cZ-Ki\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:55:39 -0400","from mx1.redhat.com ([209.132.183.28]:58580)\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 1dx87l-0001UK-Ek; Wed, 27 Sep 2017 04:55:21 -0400","from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\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 C5E3081E02;\n\tWed, 27 Sep 2017 08:55:18 +0000 (UTC)","from localhost.localdomain (ovpn-116-163.ams2.redhat.com\n\t[10.36.116.163])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 85C9D7EBEF;\n\tWed, 27 Sep 2017 08:55:09 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com C5E3081E02","To":"Bharat Bhushan <bharat.bhushan@nxp.com>,\n\tLinu Cherian <linuc.decode@gmail.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","From":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>","Date":"Wed, 27 Sep 2017 10:55:07 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.4.0","MIME-Version":"1.0","In-Reply-To":"<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.12","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.25]);\n\tWed, 27 Sep 2017 08:55:19 +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":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1776147,"web_url":"http://patchwork.ozlabs.org/comment/1776147/","msgid":"<20170927085838.GA32011@virtx40>","list_archive_url":null,"date":"2017-09-27T08:58:38","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":72195,"url":"http://patchwork.ozlabs.org/api/people/72195/","name":"Linu Cherian","email":"linuc.decode@gmail.com"},"content":"On Wed Sep 27, 2017 at 08:30:51AM +0000, Bharat Bhushan wrote:\n> Hi,\n> \n> > -----Original Message-----\n> > From: Linu Cherian [mailto:linuc.decode@gmail.com]\n> > Sent: Wednesday, September 27, 2017 1:11 PM\n> > To: Bharat Bhushan <bharat.bhushan@nxp.com>\n> > Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n> > peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n> > qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n> > marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n> > drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n> > bharatb.yadav@gmail.com\n> > Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n> > \n> > Hi,\n> > \n> > On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n> > > This patch series integrates VFIO/VHOST with virtio-iommu.\n> > >\n> > > This version is mainly about rebasing on v4 version on virtio-iommu\n> > > device framework from Eric Augur and addresing review comments.\n> > >\n> > > This patch series allows PCI pass-through using virtio-iommu.\n> > >\n> > > This series is based on:\n> > >  - virtio-iommu kernel driver by Jean-Philippe Brucker\n> > >     [1] [RFC] virtio-iommu version 0.4\n> > >     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n> > >\n> > >  - virtio-iommu device emulation by Eric Augur.\n> > >    [RFC v4 00/16] VIRTIO-IOMMU device\n> > >    https://github.com/eauger/qemu/tree/v2.10.0-virtio-iommu-v4\n> > >\n> > > Changes are available at : https://github.com/bharaty/qemu.git\n> > > virtio-iommu-vfio-integration-v4\n> > >\n> > \n> > # With the above sources, was trying to test the vfio-pci device assigned to\n> >   guest using Qemu.\n> > # Both guest and host kernels are configured with 4k as page size.\n> > # releavant qemu command snippet,\n> >   -device virtio-iommu-device -device virtio-blk-device,drive=hd0 \\\n> >   -net none -device vfio-pci,host=xxx\n> > \n> > \n> > On guest booting, observed mutliple messages as below,\n> > \n> > qemu-system-aarch64: iommu has granularity incompatible with target AS\n> > \n> > # On adding necessary prints, 0x5000 is len, 0x4fff is address mask\n> >   and the code expects the address mask to be 0xfff.\n> \n> I have not seen these errors, I am also using 4K page-size on both host and guest. Can you share compete qemu command and log. \n\nQemu cmd:\n\nqemu-system-aarch64 -machine virt,gic_version=3 -cpu host -enable-kvm -nographic\n -smp 8 -m 1024 -kernel /boot/Image --append \"console=ttyAMA0 root=/dev/vda rw\" \n-drive if=none,file=/home/ubuntu/fs_images/ubu1604.img,id=hd0,format=raw \n-device virtio-iommu-device -device virtio-blk-device,drive=hd0 -net none -device vfio-pci,host=0002:01:00.3\n\n\nQemu log:\nqemu-system-aarch64: iommu has granularity incompatible with target AS\nqemu-system-aarch64: iommu has granularity incompatible with target AS\nqemu-system-aarch64: iommu has granularity incompatible with target AS\nqemu-system-aarch64: iommu has granularity incompatible with target AS\nqemu-system-aarch64: iommu has granularity incompatible with target AS\nqemu-system-aarch64: iommu has granularity incompatible with target AS\n...\n\n\n\n\n\n> \n> Thanks\n> -Bharat\n> \n> > \n> > if (len & iotlb->addr_mask) {\n> >         error_report\n> > \n> > # vfio_dma_map is failing due to this error.\n> > \n> > Any pointers ?\n> > \n> > \n> > > v3->v4:\n> > >  - Rebase to v4 version from Eric\n> > >  - Fixes from Eric with DPDK in VM\n> > >  - Logical division in multiple patches\n> > >\n> > > v2->v3:\n> > >  - This series is based on \"[RFC v3 0/8] VIRTIO-IOMMU device\"\n> > >    Which is based on top of v2.10-rc0 that\n> > >  - Fixed issue with two PCI devices\n> > >  - Addressed review comments\n> > >\n> > > v1->v2:\n> > >   - Added trace events\n> > >   - removed vSMMU3 link in patch description\n> > >\n> > > Bharat Bhushan (5):\n> > >   target/arm/kvm: Translate the MSI doorbell in\n> > kvm_arch_fixup_msi_route\n> > >   virtio-iommu: Add iommu notifier for map/unmap\n> > >   virtio-iommu: Call iommu notifier for attach/detach\n> > >   virtio-iommu: add iommu replay\n> > >   virtio-iommu: add iommu notifier memory-region\n> > >\n> > >  hw/virtio/trace-events           |   5 ++\n> > >  hw/virtio/virtio-iommu.c         | 181\n> > ++++++++++++++++++++++++++++++++++++++-\n> > >  include/hw/virtio/virtio-iommu.h |   6 ++\n> > >  target/arm/kvm.c                 |  27 ++++++\n> > >  target/arm/trace-events          |   3 +\n> > >  5 files changed, 219 insertions(+), 3 deletions(-)\n> > >\n> > > --\n> > > 1.9.3\n> > >\n> > >\n> > \n> > --\n> > Linu cherian","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"sxP8TZzl\"; dkim-atps=neutral"],"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 3y2Bbg5MRlz9tXM\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 18:59:59 +1000 (AEST)","from localhost ([::1]:53472 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 1dx8CD-0003PX-SR\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 04:59:57 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47833)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dx8BZ-0003NX-S3\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:59:19 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dx8BW-0003WS-RX\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 04:59:16 -0400","from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:38731)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <linuc.decode@gmail.com>)\n\tid 1dx8BR-0003Tq-C2; Wed, 27 Sep 2017 04:59:09 -0400","by mail-pg0-x242.google.com with SMTP id m30so8546096pgn.5;\n\tWed, 27 Sep 2017 01:59:09 -0700 (PDT)","from virtx40 ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id\n\ta1sm21447492pgu.47.2017.09.27.01.59.02\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 27 Sep 2017 01:59:07 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=udiiD4Q0ABJeAHLEhiCSVzQ/oTc0N2J6LLIgR9VnC2E=;\n\tb=sxP8TZzlr5re48FwIHJRQAcWS/c60on5y9C5y1vMDyDlW6zeRND4kE3fYj6mtn2sJH\n\toEAFAYLxE3WhEFHz05ipnTr9RJQF9YA5raNTG51BZgL5vRTnmjvL41JkSEHhnYopXyY4\n\t0CCNPfiJyOLlBoY/fKi9pdrD/Ne1sWM09aqDXDe59u39Ft1bwxnmbK1DTinkJgp7r5X0\n\tecDQMgoBoY62o+eQIIyztTxbK4ktiZKMhfA25X8xkg1lvq4XtRRZshQZvgXkLX+ldc/a\n\teY8oYd8xzNh2u5eNXtXt5F4wKwu+PbGqCL3EBbGiFrnQgbU7fkOqrbBycBHEP5Dkb4XS\n\tZbyw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=udiiD4Q0ABJeAHLEhiCSVzQ/oTc0N2J6LLIgR9VnC2E=;\n\tb=hrWQpIiqkvUvyNbeCYU6gxjgave9zlBGbtDV+m0TU+dEzH8Xy0WjeL8JhT/6Cn5rTE\n\tVJNkkdX6dp+GpeHLpzUiTZLOEu9Iouoh7b/rKnJyV13pnXYUsVCHrEk2S9u76vadJkTt\n\tM9y5Oz+JliFHrC7ebzouuSSMgl80M0ljNrL3c0E4LjbvWxRv+8dSj8KtCtfWDuyivrrF\n\ta850GTgLkQJSTe3UE0Irm2MzFy/eP8VnDjxVpaFwTkw5jMSx2js1DpPH687/NexgyaQ4\n\tgxrGZetp+lQqNf8EfAxO4wX2OhCYKWAp/YvSWnXhSqe7s9v5m2It6xq6CmjUGILwpa4c\n\tV+tA==","X-Gm-Message-State":"AHPjjUgRaKMzxMYoJ3vDEi2zkypa5eKUK44aMkBADjSdQwaKfQn9bPLY\n\tQKnpA+xl/6pR5At14QqP/Tn7ijWB","X-Google-Smtp-Source":"AOwi7QCiahr2npoNc6/iR5mESfO5jDc0NNdEniVvbe8iCxz6nLQ8yDkPX/nOxKrNf0pkpwvaM0ySQA==","X-Received":"by 10.101.91.66 with SMTP id y2mr709921pgr.235.1506502748118;\n\tWed, 27 Sep 2017 01:59:08 -0700 (PDT)","Date":"Wed, 27 Sep 2017 14:28:38 +0530","From":"Linu Cherian <linuc.decode@gmail.com>","To":"Bharat Bhushan <bharat.bhushan@nxp.com>","Message-ID":"<20170927085838.GA32011@virtx40>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400e:c05::242","Subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"eric.auger@redhat.com\" <eric.auger@redhat.com>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1776158,"web_url":"http://patchwork.ozlabs.org/comment/1776158/","msgid":"<20170927090555.GB32011@virtx40>","list_archive_url":null,"date":"2017-09-27T09:05:55","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":72195,"url":"http://patchwork.ozlabs.org/api/people/72195/","name":"Linu Cherian","email":"linuc.decode@gmail.com"},"content":"On Wed Sep 27, 2017 at 10:55:07AM +0200, Auger Eric wrote:\n> Hi Linu,\n> \n> On 27/09/2017 10:30, Bharat Bhushan wrote:\n> > Hi,\n> > \n> >> -----Original Message-----\n> >> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n> >> Sent: Wednesday, September 27, 2017 1:11 PM\n> >> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n> >> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n> >> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n> >> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n> >> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n> >> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n> >> bharatb.yadav@gmail.com\n> >> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n> >>\n> >> Hi,\n> >>\n> >> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n> >>> This patch series integrates VFIO/VHOST with virtio-iommu.\n> >>>\n> >>> This version is mainly about rebasing on v4 version on virtio-iommu\n> >>> device framework from Eric Augur and addresing review comments.\n> >>>\n> >>> This patch series allows PCI pass-through using virtio-iommu.\n> >>>\n> >>> This series is based on:\n> >>>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n> >>>     [1] [RFC] virtio-iommu version 0.4\n> >>>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n> \n> Just to make sure, do you use the v0.4 virtio-iommu driver from above\n> branch?\n\nYes, Eric i have that.\n\nFrom guest kernel,\n  0.000000] Linux version 4.13.0-rc1-gd1949df\n.\n.\n] virtio_iommu virtio0: aperture: 0x0-0xffffffffffffffff\n[    0.927886] virtio_iommu virtio0: page mask: 0x40201000\n[    0.931682] virtio_iommu virtio0: probe successful\n\n\nGuest kernel source is on this commit,\n\ncommit d1949dfbf5c0d181b290625c28c5359284686e3a\nAuthor: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>\nDate:   Mon Jul 17 19:01:07 2017 +0100\n\n    iommu/virtio-iommu: add MSI window probe\n    \n    Using the probe request, extract RESV_MEM information. When we encounter a\n    MSI doorbell region, set it up as a IOMMU_RESV_MSI region. This will tell\n    other subsystems that there is no need to map the MSI doorbell in the\n    virtio-iommu, because MSIs bypass it.\n    \n    Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>\n\nwith CONFIG_VIRTIO_IOMMU=y in config.\n\n> \n> Thanks\n> \n> Eric\n> >>>\n> >>>  - virtio-iommu device emulation by Eric Augur.\n> >>>    [RFC v4 00/16] VIRTIO-IOMMU device\n> >>>    https://github.com/eauger/qemu/tree/v2.10.0-virtio-iommu-v4\n> >>>\n> >>> Changes are available at : https://github.com/bharaty/qemu.git\n> >>> virtio-iommu-vfio-integration-v4\n> >>>\n> >>\n> >> # With the above sources, was trying to test the vfio-pci device assigned to\n> >>   guest using Qemu.\n> >> # Both guest and host kernels are configured with 4k as page size.\n> >> # releavant qemu command snippet,\n> >>   -device virtio-iommu-device -device virtio-blk-device,drive=hd0 \\\n> >>   -net none -device vfio-pci,host=xxx\n> >>\n> >>\n> >> On guest booting, observed mutliple messages as below,\n> >>\n> >> qemu-system-aarch64: iommu has granularity incompatible with target AS\n> >>\n> >> # On adding necessary prints, 0x5000 is len, 0x4fff is address mask\n> >>   and the code expects the address mask to be 0xfff.\n> > \n> > I have not seen these errors, I am also using 4K page-size on both host and guest. Can you share compete qemu command and log. \n> > \n> > Thanks\n> > -Bharat\n> > \n> >>\n> >> if (len & iotlb->addr_mask) {\n> >>         error_report\n> >>\n> >> # vfio_dma_map is failing due to this error.\n> >>\n> >> Any pointers ?\n> >>\n> >>\n> >>> v3->v4:\n> >>>  - Rebase to v4 version from Eric\n> >>>  - Fixes from Eric with DPDK in VM\n> >>>  - Logical division in multiple patches\n> >>>\n> >>> v2->v3:\n> >>>  - This series is based on \"[RFC v3 0/8] VIRTIO-IOMMU device\"\n> >>>    Which is based on top of v2.10-rc0 that\n> >>>  - Fixed issue with two PCI devices\n> >>>  - Addressed review comments\n> >>>\n> >>> v1->v2:\n> >>>   - Added trace events\n> >>>   - removed vSMMU3 link in patch description\n> >>>\n> >>> Bharat Bhushan (5):\n> >>>   target/arm/kvm: Translate the MSI doorbell in\n> >> kvm_arch_fixup_msi_route\n> >>>   virtio-iommu: Add iommu notifier for map/unmap\n> >>>   virtio-iommu: Call iommu notifier for attach/detach\n> >>>   virtio-iommu: add iommu replay\n> >>>   virtio-iommu: add iommu notifier memory-region\n> >>>\n> >>>  hw/virtio/trace-events           |   5 ++\n> >>>  hw/virtio/virtio-iommu.c         | 181\n> >> ++++++++++++++++++++++++++++++++++++++-\n> >>>  include/hw/virtio/virtio-iommu.h |   6 ++\n> >>>  target/arm/kvm.c                 |  27 ++++++\n> >>>  target/arm/trace-events          |   3 +\n> >>>  5 files changed, 219 insertions(+), 3 deletions(-)\n> >>>\n> >>> --\n> >>> 1.9.3\n> >>>\n> >>>\n> >>\n> >> --\n> >> Linu cherian","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"amk359c5\"; dkim-atps=neutral"],"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 3y2BmC59Xgz9tXG\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 19:07:23 +1000 (AEST)","from localhost ([::1]:53560 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 1dx8JN-0000hg-Pj\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 05:07:21 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:50534)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dx8Ii-0000GY-FT\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 05:06:46 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dx8Ie-0000Rq-OX\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 05:06:40 -0400","from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:36470)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <linuc.decode@gmail.com>)\n\tid 1dx8IT-0000MQ-OF; Wed, 27 Sep 2017 05:06:25 -0400","by mail-pg0-x243.google.com with SMTP id d8so8559216pgt.3;\n\tWed, 27 Sep 2017 02:06:25 -0700 (PDT)","from virtx40 ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id\n\tf3sm20826024pfd.82.2017.09.27.02.06.19\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 27 Sep 2017 02:06:23 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=M1ZALkPYnPvZE+GqJ+hTyC4Xtda4wSk7gzSomF4YNXI=;\n\tb=amk359c5sOW5CRUpaeEy7Nfx+iq3hRRY8jwsrwu4zIDPkDAp3PpDkYY9KdM8X2Wrx6\n\tD4wMEpmuhj1+Woeuw3j8eYZtX+ZkaaXIsqaGTFqlD5YjpJHVsRtCmDhJNaCwS0bvNQzY\n\tLcljlHJP1h83d7M0QW+O0I4wEw38WC4nRkPytmimgyzsevl0ujHyt0WWlHwlfhugtt/e\n\td6Sry5cDOeqsKdfGCEyDAQ0aNFo+D/KhFUaZP8FV9qHXrsRikk2PNONLMBQTp9dFw5iq\n\tq+20WZUl3R9zTWaDtVyxv8SrGF6rtHmx+7bhyN2finiamyjt0Kwc+Jv2M7D1x1ENDVIm\n\tK2pg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=M1ZALkPYnPvZE+GqJ+hTyC4Xtda4wSk7gzSomF4YNXI=;\n\tb=ibTADESmvEhDwP2XF+0dKbPGlchBgzLfbxiweQJE99/he9W/8OpwgtJYlBQKs35wV2\n\tDp+8ebj+EKacXnJoCKYDXAHFGm4h7LK700wlbNqu5epXnZ28IOfQvHh230VB97m55Vqo\n\t0FLqPBWPCGUoSitIc8QYGLqUWU1zqyIG/ZafXyAoVt7ubE6QxcJCW8FfRSzFiGUeTeQ6\n\tBzuQ4ni389Pe3RSI0Bu7j+X4PiLAJ5AalwYgVrbyb3ojfCp2BxvH6bftJy593D/tSD5D\n\t2tTvXcFToU+/FfPIEeiaFn9OCTaaT665chQCGGbkJ8OG4o05cJppbaitYSB+Bi5I/C6u\n\tAPOg==","X-Gm-Message-State":"AHPjjUiNfq270PKYHnpS1jx2Kyw0Knbotu8yDQVsPRjVf9tjBCPH//bd\n\tp5aJ4Huy3/EvF9h9T7ja7so=","X-Google-Smtp-Source":"AOwi7QDoLEOcHQvawIo8ra8LEayJnm+/7CIUzydHqW/BCvmynw2NUe7nK/tJFCi8RN/WX1f+bRs0eA==","X-Received":"by 10.84.133.111 with SMTP id 102mr690287plf.204.1506503184903; \n\tWed, 27 Sep 2017 02:06:24 -0700 (PDT)","Date":"Wed, 27 Sep 2017 14:35:55 +0530","From":"Linu Cherian <linuc.decode@gmail.com>","To":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<20170927090555.GB32011@virtx40>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400e:c05::243","Subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\tBharat Bhushan <bharat.bhushan@nxp.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1776175,"web_url":"http://patchwork.ozlabs.org/comment/1776175/","msgid":"<20170927092147.GA32183@virtx40>","list_archive_url":null,"date":"2017-09-27T09:21:47","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":72195,"url":"http://patchwork.ozlabs.org/api/people/72195/","name":"Linu Cherian","email":"linuc.decode@gmail.com"},"content":"On Wed Sep 27, 2017 at 10:55:07AM +0200, Auger Eric wrote:\n> Hi Linu,\n> \n> On 27/09/2017 10:30, Bharat Bhushan wrote:\n> > Hi,\n> > \n> >> -----Original Message-----\n> >> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n> >> Sent: Wednesday, September 27, 2017 1:11 PM\n> >> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n> >> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n> >> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n> >> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n> >> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n> >> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n> >> bharatb.yadav@gmail.com\n> >> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n> >>\n> >> Hi,\n> >>\n> >> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n> >>> This patch series integrates VFIO/VHOST with virtio-iommu.\n> >>>\n> >>> This version is mainly about rebasing on v4 version on virtio-iommu\n> >>> device framework from Eric Augur and addresing review comments.\n> >>>\n> >>> This patch series allows PCI pass-through using virtio-iommu.\n> >>>\n> >>> This series is based on:\n> >>>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n> >>>     [1] [RFC] virtio-iommu version 0.4\n> >>>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n> \n> Just to make sure, do you use the v0.4 virtio-iommu driver from above\n> branch?\n> \n> Thanks\n\nI am using git://linux-arm.org/linux-jpb.git branch virtio-iommu/v0.4.\nHope you are referring to the same.\n\n\n> \n> Eric\n> >>>\n> >>>  - virtio-iommu device emulation by Eric Augur.\n> >>>    [RFC v4 00/16] VIRTIO-IOMMU device\n> >>>    https://github.com/eauger/qemu/tree/v2.10.0-virtio-iommu-v4\n> >>>\n> >>> Changes are available at : https://github.com/bharaty/qemu.git\n> >>> virtio-iommu-vfio-integration-v4\n> >>>\n> >>\n> >> # With the above sources, was trying to test the vfio-pci device assigned to\n> >>   guest using Qemu.\n> >> # Both guest and host kernels are configured with 4k as page size.\n> >> # releavant qemu command snippet,\n> >>   -device virtio-iommu-device -device virtio-blk-device,drive=hd0 \\\n> >>   -net none -device vfio-pci,host=xxx\n> >>\n> >>\n> >> On guest booting, observed mutliple messages as below,\n> >>\n> >> qemu-system-aarch64: iommu has granularity incompatible with target AS\n> >>\n> >> # On adding necessary prints, 0x5000 is len, 0x4fff is address mask\n> >>   and the code expects the address mask to be 0xfff.\n> > \n> > I have not seen these errors, I am also using 4K page-size on both host and guest. Can you share compete qemu command and log. \n> > \n> > Thanks\n> > -Bharat\n> > \n> >>\n> >> if (len & iotlb->addr_mask) {\n> >>         error_report\n> >>\n> >> # vfio_dma_map is failing due to this error.\n> >>\n> >> Any pointers ?\n> >>\n> >>\n> >>> v3->v4:\n> >>>  - Rebase to v4 version from Eric\n> >>>  - Fixes from Eric with DPDK in VM\n> >>>  - Logical division in multiple patches\n> >>>\n> >>> v2->v3:\n> >>>  - This series is based on \"[RFC v3 0/8] VIRTIO-IOMMU device\"\n> >>>    Which is based on top of v2.10-rc0 that\n> >>>  - Fixed issue with two PCI devices\n> >>>  - Addressed review comments\n> >>>\n> >>> v1->v2:\n> >>>   - Added trace events\n> >>>   - removed vSMMU3 link in patch description\n> >>>\n> >>> Bharat Bhushan (5):\n> >>>   target/arm/kvm: Translate the MSI doorbell in\n> >> kvm_arch_fixup_msi_route\n> >>>   virtio-iommu: Add iommu notifier for map/unmap\n> >>>   virtio-iommu: Call iommu notifier for attach/detach\n> >>>   virtio-iommu: add iommu replay\n> >>>   virtio-iommu: add iommu notifier memory-region\n> >>>\n> >>>  hw/virtio/trace-events           |   5 ++\n> >>>  hw/virtio/virtio-iommu.c         | 181\n> >> ++++++++++++++++++++++++++++++++++++++-\n> >>>  include/hw/virtio/virtio-iommu.h |   6 ++\n> >>>  target/arm/kvm.c                 |  27 ++++++\n> >>>  target/arm/trace-events          |   3 +\n> >>>  5 files changed, 219 insertions(+), 3 deletions(-)\n> >>>\n> >>> --\n> >>> 1.9.3\n> >>>\n> >>>\n> >>\n> >> --\n> >> Linu cherian","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"eTjEgVDp\"; dkim-atps=neutral"],"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 3y2C6J3CgVz9tXn\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 19:23:02 +1000 (AEST)","from localhost ([::1]:53608 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 1dx8YU-000768-T6\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 05:22:58 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:54658)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dx8Y6-00073c-Cq\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 05:22:35 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dx8Y5-0003Gf-2X\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 05:22:34 -0400","from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:35300)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <linuc.decode@gmail.com>)\n\tid 1dx8Xq-00035r-67; Wed, 27 Sep 2017 05:22:18 -0400","by mail-pf0-x244.google.com with SMTP id i23so6365900pfi.2;\n\tWed, 27 Sep 2017 02:22:18 -0700 (PDT)","from virtx40 ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id\n\tk25sm17604249pgf.13.2017.09.27.02.22.11\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 27 Sep 2017 02:22:15 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=6P1Y4XJ1B1zlLKsjo0x+7mjQLADT104eKcPqorYFNL4=;\n\tb=eTjEgVDpI0CHaKTfatgdi+U+kts3mlfz2T64dT4uXjRGF8c7TgdeqkVPdNPYJub5eF\n\tH82cDpVcCvgvv2LYygw3dKWzqVG/5HmbeKtA6TaVsCtmOaZagSmpLOHENQX7pFFRMpdJ\n\tiQjQfEAt0bx5/RdU5cFqekP5pMqF4puOXD32YrWFRDSvECc2IoRWdDCMBwfUCAwgUSyA\n\tGpHyLph9dsi4Y++x3PUBPtHY/91MhkrQViY3Hs/+J1tncDdl0xv+0nx6YUMfggkmisqL\n\tE+jigbbrZw5emwrivsvO8U+EaqqPncZjJobkrWJDNRimjrLRmexpNHzghDI8yI68YJmL\n\thMsQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=6P1Y4XJ1B1zlLKsjo0x+7mjQLADT104eKcPqorYFNL4=;\n\tb=DIujcGdX6xfutw6Oxw7cue11gMRKDRpqGu+yTLa6x7wMUw5gL+1PkJASeba+Vj9ElU\n\tktCN7Isjm1uGqvwm+fri+838HG+GTQmgCxgvpK8JMhiob7JLPVWE8rcpowBpB+SR361h\n\ttWQGc4WTRnJRGsj5pDMZDnjao7LAUgahFoPJTNO2C4TgHwtbFbIdDNJ0v/y0admsEdLZ\n\tRXO7nMQ6ZhQ2Qk5WVTAb5zZ1UhCaSqoPRVbTD9BCLC15WZTupQaoYBpIisHXM0w93cmg\n\thvBdzvPU3qHg5CTFyVK9VCwAVAy0gTddDvmbOzFxM3ziFPqbaBDtyfgusTrsj5KdG2HV\n\t2/5A==","X-Gm-Message-State":"AHPjjUjB40ai5OPzs7/obem71JVUgEfC5LUNdvSwTdxJ6Mzn/k554Amj\n\tBV3z2eMPPeJRLVNK2uj1StI=","X-Google-Smtp-Source":"AOwi7QCQ8e5+XHu0t9W+KWrux944OV77kkhIbGsHx6yPylnvEDsCDgao756TfioFbU5BZn3NbrY1Lw==","X-Received":"by 10.99.119.11 with SMTP id s11mr735842pgc.398.1506504137161;\n\tWed, 27 Sep 2017 02:22:17 -0700 (PDT)","Date":"Wed, 27 Sep 2017 14:51:47 +0530","From":"Linu Cherian <linuc.decode@gmail.com>","To":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<20170927092147.GA32183@virtx40>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400e:c00::244","Subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\tBharat Bhushan <bharat.bhushan@nxp.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1776176,"web_url":"http://patchwork.ozlabs.org/comment/1776176/","msgid":"<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>","list_archive_url":null,"date":"2017-09-27T09:24:01","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":69187,"url":"http://patchwork.ozlabs.org/api/people/69187/","name":"Eric Auger","email":"eric.auger@redhat.com"},"content":"Hi Linu,\n\nOn 27/09/2017 11:21, Linu Cherian wrote:\n> On Wed Sep 27, 2017 at 10:55:07AM +0200, Auger Eric wrote:\n>> Hi Linu,\n>>\n>> On 27/09/2017 10:30, Bharat Bhushan wrote:\n>>> Hi,\n>>>\n>>>> -----Original Message-----\n>>>> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n>>>> Sent: Wednesday, September 27, 2017 1:11 PM\n>>>> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n>>>> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n>>>> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n>>>> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n>>>> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n>>>> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n>>>> bharatb.yadav@gmail.com\n>>>> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n>>>>\n>>>> Hi,\n>>>>\n>>>> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n>>>>> This patch series integrates VFIO/VHOST with virtio-iommu.\n>>>>>\n>>>>> This version is mainly about rebasing on v4 version on virtio-iommu\n>>>>> device framework from Eric Augur and addresing review comments.\n>>>>>\n>>>>> This patch series allows PCI pass-through using virtio-iommu.\n>>>>>\n>>>>> This series is based on:\n>>>>>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n>>>>>     [1] [RFC] virtio-iommu version 0.4\n>>>>>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n>>\n>> Just to make sure, do you use the v0.4 virtio-iommu driver from above\n>> branch?\n>>\n>> Thanks\n> \n> I am using git://linux-arm.org/linux-jpb.git branch virtio-iommu/v0.4.\n> Hope you are referring to the same.\n\nYes that's the right one. I will also investigate on my side this afternoon.\n\nThanks\n\nEric\n> \n> \n>>\n>> Eric\n>>>>>\n>>>>>  - virtio-iommu device emulation by Eric Augur.\n>>>>>    [RFC v4 00/16] VIRTIO-IOMMU device\n>>>>>    https://github.com/eauger/qemu/tree/v2.10.0-virtio-iommu-v4\n>>>>>\n>>>>> Changes are available at : https://github.com/bharaty/qemu.git\n>>>>> virtio-iommu-vfio-integration-v4\n>>>>>\n>>>>\n>>>> # With the above sources, was trying to test the vfio-pci device assigned to\n>>>>   guest using Qemu.\n>>>> # Both guest and host kernels are configured with 4k as page size.\n>>>> # releavant qemu command snippet,\n>>>>   -device virtio-iommu-device -device virtio-blk-device,drive=hd0 \\\n>>>>   -net none -device vfio-pci,host=xxx\n>>>>\n>>>>\n>>>> On guest booting, observed mutliple messages as below,\n>>>>\n>>>> qemu-system-aarch64: iommu has granularity incompatible with target AS\n>>>>\n>>>> # On adding necessary prints, 0x5000 is len, 0x4fff is address mask\n>>>>   and the code expects the address mask to be 0xfff.\n>>>\n>>> I have not seen these errors, I am also using 4K page-size on both host and guest. Can you share compete qemu command and log. \n>>>\n>>> Thanks\n>>> -Bharat\n>>>\n>>>>\n>>>> if (len & iotlb->addr_mask) {\n>>>>         error_report\n>>>>\n>>>> # vfio_dma_map is failing due to this error.\n>>>>\n>>>> Any pointers ?\n>>>>\n>>>>\n>>>>> v3->v4:\n>>>>>  - Rebase to v4 version from Eric\n>>>>>  - Fixes from Eric with DPDK in VM\n>>>>>  - Logical division in multiple patches\n>>>>>\n>>>>> v2->v3:\n>>>>>  - This series is based on \"[RFC v3 0/8] VIRTIO-IOMMU device\"\n>>>>>    Which is based on top of v2.10-rc0 that\n>>>>>  - Fixed issue with two PCI devices\n>>>>>  - Addressed review comments\n>>>>>\n>>>>> v1->v2:\n>>>>>   - Added trace events\n>>>>>   - removed vSMMU3 link in patch description\n>>>>>\n>>>>> Bharat Bhushan (5):\n>>>>>   target/arm/kvm: Translate the MSI doorbell in\n>>>> kvm_arch_fixup_msi_route\n>>>>>   virtio-iommu: Add iommu notifier for map/unmap\n>>>>>   virtio-iommu: Call iommu notifier for attach/detach\n>>>>>   virtio-iommu: add iommu replay\n>>>>>   virtio-iommu: add iommu notifier memory-region\n>>>>>\n>>>>>  hw/virtio/trace-events           |   5 ++\n>>>>>  hw/virtio/virtio-iommu.c         | 181\n>>>> ++++++++++++++++++++++++++++++++++++++-\n>>>>>  include/hw/virtio/virtio-iommu.h |   6 ++\n>>>>>  target/arm/kvm.c                 |  27 ++++++\n>>>>>  target/arm/trace-events          |   3 +\n>>>>>  5 files changed, 219 insertions(+), 3 deletions(-)\n>>>>>\n>>>>> --\n>>>>> 1.9.3\n>>>>>\n>>>>>\n>>>>\n>>>> --\n>>>> Linu cherian\n>","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-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx05.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 3y2C8L3569z9tXT\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 27 Sep 2017 19:24:50 +1000 (AEST)","from localhost ([::1]:53618 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 1dx8aF-0007jV-IN\n\tfor incoming@patchwork.ozlabs.org; Wed, 27 Sep 2017 05:24:47 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:55007)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1dx8Zn-0007f6-1i\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 05:24:25 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1dx8Zl-0004Um-Km\n\tfor qemu-devel@nongnu.org; Wed, 27 Sep 2017 05:24:19 -0400","from mx1.redhat.com ([209.132.183.28]:60590)\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 1dx8Zg-0004Rw-HH; Wed, 27 Sep 2017 05:24:12 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\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 4F86C51D;\n\tWed, 27 Sep 2017 09:24:11 +0000 (UTC)","from localhost.localdomain (ovpn-116-163.ams2.redhat.com\n\t[10.36.116.163])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id A42E05C699;\n\tWed, 27 Sep 2017 09:24:02 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 4F86C51D","To":"Linu Cherian <linuc.decode@gmail.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>","From":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>","Date":"Wed, 27 Sep 2017 11:24:01 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.4.0","MIME-Version":"1.0","In-Reply-To":"<20170927092147.GA32183@virtx40>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.29]);\n\tWed, 27 Sep 2017 09:24:11 +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":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\tBharat Bhushan <bharat.bhushan@nxp.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1779735,"web_url":"http://patchwork.ozlabs.org/comment/1779735/","msgid":"<20171004114910.GA6932@virtx40>","list_archive_url":null,"date":"2017-10-04T11:49:11","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":72195,"url":"http://patchwork.ozlabs.org/api/people/72195/","name":"Linu Cherian","email":"linuc.decode@gmail.com"},"content":"Hi Eric,\n\n\nOn Wed Sep 27, 2017 at 11:24:01AM +0200, Auger Eric wrote:\n> Hi Linu,\n> \n> On 27/09/2017 11:21, Linu Cherian wrote:\n> > On Wed Sep 27, 2017 at 10:55:07AM +0200, Auger Eric wrote:\n> >> Hi Linu,\n> >>\n> >> On 27/09/2017 10:30, Bharat Bhushan wrote:\n> >>> Hi,\n> >>>\n> >>>> -----Original Message-----\n> >>>> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n> >>>> Sent: Wednesday, September 27, 2017 1:11 PM\n> >>>> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n> >>>> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n> >>>> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n> >>>> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n> >>>> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n> >>>> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n> >>>> bharatb.yadav@gmail.com\n> >>>> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n> >>>>\n> >>>> Hi,\n> >>>>\n> >>>> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n> >>>>> This patch series integrates VFIO/VHOST with virtio-iommu.\n> >>>>>\n> >>>>> This version is mainly about rebasing on v4 version on virtio-iommu\n> >>>>> device framework from Eric Augur and addresing review comments.\n> >>>>>\n> >>>>> This patch series allows PCI pass-through using virtio-iommu.\n> >>>>>\n> >>>>> This series is based on:\n> >>>>>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n> >>>>>     [1] [RFC] virtio-iommu version 0.4\n> >>>>>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n> >>\n> >> Just to make sure, do you use the v0.4 virtio-iommu driver from above\n> >> branch?\n> >>\n> >> Thanks\n> > \n> > I am using git://linux-arm.org/linux-jpb.git branch virtio-iommu/v0.4.\n> > Hope you are referring to the same.\n> \n> Yes that's the right one. I will also investigate on my side this afternoon.\n> \n> Thanks\n> \n> Eric\n\nWith the below workaround, atleast ping works for me.\n\ndiff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c\nindex 249964a..2904617 100644\n--- a/drivers/iommu/virtio-iommu.c\n+++ b/drivers/iommu/virtio-iommu.c\n        .attach_dev             = viommu_attach_dev,\n        .map                    = viommu_map,\n        .unmap                  = viommu_unmap,\n-       .map_sg                 = viommu_map_sg,\n+       .map_sg                 = default_iommu_map_sg,\n        .iova_to_phys           = viommu_iova_to_phys,\n        .add_device             = viommu_add_device,\n        .remove_device          = viommu_remove_device,\n\n\nLooks like the qemu backend doesnt have support to handle the map requests from \nvirtio_iommu_map_sg, since it  merges multiple map requests into one with \nmapsize larger than page size(for eg. 0x5000). \n\nAtleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu expects \nthe map size to be a power of 2.\n\n if (len & iotlb->addr_mask) {\n        error_report(\"iommu has granularity incompatible with target AS\");\n        return false;\n    }\n\nJust trying to understand how this is not hitting in your case.","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"Io88f86z\"; dkim-atps=neutral"],"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 3y6Z2r66wkz9s7h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  4 Oct 2017 22:50:12 +1100 (AEDT)","from localhost ([::1]:34564 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 1dziBm-00057z-EM\n\tfor incoming@patchwork.ozlabs.org; Wed, 04 Oct 2017 07:50:10 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:44839)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dziB7-00053n-Fc\n\tfor qemu-devel@nongnu.org; Wed, 04 Oct 2017 07:49:30 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <linuc.decode@gmail.com>) id 1dziB6-00068T-HP\n\tfor qemu-devel@nongnu.org; Wed, 04 Oct 2017 07:49:29 -0400","from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:36295)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <linuc.decode@gmail.com>)\n\tid 1dziB1-00064m-4O; Wed, 04 Oct 2017 07:49:23 -0400","by mail-pf0-x242.google.com with SMTP id f84so12165766pfj.3;\n\tWed, 04 Oct 2017 04:49:22 -0700 (PDT)","from virtx40 ([111.93.218.67]) by smtp.gmail.com with ESMTPSA id\n\tc185sm27376961pfb.57.2017.10.04.04.49.16\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 04 Oct 2017 04:49:20 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=6eMqCb7SOJ1LmDwACqMO7RKL9LMgn+8bobmYRMY8p1w=;\n\tb=Io88f86zJV8yq5SU1mXT0A8ZcE4eYldNsY6BI0YyRzntY6bbFxNsCBlztBIt9v3Kjq\n\tvaj469Tv4bxuY/1la5+3m9Donr5+5YOK+dhzZKT3tdWiroQ+ZF4c6EYA+3UhHc8ye6dR\n\tyReM4vF2rle4aWlH/DiJPUJWx60vKbQkmOqp2P2lRk51+ZH9Z2At8hqSVdfyLl5vyz8W\n\tyidj4Bfn02cgk32sTyfK86O+R22GvowFp93MpPHDwkcWDu5MQdkWhQ1y/w8W5jO3vJIw\n\tKNGF873sYrLRhJi5wrXOChz14waYYl3uWAmi5R7XwmG8/AF8jpnAH2IBgO03h13WEIJU\n\tsIxg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=6eMqCb7SOJ1LmDwACqMO7RKL9LMgn+8bobmYRMY8p1w=;\n\tb=nhbMRmIr8Qlxnn4zJVNtGMr7KqbLjccRSRaTSDqd7+qE9O6OQw4LMSKKZJbvA3/cks\n\tChwQuKGhtQlehSXTwNf1a69/TmOQB58q5Pf+2ieI/+0XLyxKgyL+9dV0HQEqPqMvzhm6\n\trm2XneFegQ8YGct15t2xcavjTLf2Pin5Mwy7/h9uAUQ7GmFyWMkWN6banMLR73+ugNrD\n\tvKEAjYa42TR78qwMsadlKSeYOvKjq+uyitUtb8ivyFQ4UCqNX53TYhulnoKugIc40moV\n\tR1gmlntqIBNUXjA5e6QEJKx3/8X0v0XgC+aouxOOSsv7nVaL5I5XGfaVOLpXpqINLQl1\n\t/QGw==","X-Gm-Message-State":"AHPjjUgKpe4q+bNvs8sBMcMyTPfzGvB862v1N1LTurSsV9K4G6oNiak7\n\tx0gK52vnMYliSINEPjBkDvM=","X-Google-Smtp-Source":"AOwi7QCZB1tyt+at2eG5rNWVl0qQ8Cbr2rfkv6/yOd/nbPF/bTdOK1HBf0laKDkhMcISbJngN0EQ9g==","X-Received":"by 10.84.194.1 with SMTP id g1mr19750532pld.74.1507117761538;\n\tWed, 04 Oct 2017 04:49:21 -0700 (PDT)","Date":"Wed, 4 Oct 2017 17:19:11 +0530","From":"Linu Cherian <linuc.decode@gmail.com>","To":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<20171004114910.GA6932@virtx40>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","X-detected-operating-system":"by eggs.gnu.org: Genre and OS details not\n\trecognized.","X-Received-From":"2607:f8b0:400e:c00::242","Subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>, linu.cherian@cavium.com, \n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\tBharat Bhushan <bharat.bhushan@nxp.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1780453,"web_url":"http://patchwork.ozlabs.org/comment/1780453/","msgid":"<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>","list_archive_url":null,"date":"2017-10-05T10:46:25","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":69187,"url":"http://patchwork.ozlabs.org/api/people/69187/","name":"Eric Auger","email":"eric.auger@redhat.com"},"content":"Hi Linu,\nOn 04/10/2017 13:49, Linu Cherian wrote:\n> Hi Eric,\n> \n> \n> On Wed Sep 27, 2017 at 11:24:01AM +0200, Auger Eric wrote:\n>> Hi Linu,\n>>\n>> On 27/09/2017 11:21, Linu Cherian wrote:\n>>> On Wed Sep 27, 2017 at 10:55:07AM +0200, Auger Eric wrote:\n>>>> Hi Linu,\n>>>>\n>>>> On 27/09/2017 10:30, Bharat Bhushan wrote:\n>>>>> Hi,\n>>>>>\n>>>>>> -----Original Message-----\n>>>>>> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n>>>>>> Sent: Wednesday, September 27, 2017 1:11 PM\n>>>>>> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n>>>>>> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n>>>>>> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n>>>>>> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n>>>>>> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n>>>>>> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n>>>>>> bharatb.yadav@gmail.com\n>>>>>> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n>>>>>>\n>>>>>> Hi,\n>>>>>>\n>>>>>> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n>>>>>>> This patch series integrates VFIO/VHOST with virtio-iommu.\n>>>>>>>\n>>>>>>> This version is mainly about rebasing on v4 version on virtio-iommu\n>>>>>>> device framework from Eric Augur and addresing review comments.\n>>>>>>>\n>>>>>>> This patch series allows PCI pass-through using virtio-iommu.\n>>>>>>>\n>>>>>>> This series is based on:\n>>>>>>>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n>>>>>>>     [1] [RFC] virtio-iommu version 0.4\n>>>>>>>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n>>>>\n>>>> Just to make sure, do you use the v0.4 virtio-iommu driver from above\n>>>> branch?\n>>>>\n>>>> Thanks\n>>>\n>>> I am using git://linux-arm.org/linux-jpb.git branch virtio-iommu/v0.4.\n>>> Hope you are referring to the same.\n>>\n>> Yes that's the right one. I will also investigate on my side this afternoon.\n>>\n>> Thanks\n>>\n>> Eric\n> \n> With the below workaround, atleast ping works for me.\n> \n> diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c\n> index 249964a..2904617 100644\n> --- a/drivers/iommu/virtio-iommu.c\n> +++ b/drivers/iommu/virtio-iommu.c\n>         .attach_dev             = viommu_attach_dev,\n>         .map                    = viommu_map,\n>         .unmap                  = viommu_unmap,\n> -       .map_sg                 = viommu_map_sg,\n> +       .map_sg                 = default_iommu_map_sg,\n>         .iova_to_phys           = viommu_iova_to_phys,\n>         .add_device             = viommu_add_device,\n>         .remove_device          = viommu_remove_device,\n> \n> \n> Looks like the qemu backend doesnt have support to handle the map requests from \n> virtio_iommu_map_sg, since it  merges multiple map requests into one with \n> mapsize larger than page size(for eg. 0x5000). \nOn my side I understand viommu_map_sg builds a VIRTIO_IOMMU_T_MAP\nrequest for each sg element. The map size matches the sg element size.\nThen each request is sent separately in _viommu_send_reqs_sync. I don't\nsee any concatenation. Looks Jean has a plan to check if it can\nconcatenate anything (/* TODO: merge physically-contiguous mappings if\nany */) but this is not implemented yet.\n\nHowever you should be allowed to map 1 sg element of 5 pages and then\nnotify the host about this event I think. Still looking at the code...\n\nI still can't reproduce the issue at the moment. What kind of device are\nyou assigning?\n\nThanks\n\nEric\n> \n> Atleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu expects \n> the map size to be a power of 2.\n> \n>  if (len & iotlb->addr_mask) {\n>         error_report(\"iommu has granularity incompatible with target AS\");\n>         return false;\n>     }\n> \n> Just trying to understand how this is not hitting in your case. \n>  \n>","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-mx06.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx06.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 3y78bm0SZpz9t43\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  5 Oct 2017 21:47:12 +1100 (AEDT)","from localhost ([::1]:39018 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 1e03gK-00020q-UH\n\tfor incoming@patchwork.ozlabs.org; Thu, 05 Oct 2017 06:47:08 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:53169)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e03fw-0001sP-Dy\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 06:46:45 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e03fv-0006Kz-6C\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 06:46:44 -0400","from mx1.redhat.com ([209.132.183.28]:53670)\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 1e03fp-0006Gd-N6; Thu, 05 Oct 2017 06:46:37 -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 D03BA20A88;\n\tThu,  5 Oct 2017 10:46:35 +0000 (UTC)","from localhost.localdomain (ovpn-116-45.ams2.redhat.com\n\t[10.36.116.45])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 1AA25600C4;\n\tThu,  5 Oct 2017 10:46:26 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com D03BA20A88","To":"Linu Cherian <linuc.decode@gmail.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>\n\t<20171004114910.GA6932@virtx40>","From":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>","Date":"Thu, 5 Oct 2017 12:46:25 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.4.0","MIME-Version":"1.0","In-Reply-To":"<20171004114910.GA6932@virtx40>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"7bit","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.30]);\n\tThu, 05 Oct 2017 10:46:36 +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":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>, linu.cherian@cavium.com, \n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\tBharat Bhushan <bharat.bhushan@nxp.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1780532,"web_url":"http://patchwork.ozlabs.org/comment/1780532/","msgid":"<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>","list_archive_url":null,"date":"2017-10-05T11:54:42","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":69187,"url":"http://patchwork.ozlabs.org/api/people/69187/","name":"Eric Auger","email":"eric.auger@redhat.com"},"content":"Hi Linu,\nOn 05/10/2017 12:46, Auger Eric wrote:\n> Hi Linu,\n> On 04/10/2017 13:49, Linu Cherian wrote:\n>> Hi Eric,\n>>\n>>\n>> On Wed Sep 27, 2017 at 11:24:01AM +0200, Auger Eric wrote:\n>>> Hi Linu,\n>>>\n>>> On 27/09/2017 11:21, Linu Cherian wrote:\n>>>> On Wed Sep 27, 2017 at 10:55:07AM +0200, Auger Eric wrote:\n>>>>> Hi Linu,\n>>>>>\n>>>>> On 27/09/2017 10:30, Bharat Bhushan wrote:\n>>>>>> Hi,\n>>>>>>\n>>>>>>> -----Original Message-----\n>>>>>>> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n>>>>>>> Sent: Wednesday, September 27, 2017 1:11 PM\n>>>>>>> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n>>>>>>> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n>>>>>>> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n>>>>>>> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n>>>>>>> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n>>>>>>> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n>>>>>>> bharatb.yadav@gmail.com\n>>>>>>> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n>>>>>>>\n>>>>>>> Hi,\n>>>>>>>\n>>>>>>> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n>>>>>>>> This patch series integrates VFIO/VHOST with virtio-iommu.\n>>>>>>>>\n>>>>>>>> This version is mainly about rebasing on v4 version on virtio-iommu\n>>>>>>>> device framework from Eric Augur and addresing review comments.\n>>>>>>>>\n>>>>>>>> This patch series allows PCI pass-through using virtio-iommu.\n>>>>>>>>\n>>>>>>>> This series is based on:\n>>>>>>>>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n>>>>>>>>     [1] [RFC] virtio-iommu version 0.4\n>>>>>>>>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n>>>>>\n>>>>> Just to make sure, do you use the v0.4 virtio-iommu driver from above\n>>>>> branch?\n>>>>>\n>>>>> Thanks\n>>>>\n>>>> I am using git://linux-arm.org/linux-jpb.git branch virtio-iommu/v0.4.\n>>>> Hope you are referring to the same.\n>>>\n>>> Yes that's the right one. I will also investigate on my side this afternoon.\n>>>\n>>> Thanks\n>>>\n>>> Eric\n>>\n>> With the below workaround, atleast ping works for me.\n>>\n>> diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c\n>> index 249964a..2904617 100644\n>> --- a/drivers/iommu/virtio-iommu.c\n>> +++ b/drivers/iommu/virtio-iommu.c\n>>         .attach_dev             = viommu_attach_dev,\n>>         .map                    = viommu_map,\n>>         .unmap                  = viommu_unmap,\n>> -       .map_sg                 = viommu_map_sg,\n>> +       .map_sg                 = default_iommu_map_sg,\n>>         .iova_to_phys           = viommu_iova_to_phys,\n>>         .add_device             = viommu_add_device,\n>>         .remove_device          = viommu_remove_device,\n>>\n>>\n>> Looks like the qemu backend doesnt have support to handle the map requests from \n>> virtio_iommu_map_sg, since it  merges multiple map requests into one with \n>> mapsize larger than page size(for eg. 0x5000). \n> On my side I understand viommu_map_sg builds a VIRTIO_IOMMU_T_MAP\n> request for each sg element. The map size matches the sg element size.\n> Then each request is sent separately in _viommu_send_reqs_sync. I don't\n> see any concatenation. Looks Jean has a plan to check if it can\n> concatenate anything (/* TODO: merge physically-contiguous mappings if\n> any */) but this is not implemented yet.\n\nHopefully I was just able to reproduce your issue with an igb device. I\nkeep on debugging...\n\nvfio_get_vaddr 1 len=0x3000 iotlb->addr_mask=0x2fff\nqemu-system-aarch64: iommu has granularity incompatible with target AS\n\n\nThanks\n\nEric\n> \n> However you should be allowed to map 1 sg element of 5 pages and then\n> notify the host about this event I think. Still looking at the code...\n> \n> I still can't reproduce the issue at the moment. What kind of device are\n> you assigning?\n> \n> Thanks\n> \n> Eric\n>>\n>> Atleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu expects \n>> the map size to be a power of 2.\n>>\n>>  if (len & iotlb->addr_mask) {\n>>         error_report(\"iommu has granularity incompatible with target AS\");\n>>         return false;\n>>     }\n>>\n>> Just trying to understand how this is not hitting in your case. \n>>  \n>>\n>","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-mx04.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx04.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 3y7B6S3f4Sz9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  5 Oct 2017 22:55:26 +1100 (AEDT)","from localhost ([::1]:39256 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 1e04kM-0007Jm-7z\n\tfor incoming@patchwork.ozlabs.org; Thu, 05 Oct 2017 07:55:22 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:48083)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e04k0-0007Gj-Fb\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 07:55:03 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e04jz-0007aD-FN\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 07:55:00 -0400","from mx1.redhat.com ([209.132.183.28]:58174)\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 1e04ju-0007VX-0F; Thu, 05 Oct 2017 07:54:54 -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 709EB7E381;\n\tThu,  5 Oct 2017 11:54:52 +0000 (UTC)","from localhost.localdomain (ovpn-116-45.ams2.redhat.com\n\t[10.36.116.45])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 1BEB6600C4;\n\tThu,  5 Oct 2017 11:54:43 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 709EB7E381","To":"Linu Cherian <linuc.decode@gmail.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>\n\t<20171004114910.GA6932@virtx40>\n\t<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>","From":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>","Date":"Thu, 5 Oct 2017 13:54:42 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.4.0","MIME-Version":"1.0","In-Reply-To":"<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"7bit","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.28]);\n\tThu, 05 Oct 2017 11:54:52 +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":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\tBharat Bhushan <bharat.bhushan@nxp.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>, \n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>, linu.cherian@cavium.com, \n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>","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>"}},{"id":1780547,"web_url":"http://patchwork.ozlabs.org/comment/1780547/","msgid":"<1017080b-aa5f-4a1f-9905-e65f22717cd1@redhat.com>","list_archive_url":null,"date":"2017-10-05T12:13:26","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":69187,"url":"http://patchwork.ozlabs.org/api/people/69187/","name":"Eric Auger","email":"eric.auger@redhat.com"},"content":"Hi Linu,\n\nOn 05/10/2017 13:54, Auger Eric wrote:\n> Hi Linu,\n> On 05/10/2017 12:46, Auger Eric wrote:\n>> Hi Linu,\n>> On 04/10/2017 13:49, Linu Cherian wrote:\n>>> Hi Eric,\n>>>\n>>>\n>>> On Wed Sep 27, 2017 at 11:24:01AM +0200, Auger Eric wrote:\n>>>> Hi Linu,\n>>>>\n>>>> On 27/09/2017 11:21, Linu Cherian wrote:\n>>>>> On Wed Sep 27, 2017 at 10:55:07AM +0200, Auger Eric wrote:\n>>>>>> Hi Linu,\n>>>>>>\n>>>>>> On 27/09/2017 10:30, Bharat Bhushan wrote:\n>>>>>>> Hi,\n>>>>>>>\n>>>>>>>> -----Original Message-----\n>>>>>>>> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n>>>>>>>> Sent: Wednesday, September 27, 2017 1:11 PM\n>>>>>>>> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n>>>>>>>> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n>>>>>>>> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n>>>>>>>> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n>>>>>>>> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n>>>>>>>> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n>>>>>>>> bharatb.yadav@gmail.com\n>>>>>>>> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n>>>>>>>>\n>>>>>>>> Hi,\n>>>>>>>>\n>>>>>>>> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n>>>>>>>>> This patch series integrates VFIO/VHOST with virtio-iommu.\n>>>>>>>>>\n>>>>>>>>> This version is mainly about rebasing on v4 version on virtio-iommu\n>>>>>>>>> device framework from Eric Augur and addresing review comments.\n>>>>>>>>>\n>>>>>>>>> This patch series allows PCI pass-through using virtio-iommu.\n>>>>>>>>>\n>>>>>>>>> This series is based on:\n>>>>>>>>>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n>>>>>>>>>     [1] [RFC] virtio-iommu version 0.4\n>>>>>>>>>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n>>>>>>\n>>>>>> Just to make sure, do you use the v0.4 virtio-iommu driver from above\n>>>>>> branch?\n>>>>>>\n>>>>>> Thanks\n>>>>>\n>>>>> I am using git://linux-arm.org/linux-jpb.git branch virtio-iommu/v0.4.\n>>>>> Hope you are referring to the same.\n>>>>\n>>>> Yes that's the right one. I will also investigate on my side this afternoon.\n>>>>\n>>>> Thanks\n>>>>\n>>>> Eric\n>>>\n>>> With the below workaround, atleast ping works for me.\n>>>\n>>> diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c\n>>> index 249964a..2904617 100644\n>>> --- a/drivers/iommu/virtio-iommu.c\n>>> +++ b/drivers/iommu/virtio-iommu.c\n>>>         .attach_dev             = viommu_attach_dev,\n>>>         .map                    = viommu_map,\n>>>         .unmap                  = viommu_unmap,\n>>> -       .map_sg                 = viommu_map_sg,\n>>> +       .map_sg                 = default_iommu_map_sg,\n>>>         .iova_to_phys           = viommu_iova_to_phys,\n>>>         .add_device             = viommu_add_device,\n>>>         .remove_device          = viommu_remove_device,\n>>>\n>>>\n>>> Looks like the qemu backend doesnt have support to handle the map requests from \n>>> virtio_iommu_map_sg, since it  merges multiple map requests into one with \n>>> mapsize larger than page size(for eg. 0x5000). \n>> On my side I understand viommu_map_sg builds a VIRTIO_IOMMU_T_MAP\n>> request for each sg element. The map size matches the sg element size.\n>> Then each request is sent separately in _viommu_send_reqs_sync. I don't\n>> see any concatenation. Looks Jean has a plan to check if it can\n>> concatenate anything (/* TODO: merge physically-contiguous mappings if\n>> any */) but this is not implemented yet.\n> \n> Hopefully I was just able to reproduce your issue with an igb device. I\n> keep on debugging...\n> \n> vfio_get_vaddr 1 len=0x3000 iotlb->addr_mask=0x2fff\n> qemu-system-aarch64: iommu has granularity incompatible with target AS\n> \n> \n> Thanks\n> \n> Eric\n>>\n>> However you should be allowed to map 1 sg element of 5 pages and then\n>> notify the host about this event I think. Still looking at the code...\n>>\n>> I still can't reproduce the issue at the moment. What kind of device are\n>> you assigning?\n>>\n>> Thanks\n>>\n>> Eric\n>>>\n>>> Atleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu expects \n>>> the map size to be a power of 2.\n\nActually I missed the most important here ;-)\n>>>\n>>>  if (len & iotlb->addr_mask) {\nThis check looks suspiscious to me. In our case the len is not modified\nby the previous translation and it fails, I don't see why. It should be\nvalid to be able to notify 5 granules.\n\nThanks\n\nEric\n>>>         error_report(\"iommu has granularity incompatible with target AS\");\n>>>         return false;\n>>>     }\n>>>\n>>> Just trying to understand how this is not hitting in your case. \n>>>  \n>>>\n>>\n>","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-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx07.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 3y7BXM4ywfz9t2x\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  5 Oct 2017 23:14:26 +1100 (AEDT)","from localhost ([::1]:39578 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 1e052m-0002f0-32\n\tfor incoming@patchwork.ozlabs.org; Thu, 05 Oct 2017 08:14:24 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:54084)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e052C-0002e6-Lf\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 08:13:52 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e0526-00009d-F2\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 08:13:48 -0400","from mx1.redhat.com ([209.132.183.28]:56838)\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 1e0521-0008Tl-3H; Thu, 05 Oct 2017 08:13:37 -0400","from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\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 269D2C04AC4E;\n\tThu,  5 Oct 2017 12:13:36 +0000 (UTC)","from localhost.localdomain (ovpn-116-45.ams2.redhat.com\n\t[10.36.116.45])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 25E105C3FF;\n\tThu,  5 Oct 2017 12:13:27 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 269D2C04AC4E","To":"Linu Cherian <linuc.decode@gmail.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>\n\t<20171004114910.GA6932@virtx40>\n\t<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>\n\t<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>","From":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<1017080b-aa5f-4a1f-9905-e65f22717cd1@redhat.com>","Date":"Thu, 5 Oct 2017 14:13:26 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.4.0","MIME-Version":"1.0","In-Reply-To":"<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.16","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tThu, 05 Oct 2017 12:13:36 +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":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>, linu.cherian@cavium.com, \n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\tBharat Bhushan <bharat.bhushan@nxp.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1780834,"web_url":"http://patchwork.ozlabs.org/comment/1780834/","msgid":"<b740e8b7-5859-fd6a-1f1e-480aef6ef4f0@redhat.com>","list_archive_url":null,"date":"2017-10-05T17:02:24","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":69187,"url":"http://patchwork.ozlabs.org/api/people/69187/","name":"Eric Auger","email":"eric.auger@redhat.com"},"content":"Hi Linu,\n\nOn 05/10/2017 14:13, Auger Eric wrote:\n> Hi Linu,\n> \n> On 05/10/2017 13:54, Auger Eric wrote:\n>> Hi Linu,\n>> On 05/10/2017 12:46, Auger Eric wrote:\n>>> Hi Linu,\n>>> On 04/10/2017 13:49, Linu Cherian wrote:\n>>>> Hi Eric,\n>>>>\n>>>>\n>>>> On Wed Sep 27, 2017 at 11:24:01AM +0200, Auger Eric wrote:\n>>>>> Hi Linu,\n>>>>>\n>>>>> On 27/09/2017 11:21, Linu Cherian wrote:\n>>>>>> On Wed Sep 27, 2017 at 10:55:07AM +0200, Auger Eric wrote:\n>>>>>>> Hi Linu,\n>>>>>>>\n>>>>>>> On 27/09/2017 10:30, Bharat Bhushan wrote:\n>>>>>>>> Hi,\n>>>>>>>>\n>>>>>>>>> -----Original Message-----\n>>>>>>>>> From: Linu Cherian [mailto:linuc.decode@gmail.com]\n>>>>>>>>> Sent: Wednesday, September 27, 2017 1:11 PM\n>>>>>>>>> To: Bharat Bhushan <bharat.bhushan@nxp.com>\n>>>>>>>>> Cc: eric.auger@redhat.com; eric.auger.pro@gmail.com;\n>>>>>>>>> peter.maydell@linaro.org; alex.williamson@redhat.com; mst@redhat.com;\n>>>>>>>>> qemu-arm@nongnu.org; qemu-devel@nongnu.org; kevin.tian@intel.com;\n>>>>>>>>> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n>>>>>>>>> drjones@redhat.com; robin.murphy@arm.com; christoffer.dall@linaro.org;\n>>>>>>>>> bharatb.yadav@gmail.com\n>>>>>>>>> Subject: Re: [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO integration\n>>>>>>>>>\n>>>>>>>>> Hi,\n>>>>>>>>>\n>>>>>>>>> On Wed Sep 27, 2017 at 12:03:15PM +0530, Bharat Bhushan wrote:\n>>>>>>>>>> This patch series integrates VFIO/VHOST with virtio-iommu.\n>>>>>>>>>>\n>>>>>>>>>> This version is mainly about rebasing on v4 version on virtio-iommu\n>>>>>>>>>> device framework from Eric Augur and addresing review comments.\n>>>>>>>>>>\n>>>>>>>>>> This patch series allows PCI pass-through using virtio-iommu.\n>>>>>>>>>>\n>>>>>>>>>> This series is based on:\n>>>>>>>>>>  - virtio-iommu kernel driver by Jean-Philippe Brucker\n>>>>>>>>>>     [1] [RFC] virtio-iommu version 0.4\n>>>>>>>>>>     git://linux-arm.org/virtio-iommu.git branch viommu/v0.4\n>>>>>>>\n>>>>>>> Just to make sure, do you use the v0.4 virtio-iommu driver from above\n>>>>>>> branch?\n>>>>>>>\n>>>>>>> Thanks\n>>>>>>\n>>>>>> I am using git://linux-arm.org/linux-jpb.git branch virtio-iommu/v0.4.\n>>>>>> Hope you are referring to the same.\n>>>>>\n>>>>> Yes that's the right one. I will also investigate on my side this afternoon.\n>>>>>\n>>>>> Thanks\n>>>>>\n>>>>> Eric\n>>>>\n>>>> With the below workaround, atleast ping works for me.\n>>>>\n>>>> diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c\n>>>> index 249964a..2904617 100644\n>>>> --- a/drivers/iommu/virtio-iommu.c\n>>>> +++ b/drivers/iommu/virtio-iommu.c\n>>>>         .attach_dev             = viommu_attach_dev,\n>>>>         .map                    = viommu_map,\n>>>>         .unmap                  = viommu_unmap,\n>>>> -       .map_sg                 = viommu_map_sg,\n>>>> +       .map_sg                 = default_iommu_map_sg,\n>>>>         .iova_to_phys           = viommu_iova_to_phys,\n>>>>         .add_device             = viommu_add_device,\n>>>>         .remove_device          = viommu_remove_device,\n>>>>\n>>>>\n>>>> Looks like the qemu backend doesnt have support to handle the map requests from \n>>>> virtio_iommu_map_sg, since it  merges multiple map requests into one with \n>>>> mapsize larger than page size(for eg. 0x5000). \n>>> On my side I understand viommu_map_sg builds a VIRTIO_IOMMU_T_MAP\n>>> request for each sg element. The map size matches the sg element size.\n>>> Then each request is sent separately in _viommu_send_reqs_sync. I don't\n>>> see any concatenation. Looks Jean has a plan to check if it can\n>>> concatenate anything (/* TODO: merge physically-contiguous mappings if\n>>> any */) but this is not implemented yet.\n>>\n>> Hopefully I was just able to reproduce your issue with an igb device. I\n>> keep on debugging...\n>>\n>> vfio_get_vaddr 1 len=0x3000 iotlb->addr_mask=0x2fff\n>> qemu-system-aarch64: iommu has granularity incompatible with target AS\n>>\n>>\n>> Thanks\n>>\n>> Eric\n>>>\n>>> However you should be allowed to map 1 sg element of 5 pages and then\n>>> notify the host about this event I think. Still looking at the code...\n>>>\n>>> I still can't reproduce the issue at the moment. What kind of device are\n>>> you assigning?\n>>>\n>>> Thanks\n>>>\n>>> Eric\n>>>>\n>>>> Atleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu expects \n>>>> the map size to be a power of 2.\n> \n> Actually I missed the most important here ;-)\n>>>>\n>>>>  if (len & iotlb->addr_mask) {\n> This check looks suspiscious to me. In our case the len is not modified\n> by the previous translation and it fails, I don't see why. It should be\n> valid to be able to notify 5 granules.\n\nSo after discussion with Alex, looks the way we notify the host\ncurrently is wrong. we set the addr_mask to the mapping/unmapping size\n-1 whereas this should be a page mask instead (granule size or block\nsize?). So if the guest maps 5 x 4kB pages we should send 5\nnotifications for each page and not a single one. It is unclear to me if\nwe can notify with hugepage/block page size mask. Peter may\nconfirm/infirm this. in vsmmuv3 code I notify by granule or block size.\n\nBharat, please can you add this to your TODO list?\n\nLinu, thanks a lot for the time you spent debugging this issue.\nCuriously on my side, it is really seldom hit but it is ...\n\nThanks!\n\nEric\n> \n> Thanks\n> \n> Eric\n>>>>         error_report(\"iommu has granularity incompatible with target AS\");\n>>>>         return false;\n>>>>     }\n>>>>\n>>>> Just trying to understand how this is not hitting in your case. \n>>>>  \n>>>>\n>>>\n>>\n>","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-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx09.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 3y7K485jqTz9t1G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  6 Oct 2017 04:08:54 +1100 (AEDT)","from localhost ([::1]:41029 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 1e09dk-0005VK-6w\n\tfor incoming@patchwork.ozlabs.org; Thu, 05 Oct 2017 13:08:52 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:46954)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e09Xs-0001uK-Nk\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 13:02:52 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e09Xm-00077H-MN\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 13:02:48 -0400","from mx1.redhat.com ([209.132.183.28]:38272)\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 1e09Xg-000704-J3; Thu, 05 Oct 2017 13:02:36 -0400","from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\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 3CA0E4A6E9;\n\tThu,  5 Oct 2017 17:02:35 +0000 (UTC)","from localhost.localdomain (ovpn-116-45.ams2.redhat.com\n\t[10.36.116.45])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 7A3FC5D9CB;\n\tThu,  5 Oct 2017 17:02:26 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 3CA0E4A6E9","To":"Linu Cherian <linuc.decode@gmail.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>\n\t<20171004114910.GA6932@virtx40>\n\t<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>\n\t<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>\n\t<1017080b-aa5f-4a1f-9905-e65f22717cd1@redhat.com>","From":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<b740e8b7-5859-fd6a-1f1e-480aef6ef4f0@redhat.com>","Date":"Thu, 5 Oct 2017 19:02:24 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.4.0","MIME-Version":"1.0","In-Reply-To":"<1017080b-aa5f-4a1f-9905-e65f22717cd1@redhat.com>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.14","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tThu, 05 Oct 2017 17:02:35 +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":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\tBharat Bhushan <bharat.bhushan@nxp.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>, \n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>, linu.cherian@cavium.com, \n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>","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>"}},{"id":1781196,"web_url":"http://patchwork.ozlabs.org/comment/1781196/","msgid":"<AM5PR0401MB254548523AC95D0A2A8A92E69A710@AM5PR0401MB2545.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-10-06T03:46:11","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":70741,"url":"http://patchwork.ozlabs.org/api/people/70741/","name":"Bharat Bhushan","email":"bharat.bhushan@nxp.com"},"content":"> >> Thanks\n> >>\n> >> Eric\n> >>>\n> >>> However you should be allowed to map 1 sg element of 5 pages and\n> >>> then notify the host about this event I think. Still looking at the code...\n> >>>\n> >>> I still can't reproduce the issue at the moment. What kind of device\n> >>> are you assigning?\n> >>>\n> >>> Thanks\n> >>>\n> >>> Eric\n> >>>>\n> >>>> Atleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu\n> >>>> expects the map size to be a power of 2.\n> >\n> > Actually I missed the most important here ;-)\n> >>>>\n> >>>>  if (len & iotlb->addr_mask) {\n> > This check looks suspiscious to me. In our case the len is not\n> > modified by the previous translation and it fails, I don't see why. It\n> > should be valid to be able to notify 5 granules.\n> \n> So after discussion with Alex, looks the way we notify the host currently is\n> wrong. we set the addr_mask to the mapping/unmapping size\n> -1 whereas this should be a page mask instead (granule size or block size?).\n> So if the guest maps 5 x 4kB pages we should send 5 notifications for each\n> page and not a single one. It is unclear to me if we can notify with\n> hugepage/block page size mask. Peter may confirm/infirm this. in vsmmuv3\n> code I notify by granule or block size.\n> \n> Bharat, please can you add this to your TODO list?\n> \n> Linu, thanks a lot for the time you spent debugging this issue.\n> Curiously on my side, it is really seldom hit but it is ...\n\nThanks Linu and Eric, I added this to my todo list.\nWhile I am still not able to reproduce the issue.  I tried with e1000 and now try with ixgbe device. May I know which device can be used to reproduce this issue?\n\nThanks\n-Bharat\n\n> \n> Thanks!\n> \n> Eric\n> >\n> > Thanks\n> >\n> > Eric\n> >>>>         error_report(\"iommu has granularity incompatible with target AS\");\n> >>>>         return false;\n> >>>>     }\n> >>>>\n> >>>> Just trying to understand how this is not hitting in your case.\n> >>>>\n> >>>>\n> >>>\n> >>\n> >","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"iw6CsPM2\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.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 3y7bDK1tnrz9t2h\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  6 Oct 2017 14:46:56 +1100 (AEDT)","from localhost ([::1]:42847 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 1e0JbB-0004Rd-AZ\n\tfor incoming@patchwork.ozlabs.org; Thu, 05 Oct 2017 23:46:53 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:42571)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1e0Jae-0004RV-GF\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 23:46:21 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1e0Jaa-0007Rs-IE\n\tfor qemu-devel@nongnu.org; Thu, 05 Oct 2017 23:46:20 -0400","from mail-ve1eur01on0040.outbound.protection.outlook.com\n\t([104.47.1.40]:8849\n\thelo=EUR01-VE1-obe.outbound.protection.outlook.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <bharat.bhushan@nxp.com>)\n\tid 1e0Jaa-0007Pc-1P; Thu, 05 Oct 2017 23:46:16 -0400","from AM5PR0401MB2545.eurprd04.prod.outlook.com (10.169.245.8) by\n\tAM5PR0401MB2547.eurprd04.prod.outlook.com (10.169.245.10) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.77.7; Fri, 6 Oct 2017 03:46:11 +0000","from AM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327]) by\n\tAM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327%18]) with mapi id 15.20.0077.018;\n\tFri, 6 Oct 2017 03:46:11 +0000"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=EKzf2Eu26KyEWtnG1r6be8HE/pVjFvZaPfeu/CRZo+A=;\n\tb=iw6CsPM2dHO2fNvd4cM65dXe/0UhNB7D1a/PT7uBM6hT+9c4IFvE83iV5XEF4G7yQAyHW1OxmVBMU5lx4yhy2fbmYEsnXvqkwVenX62uj2glYC/BIyBoO+0PyNdoyUdwpJpn0us1t7LALoedKCr+585lmykpFxO6IhRxHAqfOk4=","From":"Bharat Bhushan <bharat.bhushan@nxp.com>","To":"Auger Eric <eric.auger@redhat.com>, Linu Cherian <linuc.decode@gmail.com>","Thread-Topic":"[Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","Thread-Index":"AQHTN1rqdMCSmFjsv0elJFTnh6rDzqLIWUMAgAANSjCAAAdfgIAAB3OAgAAAoICACyjhgIABgMuAgAATFACAAAU8AIAAUL0AgACy/lA=","Date":"Fri, 6 Oct 2017 03:46:11 +0000","Message-ID":"<AM5PR0401MB254548523AC95D0A2A8A92E69A710@AM5PR0401MB2545.eurprd04.prod.outlook.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>\n\t<20171004114910.GA6932@virtx40>\n\t<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>\n\t<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>\n\t<1017080b-aa5f-4a1f-9905-e65f22717cd1@redhat.com>\n\t<b740e8b7-5859-fd6a-1f1e-480aef6ef4f0@redhat.com>","In-Reply-To":"<b740e8b7-5859-fd6a-1f1e-480aef6ef4f0@redhat.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"iw6CsPM2\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.com; "],"x-originating-ip":"[192.88.169.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; AM5PR0401MB2547;\n\t6:6qnvaoXgxMnc8MfHMK7NcdFmCnTL/RqMux/GuCwESsKrYHyqM1Rx96TPiifRVnUsGDutjKbnmNAMeYod1Q4xr6ppIvKR/nZ4F7pI5J3bHm0v38E/JVJlSVzA3SMngeKBU0BBC198w4qcU7fgnxuNsqTJNCFpwVQ0Q9h9M6RSpnkUsd1+tjIrS2iU+/qRnZab21ZBZLkXBVXPoU2sEv+Ewk2+tE57RZFR72IYZ/gqB9t55yyfdExfi+SFStgeYVGBSAcFE4PeAMqm+kq4qQKeQgI+F44wplGaIXLVrjyN3DlyfIMSKR3h/62YQ+L4jfJ/8VVWanJYtjoSBxXe9tezug==;\n\t5:+ipuyEI0jM32/CLq+/rkWHaem9L/7blby9xgNpD6W1IsI7Y3U8oHrXVxNQW8ukUMiuxPqvMby/5e0CDhrLP5nptprdJaYqr4/TnagQLUpR9eudBLBxwiP8j09nx8CsQ42vSfEDmn8SnXw/sESaf1Rw==;\n\t24:qPtUyGovXqpwDWJhtRF3kurriKPgLHr4CRvjmPmDyPItSRu8l44xp/8PYRgdJtiYjrtMScf+4CRSfvJiqt7ArbO4iHarDB55e0rWH2mhSPo=;\n\t7:N+Tz/SUuwaX9YCRzjnshXY7bY2AMcDvSoF90Fw5hR6paMqvymq1twrzA56Ta46IXQtse1MFmU6uyvcnWD5Jb7d6nXXM9amsR2u/SKUyFNonLRgHkJGu7lh/xCwWEEQZf3f5cVxPBw90mo5btnG8Lx8hn6Hxc0OqxaLcYu6MRWeDkGgcbrnUyiizSW87UNulrY1yPLcEitobc1QKBdd4SB6ED8Bsm+Amgcc7C0dH+v+8=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;","x-ms-office365-filtering-correlation-id":"cf12a970-7061-4b20-6f57-08d50c6cc97c","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075);\n\tSRVR:AM5PR0401MB2547; ","x-ms-traffictypediagnostic":"AM5PR0401MB2547:","x-exchange-antispam-report-test":"UriScan:;","x-microsoft-antispam-prvs":"<AM5PR0401MB2547C6BF867F95FB23B58EA09A710@AM5PR0401MB2547.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:AM5PR0401MB2547; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:AM5PR0401MB2547; ","x-forefront-prvs":"0452022BE1","x-forefront-antispam-report":"SFV:NSPM;\n\tSFS:(10009020)(6009001)(376002)(346002)(39860400002)(199003)(189002)(68736007)(9686003)(106356001)(53936002)(55016002)(2900100001)(99286003)(105586002)(97736004)(8936002)(229853002)(86362001)(101416001)(14454004)(5250100002)(25786009)(33656002)(6246003)(6436002)(50986999)(54356999)(102836003)(3846002)(39060400002)(6116002)(316002)(2906002)(74316002)(7416002)(81166006)(81156014)(66066001)(305945005)(76176999)(2950100002)(5660300001)(7696004)(93886005)(7736002)(4326008)(110136005)(189998001)(478600001)(6506006)(3660700001)(54906003)(3280700002)(8676002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0401MB2547;\n\tH:AM5PR0401MB2545.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; A:1; MX:1; LANG:en; ","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"06 Oct 2017 03:46:11.7763\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"AM5PR0401MB2547","X-detected-operating-system":"by eggs.gnu.org: Windows 7 or 8 [fuzzy]","X-Received-From":"104.47.1.40","Subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"linu.cherian@cavium.com\" <linu.cherian@cavium.com>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>","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>"}},{"id":1781266,"web_url":"http://patchwork.ozlabs.org/comment/1781266/","msgid":"<807c8076-af7b-da24-66d5-2c823dc1da34@redhat.com>","list_archive_url":null,"date":"2017-10-06T07:24:20","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":69187,"url":"http://patchwork.ozlabs.org/api/people/69187/","name":"Eric Auger","email":"eric.auger@redhat.com"},"content":"Hi Bharat,\n\nOn 06/10/2017 05:46, Bharat Bhushan wrote:\n> \n> \n>>>> Thanks\n>>>>\n>>>> Eric\n>>>>>\n>>>>> However you should be allowed to map 1 sg element of 5 pages and\n>>>>> then notify the host about this event I think. Still looking at the code...\n>>>>>\n>>>>> I still can't reproduce the issue at the moment. What kind of device\n>>>>> are you assigning?\n>>>>>\n>>>>> Thanks\n>>>>>\n>>>>> Eric\n>>>>>>\n>>>>>> Atleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu\n>>>>>> expects the map size to be a power of 2.\n>>>\n>>> Actually I missed the most important here ;-)\n>>>>>>\n>>>>>>  if (len & iotlb->addr_mask) {\n>>> This check looks suspiscious to me. In our case the len is not\n>>> modified by the previous translation and it fails, I don't see why. It\n>>> should be valid to be able to notify 5 granules.\n>>\n>> So after discussion with Alex, looks the way we notify the host currently is\n>> wrong. we set the addr_mask to the mapping/unmapping size\n>> -1 whereas this should be a page mask instead (granule size or block size?).\n>> So if the guest maps 5 x 4kB pages we should send 5 notifications for each\n>> page and not a single one. It is unclear to me if we can notify with\n>> hugepage/block page size mask. Peter may confirm/infirm this. in vsmmuv3\n>> code I notify by granule or block size.\n>>\n>> Bharat, please can you add this to your TODO list?\n>>\n>> Linu, thanks a lot for the time you spent debugging this issue.\n>> Curiously on my side, it is really seldom hit but it is ...\n> \n> Thanks Linu and Eric, I added this to my todo list.\n> While I am still not able to reproduce the issue.  I tried with e1000 and now try with ixgbe device. May I know which device can be used to reproduce this issue?\n\nOn my side I used an i350T2 device (igb) to reproduce the issue.\n\nThanks\n\nEric\n> \n> Thanks\n> -Bharat\n> \n>>\n>> Thanks!\n>>\n>> Eric\n>>>\n>>> Thanks\n>>>\n>>> Eric\n>>>>>>         error_report(\"iommu has granularity incompatible with target AS\");\n>>>>>>         return false;\n>>>>>>     }\n>>>>>>\n>>>>>> Just trying to understand how this is not hitting in your case.\n>>>>>>\n>>>>>>\n>>>>>\n>>>>\n>>>\n>","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-mx08.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx08.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 3y7h424jx2z9t5C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  6 Oct 2017 18:25:06 +1100 (AEDT)","from localhost ([::1]:43341 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 1e0N0K-0004jD-Nn\n\tfor incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 03:25:04 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:47864)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e0Mzt-0004ha-8H\n\tfor qemu-devel@nongnu.org; Fri, 06 Oct 2017 03:24:38 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e0Mzs-0006rB-DW\n\tfor qemu-devel@nongnu.org; Fri, 06 Oct 2017 03:24:37 -0400","from mx1.redhat.com ([209.132.183.28]:41624)\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 1e0Mzn-0006nL-W6; Fri, 06 Oct 2017 03:24:32 -0400","from smtp.corp.redhat.com\n\t(int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13])\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 CC635C0587D9;\n\tFri,  6 Oct 2017 07:24:30 +0000 (UTC)","from localhost.localdomain (ovpn-116-45.ams2.redhat.com\n\t[10.36.116.45])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 56F7960C18;\n\tFri,  6 Oct 2017 07:24:22 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com CC635C0587D9","To":"Bharat Bhushan <bharat.bhushan@nxp.com>,\n\tLinu Cherian <linuc.decode@gmail.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>\n\t<20171004114910.GA6932@virtx40>\n\t<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>\n\t<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>\n\t<1017080b-aa5f-4a1f-9905-e65f22717cd1@redhat.com>\n\t<b740e8b7-5859-fd6a-1f1e-480aef6ef4f0@redhat.com>\n\t<AM5PR0401MB254548523AC95D0A2A8A92E69A710@AM5PR0401MB2545.eurprd04.prod.outlook.com>","From":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<807c8076-af7b-da24-66d5-2c823dc1da34@redhat.com>","Date":"Fri, 6 Oct 2017 09:24:20 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.4.0","MIME-Version":"1.0","In-Reply-To":"<AM5PR0401MB254548523AC95D0A2A8A92E69A710@AM5PR0401MB2545.eurprd04.prod.outlook.com>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.13","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.32]);\n\tFri, 06 Oct 2017 07:24:31 +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":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"linu.cherian@cavium.com\" <linu.cherian@cavium.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1781333,"web_url":"http://patchwork.ozlabs.org/comment/1781333/","msgid":"<20171006084129.GA9318@virtx40>","list_archive_url":null,"date":"2017-10-06T08:41:29","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":72349,"url":"http://patchwork.ozlabs.org/api/people/72349/","name":"Cherian, Linu","email":"linu.cherian@cavium.com"},"content":"On Fri Oct 06, 2017 at 09:24:20AM +0200, Auger Eric wrote:\n> Hi Bharat,\n> \n> On 06/10/2017 05:46, Bharat Bhushan wrote:\n> > \n> > \n> >>>> Thanks\n> >>>>\n> >>>> Eric\n> >>>>>\n> >>>>> However you should be allowed to map 1 sg element of 5 pages and\n> >>>>> then notify the host about this event I think. Still looking at the code...\n> >>>>>\n> >>>>> I still can't reproduce the issue at the moment. What kind of device\n> >>>>> are you assigning?\n> >>>>>\n> >>>>> Thanks\n> >>>>>\n> >>>>> Eric\n> >>>>>>\n> >>>>>> Atleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu\n> >>>>>> expects the map size to be a power of 2.\n> >>>\n> >>> Actually I missed the most important here ;-)\n> >>>>>>\n> >>>>>>  if (len & iotlb->addr_mask) {\n> >>> This check looks suspiscious to me. In our case the len is not\n> >>> modified by the previous translation and it fails, I don't see why. It\n> >>> should be valid to be able to notify 5 granules.\n> >>\n> >> So after discussion with Alex, looks the way we notify the host currently is\n> >> wrong. we set the addr_mask to the mapping/unmapping size\n> >> -1 whereas this should be a page mask instead (granule size or block size?).\n> >> So if the guest maps 5 x 4kB pages we should send 5 notifications for each\n> >> page and not a single one. It is unclear to me if we can notify with\n> >> hugepage/block page size mask. Peter may confirm/infirm this. in vsmmuv3\n> >> code I notify by granule or block size.\n> >>\n> >> Bharat, please can you add this to your TODO list?\n> >>\n> >> Linu, thanks a lot for the time you spent debugging this issue.\n> >> Curiously on my side, it is really seldom hit but it is ...\n> > \n> > Thanks Linu and Eric, I added this to my todo list.\n> > While I am still not able to reproduce the issue.  I tried with e1000 and now try with ixgbe device. May I know which device can be used to reproduce this issue?\n> \n> On my side I used an i350T2 device (igb) to reproduce the issue.\n\nMyself used a Thunderx NIC which is an on chip PCI device.","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>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=CAVIUMNETWORKS.onmicrosoft.com\n\theader.i=@CAVIUMNETWORKS.onmicrosoft.com header.b=\"Ax+OD+kK\"; \n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=Linu.Cherian@cavium.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 3y7jnd1Dc1z9t4b\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  6 Oct 2017 19:42:45 +1100 (AEDT)","from localhost ([::1]:43574 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 1e0ODS-0002P3-Iy\n\tfor incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 04:42:42 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:37772)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <Linu.Cherian@cavium.com>) id 1e0OCw-0002Hf-Rl\n\tfor qemu-devel@nongnu.org; Fri, 06 Oct 2017 04:42:14 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <Linu.Cherian@cavium.com>) id 1e0OCv-0004VM-QZ\n\tfor qemu-devel@nongnu.org; Fri, 06 Oct 2017 04:42:10 -0400","from mail-sn1nam01on0056.outbound.protection.outlook.com\n\t([104.47.32.56]:47952\n\thelo=NAM01-SN1-obe.outbound.protection.outlook.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <Linu.Cherian@cavium.com>)\n\tid 1e0OCp-0004Pe-S1; Fri, 06 Oct 2017 04:42:04 -0400","from localhost (111.93.218.67) by\n\tDM5PR07MB3611.namprd07.prod.outlook.com (10.164.153.161) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.77.7; Fri, 6 Oct 2017 08:41:53 +0000","by localhost (sSMTP sendmail emulation);\n\tFri, 06 Oct 2017 14:11:29 +0530"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=tStmtM5vtth1yYtfWy/G9ORLsbqafQ7+1Z1NuK/QpsE=;\n\tb=Ax+OD+kKg7vmVEp98z4XpB3qp8oVHrJYTJJl3kX6/pRt/GDNTvroiPyNzNgdiWD37vNoh8fG2CNPLLVUttkbSZRrrXXxdecY8U1cfghHTgcQtCT+8RR9LjR9a0zEWxmekNlWTSXerw9LdlkJnCot4Iy99HQ2rU4icz1FkmDxxWs=","Date":"Fri, 6 Oct 2017 14:11:29 +0530","From":"Linu Cherian <linu.cherian@cavium.com>","To":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<20171006084129.GA9318@virtx40>","References":"<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>\n\t<20171004114910.GA6932@virtx40>\n\t<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>\n\t<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>\n\t<1017080b-aa5f-4a1f-9905-e65f22717cd1@redhat.com>\n\t<b740e8b7-5859-fd6a-1f1e-480aef6ef4f0@redhat.com>\n\t<AM5PR0401MB254548523AC95D0A2A8A92E69A710@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<807c8076-af7b-da24-66d5-2c823dc1da34@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<807c8076-af7b-da24-66d5-2c823dc1da34@redhat.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","X-Originating-IP":"[111.93.218.67]","X-ClientProxiedBy":"BMXPR01CA0046.INDPRD01.PROD.OUTLOOK.COM (10.174.214.32) To\n\tDM5PR07MB3611.namprd07.prod.outlook.com (10.164.153.161)","X-MS-PublicTrafficType":"Email","X-MS-Office365-Filtering-Correlation-Id":"95d39076-0fed-4ed8-12fb-08d50c961b3f","X-Microsoft-Antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);\n\tSRVR:DM5PR07MB3611; ","X-Microsoft-Exchange-Diagnostics":["1; DM5PR07MB3611;\n\t3:4sJeMkr4uVp/rbhrQ5q6XXaeETkFHmZhGQlyOe9P1CT34KyxAzH5mwrI9z9c9LgUygwQlg8ZnjR4BbtHlwP3DyMWsBmQ+JaFCK5JkderABHWSkEdVBubSfZ1hA92B0300ThNHXzEyJoLl8kn9CEq1xg3VvM3z7nk9/8uF/XGG7MSjHD5np50Hvja2aIVzrXTQYGKgXGWcthRy36FlsZQXbb2nyUf1sNgGzEriBH+KOML2xoqX+s/zVpcQuXAJhrC;\n\t25:hkwUGd/qoTml2gm9H/4R9zx19nnZbTKo6UAshnk/snR8FadPWn/Cs4EGMr2lX5pza3F1CFBeKBFRoo9T3pxZcFPPJMK63ZC62KX7a40xr1LePUQmFYMk5EnvUZArOalUn85HQXoWiNXTWdMOq+AfSV1H5HtYOxqZSNSKppks2m81fa1QHsD3SY04IkAIDqB39EBpDG77ZWKiU46wA37WmbhxTIjXCVvqr8mP2qhD+lrv933KapCWydfdQHwmkNEC5/H0gF3UQxyeac+jH6F7gyn8Wz7en83uxLzhgE5ydY6SIYfxF6+hHfJtOTtJ9z/XgyZw2k1N0eF9Lw2OV2488g==;\n\t31:xx5/VjiTIpUwmgwBwHyRz6WjGi23iFwYUbEllrqSeYdclM3jAXS8xKnydE1emB0OnH61TWVZ6bT5z0UVXFacaQLcB7Qoz8Smc4xa5792LilUgSTBuZ7p4+3M29GLbpvU0b9A1zhaX87WyMHGH4xNM9VN1UOnyOpIxDxB1hvVOci4M9pndRAglm8vJ3665jlb/NgmGifU8srePdiXqQqV+aNZ14IRil0/JMNZWh8+KgU=","1; DM5PR07MB3611;\n\t20:ctru0TzMzsT77sqFl6xc34UueMFrdsFjYljHbPCNSarbTniU1TNdYvmS+iwNo9/H8wzAAYLMZn1STkUCSeYvgl6gcHqvIe9Jr9URL536T7WUgTS6WPHZDtOMe/FKOq+8ZU07gmTnt5nqxrPiUNcTEhcojyT/gJG/T10G/OXF9kTQvXRlu1Pgmy2iD8pmzLPTJ2mMuex+SDwQqga4Sw/sHnq6qXLjBGVL6zaf8fvsUqIjmg1SSMOK47O4a4pWzbSUT0x63sGqJP+YOTQENSTf9ach4rrrjBDuZBp+TnkDzSp8HKs4YI0WY5jSqJPaW6pLrOGKDm4ZuExnf3vv7nzIG5z+Aqi5/gVZdmRB0DVKBKDe0992/iVOPbzuKUuP7gbB5Z33ffrYTOv3abKyL/Tt8zJA8nCrRz1UMGRAAx2/T/HBaHTGYvNH9vqIfkF+pCozaoMNb4oNNnY7EG33MQiJQW5JUdQllQDST/1udmDRDvpdrQUPiywkXpM1vEZpBOMe;\n\t4:hmZJZeh5jwvW8P38b+SBaw1t/NVSMX2IE9pRSErLJJTwVXIe4EGKwJob6J0T8XIgwjiyjVEHZn8JcH5TM+njfwEX/Q3xz2BWBrjLWxlrzstUiBSd3fwnMvjwCPbWNVm8m345bWKTyzmv9dStEKsxWhFfdkYL7JJmtop0R+hW/uZzmI4gVmsOj2M5ud14jEsIHXUVfPbmBez8HE03mv+mwQlrUgRr4Y2TeVuwJlDcEAdZpIWBeNnekvtX2+EESw0C","=?us-ascii?Q?1; DM5PR07MB3611;\n\t23:3MyfiQUZqPBqDINZ8wTSQs40Nq1QCFkvi/P6fXMxh?=\n\t6tK+j6wJtshD/EI71XBEbYNzjl++H5G1smVHuGvxGRwTfuo3EYV0t8Ode4FHkwU1VYllgINS/I6/GMeSw3xU/XjD6S0660mmmFBmo/BETQLM8C3rZjfDesDUxg6hissBxfqlhOO4F9rjKmaejZ6iuth8IRG8iieMsznW1FYVxdcPVe/QIC9rT2MTadYIs8a1OniA+mHRVUacSzks3eUHQPiCFAXgxGvJOmv5yvUjneP8v+yK9WguBsgO5rRugWxaM6RaK/WMHlfiNXkf5MVbTjls93wRVOH0x/GN3UHej5J7g1suBuZMdtV59nllHYZh8lqAJEUSa0VG4krze4Tukg+/QybSTDU92YrLGjfi8EehMnQnX2WzhNwZLwfCREaMrL+8Nq/KNkFny1HfCXfvRqGfMd4dNIK2C7+WZPx2+wmoYT6GxHKAa7Z8C0tT6DPt7jzO+qOjOZQcGD4g6OpDxM90a+3WA/+WcoShnWEvPoQkytmzttdnuJrucqxTqqyZk1sUJlkPrj2ULK/N7aR0CzGRz6yl7vx77zVyzf9HCf+koTQ1+j1rrBk/Eh96TOIDMgLjD1JFVxDnKHBjHBpIDwUGLNEYsO2tLH+U6xGSO4iG9xkqz3W8UINjuSbqYbHXSWSZDEgCKT/JEfBzdFPtY1V3X8u8UOw/4rcKy6xP8egLd4mSFXOUPKpm6d5+Qu/2ftBCj0ddYawj81tYgGARTox80/rOFUFKIo4SjCz4vtTUAAOXeRBs6kZ9jzvXz5CU7jprUrVQ4v96IpCRkoJVyCXN+ZerrQTl/p+pRhLJNwE8xKc6/1gnGTXuzcmr4E83VuvFM/skib1fPTgWcPZEdckiyfv7m4lsdnHoD1o06W+DyrPga499690IESZjz2pP/v+t1LyTGKmkmgsQfAmIBdu74eQ0PCZaIgCFFpMJPsCoqHQCeT+C57qDPjJsrKJsmpywVhYkxnJZ8kZuMycnkHQMrau4EH59jNIqUQKBIVGr8lc+tNQAgwrimP0QAOA0VJupFUcgmhZbiNwJamyqIelC6NHBGW2N3v0dUPzUy9j5Qjm7XPoezMTHGvc7PZ3zA6CCKkzD9RZaF5SQgvnasGzR/LbEof2zIFWx44BmPLr2hsFFJ/DCHqA3XRbRkaaRpfGEtLhcamnDU6hoL6acDw1srLzBmqaXa1NgYUh1GSYh6+I+/eqkyTfA1ThwYBp19/NE/sHsMP9L18PaqeO04ZgolLXhBkh+pDjFrCxJuGLJQ==","1; DM5PR07MB3611;\n\t6:ync3iK8m4wqRM6iNTj3+fZwWWuMlp9AzV23U+uRzt1B6I/gh9mRRZxqe/R7gDLtBS3rLrjwFXxHvYbnZul714xw+dUs4WfG5H5xXb6DBo0nXE/wxA5p4I79S6YFKq7Ya26meCWQghVh7hl29Bv0p1W2zArnRi0bGqh6zfS1/qFDfqIyOvfowNhTE4EhoXchBHXag+JBLjEh1/soIoY4UMApPlxxpMIGsAKYSmmYA6kc97nHO3AvgGrzsRy16cANRcth1ex9PDZZsU0Qc0FU7ov3ITJbNg+S8FXHAQz7bpKC1yEAy/fk6ElHguw8ISR/6gXFhIk9Te/3Uog0IC2ya7Q==;\n\t5:rNXYMja6RrwGzQ3kaVUMEMhFx+1zSq1xodoBuvSsK4axTkKbIrxn0iu7bsJ2gPRzSb9nzr5+itUMmCJ6sIdor549VZuPjg100JrXm6zIaNKXc+49tJz/P/GMibFCDZOmybISg87edORSu5o/h0SCNQ==;\n\t24:aeQnrYPr1x89hb81/lb8OKheTg8hd/gXGPZPr9J3TAnEYH375Z4aLSJcBFCNEMMLs4UrU1cHD+htliOJ0Y/MmZ3HXXTgmO5HEnqLOtoRBDI=;\n\t7:9K24c6b60faRXgf3s/+yOB1/1nH+LwzgzHIFe6olmfwRnnAYvgHXU5N7VlawQUhHrq5BbjeXp3Sgx5aaJ/lIVezoEa8Q9EQW3Kt5UZ2VxJ3BW+KNS7ePyMLd28Xx/40ImxQ9OSCS0+5G9BS1nTLnEPjJBFp5XfKFWwJ7XnpcWOidtOQMjwD6FYwUiuObGskOmxMqp9EHRf0N4GKNkOA5v6XliYn+jepMtQlZ488HVLM="],"X-MS-TrafficTypeDiagnostic":"DM5PR07MB3611:","X-Exchange-Antispam-Report-Test":"UriScan:;","X-Microsoft-Antispam-PRVS":"<DM5PR07MB361169FAFC58928B2605B922FA710@DM5PR07MB3611.namprd07.prod.outlook.com>","X-Exchange-Antispam-Report-CFA-Test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(6041248)(20161123555025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:DM5PR07MB3611; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:DM5PR07MB3611; ","X-Forefront-PRVS":"0452022BE1","X-Forefront-Antispam-Report":"SFV:NSPM;\n\tSFS:(10009020)(6009001)(6069001)(376002)(346002)(189002)(199003)(24454002)(105586002)(54356999)(83506001)(106356001)(54906003)(76176999)(6116002)(305945005)(97736004)(68736007)(23726003)(7736002)(3846002)(7416002)(2906002)(53546010)(122856001)(478600001)(86362001)(33656002)(316002)(16586007)(4326008)(9686003)(8676002)(72206003)(33716001)(81166006)(5660300001)(8656003)(53936002)(2950100002)(229853002)(81156014)(6246003)(93886005)(42186006)(50986999)(58126008)(101416001)(50466002)(8936002)(39060400002)(6916009)(189998001)(47776003)(66066001)(1076002)(18370500001);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3611; H:localhost; FPR:;\n\tSPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; ","Received-SPF":"None (protection.outlook.com: cavium.com does not designate\n\tpermitted sender hosts)","SpamDiagnosticOutput":"1:99","SpamDiagnosticMetadata":"NSPM","X-OriginatorOrg":"cavium.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"06 Oct 2017 08:41:53.4603\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"711e4ccf-2e9b-4bcf-a551-4094005b6194","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"DM5PR07MB3611","X-detected-operating-system":"by eggs.gnu.org: Windows 7 or 8 [fuzzy]","X-Received-From":"104.47.32.56","Subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\tLinu Cherian <linuc.decode@gmail.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\tBharat Bhushan <bharat.bhushan@nxp.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1783444,"web_url":"http://patchwork.ozlabs.org/comment/1783444/","msgid":"<AM5PR0401MB254512CE483DD6E684037A629A750@AM5PR0401MB2545.eurprd04.prod.outlook.com>","list_archive_url":null,"date":"2017-10-10T06:42:04","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":70741,"url":"http://patchwork.ozlabs.org/api/people/70741/","name":"Bharat Bhushan","email":"bharat.bhushan@nxp.com"},"content":"Hi Alex, Eric,\n\n> -----Original Message-----\n> From: Qemu-devel [mailto:qemu-devel-\n> bounces+bharat.bhushan=nxp.com@nongnu.org] On Behalf Of Bharat\n> Bhushan\n> Sent: Friday, October 06, 2017 9:16 AM\n> To: Auger Eric <eric.auger@redhat.com>; Linu Cherian\n> <linuc.decode@gmail.com>\n> Cc: peter.maydell@linaro.org; kevin.tian@intel.com; mst@redhat.com;\n> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n> drjones@redhat.com; qemu-devel@nongnu.org;\n> alex.williamson@redhat.com; qemu-arm@nongnu.org;\n> linu.cherian@cavium.com; eric.auger.pro@gmail.com;\n> robin.murphy@arm.com; christoffer.dall@linaro.org;\n> bharatb.yadav@gmail.com\n> Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n> integration\n> \n> \n> \n> > >> Thanks\n> > >>\n> > >> Eric\n> > >>>\n> > >>> However you should be allowed to map 1 sg element of 5 pages and\n> > >>> then notify the host about this event I think. Still looking at the code...\n> > >>>\n> > >>> I still can't reproduce the issue at the moment. What kind of\n> > >>> device are you assigning?\n> > >>>\n> > >>> Thanks\n> > >>>\n> > >>> Eric\n> > >>>>\n> > >>>> Atleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu\n> > >>>> expects the map size to be a power of 2.\n> > >\n> > > Actually I missed the most important here ;-)\n> > >>>>\n> > >>>>  if (len & iotlb->addr_mask) {\n> > > This check looks suspiscious to me. In our case the len is not\n> > > modified by the previous translation and it fails, I don't see why.\n> > > It should be valid to be able to notify 5 granules.\n> >\n> > So after discussion with Alex, looks the way we notify the host\n> > currently is wrong. we set the addr_mask to the mapping/unmapping size\n> > -1 whereas this should be a page mask instead (granule size or block size?).\n> > So if the guest maps 5 x 4kB pages we should send 5 notifications for\n> > each page and not a single one. It is unclear to me if we can notify\n> > with hugepage/block page size mask. Peter may confirm/infirm this. in\n> > vsmmuv3 code I notify by granule or block size.\n\nMy understanding is that host provides supported page sizes (page_size_mask), and Size of each notification to host should be exactly best fit of supported page-size and/or multiples of supported page-sizes.\nSo if guest maps 20K size (single request), and supported page size is 4K, so we can still send one 20K size request.\nNot sure I get it, why multiples of supported page-size cannot be provided in one notification to host.\n\nThanks\n-Bharat\n\n> >\n> > Bharat, please can you add this to your TODO list?\n> >\n> > Linu, thanks a lot for the time you spent debugging this issue.\n> > Curiously on my side, it is really seldom hit but it is ...\n> \n> Thanks Linu and Eric, I added this to my todo list.\n> While I am still not able to reproduce the issue.  I tried with e1000 and now\n> try with ixgbe device. May I know which device can be used to reproduce this\n> issue?\n> \n> Thanks\n> -Bharat\n> \n> >\n> > Thanks!\n> >\n> > Eric\n> > >\n> > > Thanks\n> > >\n> > > Eric\n> > >>>>         error_report(\"iommu has granularity incompatible with target\n> AS\");\n> > >>>>         return false;\n> > >>>>     }\n> > >>>>\n> > >>>> Just trying to understand how this is not hitting in your case.\n> > >>>>\n> > >>>>\n> > >>>\n> > >>\n> > >","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"aE/g2iqv\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.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 3yB6xM0ZCWz9sP1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 10 Oct 2017 17:42:46 +1100 (AEDT)","from localhost ([::1]:33106 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 1e1oFX-0000AS-LE\n\tfor incoming@patchwork.ozlabs.org; Tue, 10 Oct 2017 02:42:43 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:59028)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1e1oF3-0000AL-IE\n\tfor qemu-devel@nongnu.org; Tue, 10 Oct 2017 02:42:18 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <bharat.bhushan@nxp.com>) id 1e1oEz-00031q-BQ\n\tfor qemu-devel@nongnu.org; Tue, 10 Oct 2017 02:42:13 -0400","from mail-db5eur01on0047.outbound.protection.outlook.com\n\t([104.47.2.47]:64512\n\thelo=EUR01-DB5-obe.outbound.protection.outlook.com)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <bharat.bhushan@nxp.com>)\n\tid 1e1oEy-0002y7-Mr; Tue, 10 Oct 2017 02:42:09 -0400","from AM5PR0401MB2545.eurprd04.prod.outlook.com (10.169.245.8) by\n\tAM5PR0401MB2545.eurprd04.prod.outlook.com (10.169.245.8) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id\n\t15.20.77.7; Tue, 10 Oct 2017 06:42:05 +0000","from AM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327]) by\n\tAM5PR0401MB2545.eurprd04.prod.outlook.com\n\t([fe80::a470:3643:ce8f:6327%18]) with mapi id 15.20.0077.020;\n\tTue, 10 Oct 2017 06:42:04 +0000"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version;\n\tbh=iTKfUOd8gnGIk7DWyNiBOfs1m1SaxqOoPwDQO2YvDuA=;\n\tb=aE/g2iqvS1MFLfN65odXKTlxpFY19IguB9BnAQQgYjcdmRy676pe+lIrmsRkMyHXUbixYOdx62WhR/IhOJADgXB8WWhM48Cw4QwvGDF8Ol4wiAKUod/cNljfgnVkAueQMkapLHGasOjdFNX3IOjkQCDQYGDpBhPASKJUll9Do9o=","From":"Bharat Bhushan <bharat.bhushan@nxp.com>","To":"Bharat Bhushan <bharat.bhushan@nxp.com>, Auger Eric\n\t<eric.auger@redhat.com>, Linu Cherian <linuc.decode@gmail.com>","Thread-Topic":"[Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","Thread-Index":"AQHTN1rqdMCSmFjsv0elJFTnh6rDzqLIWUMAgAANSjCAAAdfgIAAB3OAgAAAoICACyjhgIABgMuAgAATFACAAAU8AIAAUL0AgACy/lCABnHvAA==","Date":"Tue, 10 Oct 2017 06:42:04 +0000","Message-ID":"<AM5PR0401MB254512CE483DD6E684037A629A750@AM5PR0401MB2545.eurprd04.prod.outlook.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>\n\t<20171004114910.GA6932@virtx40>\n\t<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>\n\t<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>\n\t<1017080b-aa5f-4a1f-9905-e65f22717cd1@redhat.com>\n\t<b740e8b7-5859-fd6a-1f1e-480aef6ef4f0@redhat.com>\n\t<AM5PR0401MB254548523AC95D0A2A8A92E69A710@AM5PR0401MB2545.eurprd04.prod.outlook.com>","In-Reply-To":"<AM5PR0401MB254548523AC95D0A2A8A92E69A710@AM5PR0401MB2545.eurprd04.prod.outlook.com>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","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>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=nxp.com header.i=@nxp.com header.b=\"aE/g2iqv\";\n\tdkim-atps=neutral","spf=none (sender IP is )\n\tsmtp.mailfrom=bharat.bhushan@nxp.com; "],"x-originating-ip":"[192.88.169.1]","x-ms-publictraffictype":"Email","x-microsoft-exchange-diagnostics":"1; AM5PR0401MB2545;\n\t6:j1oigZArhSFmFbQL02mVPt6q1DHLKeT3Por+hUkQC8Q0soVH2lFHB/x0WHinOMgEHsHnqZ/caFYb6r4Bs9TRCAgxP7A7RDRBrNl0XCTnCv40vkyKNM4TydhiSoQd/ejq2cMRzsrhy3O/pRk1IMxki9ZcEG+K+HXox/qBcLhtrZdiiV8w2c5jHLUwqsHXF05ZI0pfbat3Mzzlvx7ba/m3cd6m97/G4b0+mO3hb7D+MYJsm25cy+esW7qyIFNLXQud+ADA1cDFA31uN3PHVUnfJ8Bb70etK/gCXONPF9tGPEEuDQDC3grhIHCNTh+MJU68I7JJ2JFBarTxC/tJ5lM91w==;\n\t5:R6tSSFDAMRgpHqS4KwT++aOYCtyShSUqOKRJCIVVlkEsSZiBvvYmQGsOYNQ2o05aRDzCz0RDTGQiuaZpWss4TJvSUgUjfOGGHu8dRe7qmlvnQwjqwFR7ditwBcN3Cxiz6cTlIeDKVvu+JZ5nEzzHZw==;\n\t24:HWKhiuXXAVocn7SyCShLXTULV/hAPFuvAGvLv9JxH0CE8QlKbgW3Z0E/iZwQBBtWWoC+1Vmn9cLPvsho3pzfTW6/bjnP+02B6Hok/7TIlj4=;\n\t7:CGkESGqUagZISpb62PKNQ/4FD1S0zlw82XWmGjFzV97h9JitOsLBkZE2jhytghJbJYDww/SirJCW1wVf3HZpHAUtzYGkBlshfsDTEPe+KciBSd91cak9QrUy5ZWpOQpj98msqI0pFU76W6DWW87Dw8XB/iQDf8SEb3G1K9eri5p/SATiJQbaU+X5hmCMHoblR7pJOpPb8vS21Rjl50sOn5gQ5ORPeq6EfkV+2iAoagM=","x-ms-exchange-antispam-srfa-diagnostics":"SSOS;SSOR;","x-forefront-antispam-report":"SFV:SKI; SCL:-1; SFV:NSPM;\n\tSFS:(10009020)(6009001)(346002)(39860400002)(376002)(199003)(189002)(377454003)(13464003)(3280700002)(8676002)(39060400002)(8936002)(4326008)(66066001)(14454004)(6116002)(7736002)(305945005)(102836003)(5250100002)(2906002)(74316002)(7416002)(316002)(97736004)(3846002)(93886005)(110136005)(189998001)(6506006)(105586002)(2950100002)(106356001)(54906003)(5660300001)(81166006)(81156014)(33656002)(76176999)(54356999)(3660700001)(6436002)(50986999)(229853002)(86362001)(55016002)(53936002)(99286003)(478600001)(7696004)(6246003)(101416001)(25786009)(9686003)(2900100001)(68736007)(53546010);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0401MB2545;\n\tH:AM5PR0401MB2545.eurprd04.prod.outlook.com; FPR:; SPF:None;\n\tPTR:InfoNoRecords; A:1; MX:1; LANG:en; ","x-ms-office365-filtering-correlation-id":"ad173c4e-c63d-45eb-7dd1-08d50faa04f2","x-ms-office365-filtering-ht":"Tenant","x-microsoft-antispam":"UriScan:; BCL:0; PCL:0;\n\tRULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075);\n\tSRVR:AM5PR0401MB2545; ","x-ms-traffictypediagnostic":"AM5PR0401MB2545:","x-exchange-antispam-report-test":"UriScan:(180628864354917)(228905959029699); ","x-microsoft-antispam-prvs":"<AM5PR0401MB2545603E8C6F2D216F6F9A919A750@AM5PR0401MB2545.eurprd04.prod.outlook.com>","x-exchange-antispam-report-cfa-test":"BCL:0; PCL:0;\n\tRULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);\n\tSRVR:AM5PR0401MB2545; BCL:0; PCL:0;\n\tRULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);\n\tSRVR:AM5PR0401MB2545; ","x-forefront-prvs":"04569283F9","received-spf":"None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)","spamdiagnosticoutput":"1:99","spamdiagnosticmetadata":"NSPM","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"quoted-printable","MIME-Version":"1.0","X-OriginatorOrg":"nxp.com","X-MS-Exchange-CrossTenant-originalarrivaltime":"10 Oct 2017 06:42:04.3713\n\t(UTC)","X-MS-Exchange-CrossTenant-fromentityheader":"Hosted","X-MS-Exchange-CrossTenant-id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"AM5PR0401MB2545","X-detected-operating-system":"by eggs.gnu.org: Windows 7 or 8 [fuzzy]","X-Received-From":"104.47.2.47","Subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"linu.cherian@cavium.com\" <linu.cherian@cavium.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}},{"id":1784457,"web_url":"http://patchwork.ozlabs.org/comment/1784457/","msgid":"<2633883e-ed41-964b-9c27-bc36f86e9b4d@redhat.com>","list_archive_url":null,"date":"2017-10-11T09:42:55","subject":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","submitter":{"id":69187,"url":"http://patchwork.ozlabs.org/api/people/69187/","name":"Eric Auger","email":"eric.auger@redhat.com"},"content":"Hi Bharat,\n\nOn 10/10/2017 08:42, Bharat Bhushan wrote:\n> Hi Alex, Eric,\n> \n>> -----Original Message-----\n>> From: Qemu-devel [mailto:qemu-devel-\n>> bounces+bharat.bhushan=nxp.com@nongnu.org] On Behalf Of Bharat\n>> Bhushan\n>> Sent: Friday, October 06, 2017 9:16 AM\n>> To: Auger Eric <eric.auger@redhat.com>; Linu Cherian\n>> <linuc.decode@gmail.com>\n>> Cc: peter.maydell@linaro.org; kevin.tian@intel.com; mst@redhat.com;\n>> marc.zyngier@arm.com; tn@semihalf.com; will.deacon@arm.com;\n>> drjones@redhat.com; qemu-devel@nongnu.org;\n>> alex.williamson@redhat.com; qemu-arm@nongnu.org;\n>> linu.cherian@cavium.com; eric.auger.pro@gmail.com;\n>> robin.murphy@arm.com; christoffer.dall@linaro.org;\n>> bharatb.yadav@gmail.com\n>> Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n>> integration\n>>\n>>\n>>\n>>>>> Thanks\n>>>>>\n>>>>> Eric\n>>>>>>\n>>>>>> However you should be allowed to map 1 sg element of 5 pages and\n>>>>>> then notify the host about this event I think. Still looking at the code...\n>>>>>>\n>>>>>> I still can't reproduce the issue at the moment. What kind of\n>>>>>> device are you assigning?\n>>>>>>\n>>>>>> Thanks\n>>>>>>\n>>>>>> Eric\n>>>>>>>\n>>>>>>> Atleast vfio_get_vaddr called from vfio_iommu_map_notify in Qemu\n>>>>>>> expects the map size to be a power of 2.\n>>>>\n>>>> Actually I missed the most important here ;-)\n>>>>>>>\n>>>>>>>  if (len & iotlb->addr_mask) {\n>>>> This check looks suspiscious to me. In our case the len is not\n>>>> modified by the previous translation and it fails, I don't see why.\n>>>> It should be valid to be able to notify 5 granules.\n>>>\n>>> So after discussion with Alex, looks the way we notify the host\n>>> currently is wrong. we set the addr_mask to the mapping/unmapping size\n>>> -1 whereas this should be a page mask instead (granule size or block size?).\n>>> So if the guest maps 5 x 4kB pages we should send 5 notifications for\n>>> each page and not a single one. It is unclear to me if we can notify\n>>> with hugepage/block page size mask. Peter may confirm/infirm this. in\n>>> vsmmuv3 code I notify by granule or block size.\n> \n> My understanding is that host provides supported page sizes (page_size_mask), and Size of each notification to host should be exactly best fit of supported page-size and/or multiples of supported page-sizes.\n> So if guest maps 20K size (single request), and supported page size is 4K, so we can still send one 20K size request.\n> Not sure I get it, why multiples of supported page-size cannot be provided in one notification to host.\nI think the IOTLB API was originally devised to manage only granule or\nblock ^2 sizes. We might change this in the future but for the moment,\nwith respect to this series,  I would simply recommend to stick to the\nexisting API limitation and concurrently we can work on relaxing this\nconstraint on another series.\n\nThanks\n\nEric\n> \n> Thanks\n> -Bharat\n> \n>>>\n>>> Bharat, please can you add this to your TODO list?\n>>>\n>>> Linu, thanks a lot for the time you spent debugging this issue.\n>>> Curiously on my side, it is really seldom hit but it is ...\n>>\n>> Thanks Linu and Eric, I added this to my todo list.\n>> While I am still not able to reproduce the issue.  I tried with e1000 and now\n>> try with ixgbe device. May I know which device can be used to reproduce this\n>> issue?\n>>\n>> Thanks\n>> -Bharat\n>>\n>>>\n>>> Thanks!\n>>>\n>>> Eric\n>>>>\n>>>> Thanks\n>>>>\n>>>> Eric\n>>>>>>>         error_report(\"iommu has granularity incompatible with target\n>> AS\");\n>>>>>>>         return false;\n>>>>>>>     }\n>>>>>>>\n>>>>>>> Just trying to understand how this is not hitting in your case.\n>>>>>>>\n>>>>>>>\n>>>>>>\n>>>>>\n>>>>\n>","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 3yBpvh20PGz9s7g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 11 Oct 2017 20:43:44 +1100 (AEDT)","from localhost ([::1]:39867 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 1e2DYE-00080a-Dr\n\tfor incoming@patchwork.ozlabs.org; Wed, 11 Oct 2017 05:43:42 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:52640)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e2DXp-0007wr-ED\n\tfor qemu-devel@nongnu.org; Wed, 11 Oct 2017 05:43:18 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eric.auger@redhat.com>) id 1e2DXo-0007DI-AX\n\tfor qemu-devel@nongnu.org; Wed, 11 Oct 2017 05:43:17 -0400","from mx1.redhat.com ([209.132.183.28]:36158)\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 1e2DXi-00077p-M4; Wed, 11 Oct 2017 05:43:10 -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 E59E07E454;\n\tWed, 11 Oct 2017 09:43:08 +0000 (UTC)","from localhost.localdomain (ovpn-117-172.ams2.redhat.com\n\t[10.36.117.172])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 2803918990;\n\tWed, 11 Oct 2017 09:42:56 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com E59E07E454","To":"Bharat Bhushan <bharat.bhushan@nxp.com>,\n\tLinu Cherian <linuc.decode@gmail.com>","References":"<1506494000-31982-1-git-send-email-Bharat.Bhushan@nxp.com>\n\t<20170927074109.GA31587@virtx40>\n\t<AM5PR0401MB25450ACC804B20D93C4F2D9D9A780@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<9700cf30-65ed-9c55-c1b9-14bb8deb669f@redhat.com>\n\t<20170927092147.GA32183@virtx40>\n\t<0af599c0-f859-f90c-c999-bc4a0a678768@redhat.com>\n\t<20171004114910.GA6932@virtx40>\n\t<79234c56-c524-5359-de8a-f266b19821eb@redhat.com>\n\t<9d173ea5-75a6-c684-7f8d-e2ec1d3eddff@redhat.com>\n\t<1017080b-aa5f-4a1f-9905-e65f22717cd1@redhat.com>\n\t<b740e8b7-5859-fd6a-1f1e-480aef6ef4f0@redhat.com>\n\t<AM5PR0401MB254548523AC95D0A2A8A92E69A710@AM5PR0401MB2545.eurprd04.prod.outlook.com>\n\t<AM5PR0401MB254512CE483DD6E684037A629A750@AM5PR0401MB2545.eurprd04.prod.outlook.com>","From":"Auger Eric <eric.auger@redhat.com>","Message-ID":"<2633883e-ed41-964b-9c27-bc36f86e9b4d@redhat.com>","Date":"Wed, 11 Oct 2017 11:42:55 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101\n\tThunderbird/45.4.0","MIME-Version":"1.0","In-Reply-To":"<AM5PR0401MB254512CE483DD6E684037A629A750@AM5PR0401MB2545.eurprd04.prod.outlook.com>","Content-Type":"text/plain; charset=windows-1252","Content-Transfer-Encoding":"7bit","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\tWed, 11 Oct 2017 09:43:09 +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":"Re: [Qemu-devel] [Qemu-arm] [PATCH v4 0/5] virtio-iommu: VFIO\n\tintegration","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":"\"peter.maydell@linaro.org\" <peter.maydell@linaro.org>,\n\t\"kevin.tian@intel.com\" <kevin.tian@intel.com>,\n\t\"mst@redhat.com\" <mst@redhat.com>,\n\t\"marc.zyngier@arm.com\" <marc.zyngier@arm.com>,\n\t\"tn@semihalf.com\" <tn@semihalf.com>,\n\t\"will.deacon@arm.com\" <will.deacon@arm.com>,\n\t\"drjones@redhat.com\" <drjones@redhat.com>,\n\t\"qemu-devel@nongnu.org\" <qemu-devel@nongnu.org>,\n\t\"alex.williamson@redhat.com\" <alex.williamson@redhat.com>,\n\t\"qemu-arm@nongnu.org\" <qemu-arm@nongnu.org>,\n\t\"linu.cherian@cavium.com\" <linu.cherian@cavium.com>,\n\t\"bharatb.yadav@gmail.com\" <bharatb.yadav@gmail.com>,\n\t\"robin.murphy@arm.com\" <robin.murphy@arm.com>,\n\t\"christoffer.dall@linaro.org\" <christoffer.dall@linaro.org>,\n\t\"eric.auger.pro@gmail.com\" <eric.auger.pro@gmail.com>","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>"}}]