From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfheH-0005rK-MQ for qemu-devel@nongnu.org; Fri, 02 Sep 2016 02:08:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfheD-0006jb-8v for qemu-devel@nongnu.org; Fri, 02 Sep 2016 02:08:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfheD-0006jS-0v for qemu-devel@nongnu.org; Fri, 02 Sep 2016 02:08:17 -0400 Date: Fri, 2 Sep 2016 16:10:14 +1000 From: David Gibson Message-ID: <20160902161014.7e53530b@voom.fritz.box> In-Reply-To: <20160902053733.GB10595@pxdev.xzpeter.org> References: <1472526419-5900-1-git-send-email-jasowang@redhat.com> <1472526419-5900-11-git-send-email-jasowang@redhat.com> <20160829213702.536df0df@t450s.home> <76fb2f05-4f9c-3e91-d301-3e0a6d4cabaf@redhat.com> <20160901022929.GA3558@pxdev.xzpeter.org> <20160831204342.77fbe728@t450s.home> <20160901035848.GC3558@pxdev.xzpeter.org> <20160902141504.05950823@voom.fritz.box> <20160902053733.GB10595@pxdev.xzpeter.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/DVjB6G3RBHgU./3+=knvL+K"; protocol="application/pgp-signature" Subject: Re: [Qemu-devel] [PATCH for 2.8 10/11] Revert "intel_iommu: Throw hw_error on notify_started" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: Alex Williamson , Jason Wang , mst@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, cornelia.huck@de.ibm.com, wexu@redhat.com, vkaplans@redhat.com --Sig_/DVjB6G3RBHgU./3+=knvL+K Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 2 Sep 2016 13:37:33 +0800 Peter Xu wrote: > On Fri, Sep 02, 2016 at 02:15:04PM +1000, David Gibson wrote: > > What!? I see no reason you need a different notifier, just fix the > > implementation of the current one. As a bonus this will also give you > > working VFIO passthrough with vIOMMU on x86, something which should > > work already, but doesn't. =20 >=20 > Hi, David, >=20 > Do you mean that we can enhance the interface to suite the two needs? > E.g., adding a "IOTLB notification type" definition: >=20 > - "full": for those who is listening on all mapping changes including > additions (VFIO use case) >=20 > - "cache_only": for those who only cares about cache invalidations > (device IOTLB, aka, vhost use case) >=20 > We can: >=20 > - add notify type when we register the notifiers (e.g., when VFIO > registers IOMMU notifier, it should specify the type as "full", so > it won't receive notification if it's device IOTLB invalidations). >=20 > - pass this type when trigger the notification, so for each IOMMU > notify handler, it can selectively disgard the notification. >=20 > Not sure whether above makes sense. No, implement the full notifier, and a listener which only wants the invalidates can just ignore callbacks which add new mappings. As I said, you'll need this to get VFIO working with vIOMMU which someone is bound to want soon enough anyway. --=20 David Gibson Senior Software Engineer, Virtualization, Red Hat --Sig_/DVjB6G3RBHgU./3+=knvL+K Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXyRfGAAoJEGw4ysog2bOSr2oP/R7AmdxH5ga+cr+2N1NVX/47 g3cTPDlUNsQ65daGZ6yEdLbm/9cbVERR740TN+Q2R+28AekjAWj0WS5WqxeZ4e8/ /S5ZsUEuAy9gehcUpyyuntHR6XpH9eSCxPTmy1DCKKo+P7bNcfzgGZMKnGQA7s8B cEykf0RTWEeDKWdn7Pn4SsI3pVh92UFyyaeQkG1u0pXgqiF0dib5mR1JL19wxoxj tJtRdwUAitfVpnoVOcsaaNmg/WqYwDGMWZtb2hXERpANRkdpY1cOxefCJOfDckEC 9SwYjlAtlFW9ub+BzjxwhOK0dACakALoHJnZrn9rwdcvHzsGhGJCQHUgzv9OnO6C emtdSFst1kTvYrbIsQmCg6vUyWm19DoUE5wyfN0MlG6M9OyxB25m0MGpjSGiWLsJ y9pp1q8wuZ6+7r0kS5CKv5TBNGYPCs7nNKrnxUN19dORjsq0oh6BBx8iyfI0IUpe NbV8VJCOXbZfwfk7t9PEmQSTnpbNuzRh8/DSLyz4NInc2TQteO/IqwwHMUpWU6Rq v/KbC/6UlMzjzGG01T+ywYYtzntz/qTqpFD2Lj2XIvSybkU6vIVV0ph264IALmXh B1kfSw42QGvBfFutMInq0ZglufeHcvt/m+xfrhN8fd/ZRS+F0BKDicBv3Q4sUOoQ l3dU3/ux/x6DpRbFK7FF =wana -----END PGP SIGNATURE----- --Sig_/DVjB6G3RBHgU./3+=knvL+K--