Received: from eggs.gnu.org ([2001:4830:134:3::10]:49792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bffqw-00083X-Hw for qemu-devel@nongnu.org; Fri, 02 Sep 2016 00:13:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bffqq-0004ME-EI for qemu-devel@nongnu.org; Fri, 02 Sep 2016 00:13:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bffqq-0004M5-6g for qemu-devel@nongnu.org; Fri, 02 Sep 2016 00:13:12 -0400 Date: Fri, 2 Sep 2016 14:15:04 +1000 From: David Gibson Message-ID: <20160902141504.05950823@voom.fritz.box> In-Reply-To: <20160901035848.GC3558@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> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/xss4iB1M0j7U43g2BCLbrra"; 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_/xss4iB1M0j7U43g2BCLbrra Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 1 Sep 2016 11:58:48 +0800 Peter Xu wrote: > On Wed, Aug 31, 2016 at 08:43:42PM -0600, Alex Williamson wrote: > > > > >>This reverts commit 3cb3b1549f5401dc3a5e1d073e34063dc274136f. Vho= st > > > > >>device IOTLB API will get notified and send invalidation request = to > > > > >>vhost through this notifier. =20 > > > > >AFAICT this series does not address the original problem for which > > > > >commit 3cb3b1549f54 was added. We've only addressed the very narr= ow > > > > >use case of a device iotlb firing the iommu notifier therefore this > > > > >change is a regression versus 2.7 since it allows invalid > > > > >configurations with a physical iommu which will never receive the > > > > >necessary notifies from intel-iommu emulation to work properly. T= hanks, > > > > > > > > > >Alex =20 > > > >=20 > > > > Looking at vfio, it cares about map but vhost only cares about IOTLB > > > > invalidation. Then I think we probably need another kind of notifie= r in this > > > > case to avoid this. =20 > > >=20 > > > Shall we leverage IOMMUTLBEntry.perm =3D=3D IOMMU_NONE as a sign for > > > invalidation? If so, we can use the same IOTLB interface as before. > > > IMHO these two interfaces are not conflicting? > > >=20 > > > Alex, > > >=20 > > > Do you mean we should still disallow user from passing through devices > > > while Intel IOMMU enabled? If so, not sure whether patch below can > > > solve the issue. > > >=20 > > > It seems that we need a "name" for either IOMMU notifier > > > provider/consumer, and we should not allow (provider=3D=3DIntel && > > > consumer=3D=3DVFIO) happen. In the following case, I added a name for > > > provider, and VFIO checks it. =20 > >=20 > > Absolutely not, intel-iommu emulation is simply incomplete, the IOMMU > > notifier is never called for mappings. There's a whole aspect of > > iommu notifiers that intel-iommu simply hasn't bothered to implement. > > Don't punish vfio for actually making use of the interface as it was > > intended to be used. AFAICT you're implementing the unmap/invalidation > > half, without the actual mapping half of the interface. It's broken > > and incompatible with any iommu notifiers that expect to see both > > sides. Thanks, =20 >=20 > Yeah I think I got your point. Thanks for the explanation. >=20 > Now I agree with Jason that we may need another notifier mechanism. 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 David Gibson Senior Software Engineer, Virtualization, Red Hat --Sig_/xss4iB1M0j7U43g2BCLbrra Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXyPzJAAoJEGw4ysog2bOSwIUQAM59RHUR45mLN6lsrXIZ6FpR NeurFySRCnIH+5KIeQgLtNKaZsmKeAB/MjchLy0bOc5q6wjZGriSTWwz3JNi61IZ 3PKO+0bBUvC4ouysdAKPrfo1XSNXZu4duFRIrmn0yGifyd9jVr6nLkCuDu+BIZrs 7HYEEJumBOnvg5keD4NXG35zyh0ZdcWwwofSunXpK/uEqunCv0jiQEtUnW03i89e Xx5OcQ9UvMZ6ADM9AOhbaY7MFyQnM4pems+7ChYxJhY2B8x3dZZ9S37z4pTmc+iC k7PYfJTdrtSC3ekPx2WrHAjNiTx8KZIgdU47uxwt4zi8xU4T54xaTP69wgHhYBAP bhR8QqZs29TfVuQcvAF2CnmPITjfe+DphbymRSmGGtFoxewGCHSZcxo5Rde1lTHV 0punbNi7En564GeWINvzeYpYul2uAj2WkXhnEkZbQTcIvYjme30HFydQZJZyvcRa 1C3sOPIZGOHRqIldVP3jSg67ufn0Mhp0KZRiNlRkTLsvIaIULk274//GhSZTBaC5 tgGwmqAdcIlGN0Lyuf89QUkh46Vk0pNKpjNFsqOPA+OHRag7ECyn+1fgQU8bLk7c aGcOslIjzA39VRDtae4oSnLLWEUsjb3OEXCbajKKB0abqVbFK76OJecHboGsO1RO 0d+AVapwo9fqqUHCRIaH =mfTH -----END PGP SIGNATURE----- --Sig_/xss4iB1M0j7U43g2BCLbrra--