From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiXHm-0006vC-15 for qemu-devel@nongnu.org; Tue, 22 Mar 2016 21:08:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiXHi-0002BE-Mo for qemu-devel@nongnu.org; Tue, 22 Mar 2016 21:08:33 -0400 Date: Wed, 23 Mar 2016 11:43:24 +1100 From: David Gibson Message-ID: <20160323004324.GN23586@voom.redhat.com> References: <1458546426-26222-1-git-send-email-aik@ozlabs.ru> <1458546426-26222-13-git-send-email-aik@ozlabs.ru> <20160322030515.GZ23586@voom.redhat.com> <20160322094710.75ce3ace@t450s.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+0pH9m6FYzpAKDUB" Content-Disposition: inline In-Reply-To: <20160322094710.75ce3ace@t450s.home> Subject: Re: [Qemu-devel] [PATCH qemu v14 12/18] vfio: Check that IOMMU MR translates to system address space List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, qemu-devel@nongnu.org --+0pH9m6FYzpAKDUB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 22, 2016 at 09:47:10AM -0600, Alex Williamson wrote: > On Tue, 22 Mar 2016 14:05:15 +1100 > David Gibson wrote: >=20 > > On Mon, Mar 21, 2016 at 06:47:00PM +1100, Alexey Kardashevskiy wrote: > > > At the moment IOMMU MR only translate to the system memory. > > > However if some new code changes this, we will need clear indication = why > > > it is not working so here is the check. > > >=20 > > > Signed-off-by: Alexey Kardashevskiy =20 > >=20 > > Reviewed-by: David Gibson > >=20 > > Alex, any chance we could merge this quickly, since it is a reasonable > > sanity check even without the rest of the changes. >=20 > It all sounds very theoretical to inspire some rush to merge it > quickly, is there any chance we could actually hit this currently? Hm, I guess not. Ok, let's leave it for now. >=20 > > > --- > > > Changes: > > > v14: > > > * new to the series > > > --- > > > hw/vfio/common.c | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > >=20 > > > diff --git a/hw/vfio/common.c b/hw/vfio/common.c > > > index 55723c9..9587c25 100644 > > > --- a/hw/vfio/common.c > > > +++ b/hw/vfio/common.c > > > @@ -266,6 +266,12 @@ static void vfio_iommu_map_notify(Notifier *n, v= oid *data) > > > =20 > > > trace_vfio_iommu_map_notify(iova, iova + iotlb->addr_mask); > > > =20 > > > + if (iotlb->target_as !=3D &address_space_memory) { > > > + error_report("Wrong target AS \"%s\", only system memory is = allowed", > > > + iotlb->target_as->name?iotlb->target_as->name:"= noname"); >=20 > Spaces please. >=20 > > > + return; > > > + } > > > + > > > /* > > > * The IOMMU TLB entry we have just covers translation through > > > * this IOMMU to its immediate target. We need to translate =20 > >=20 >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --+0pH9m6FYzpAKDUB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW8easAAoJEGw4ysog2bOShGYP/1vMrynzN6k7V/DCkmGNUS58 ldoVvtn6hpJO3u5RSyM0e6VR6OOAoZs5eyHVmmGkeXDTOuTmjWovn0L9+Pah47Nu +Wgia851djnpR6Jkv6nOciWsH/HwUc5CBI/P5R/mjfnOBHZt4y53ZEYMtGSLM+YG 2duoR2yItNuylAwV57YUx9Pj6INHrfutSEMHBKmgNFXeYA/PUUY8aa0bdninzWe8 hh3Bx1UzURoI7GuYZgQFcT4i09bLbOh/IwOVlY+LI9CYKEBMPbzXvmZqF/wMF6jg rS9fLNXdqkTV0mni/CwvDhD1WWRapE5hqxp8tGO89V3sKmOaPNtma3QUApMt7c6D uU6qb0vc3qgZQ/SsRwJnGJf998Rs6qj+UPJI1HPIVlUUJD0R2PxM1VwzU91R3dn+ aNL7plmUo3AidRyM2URGsDZ7iu0+7w8KquA1FcrGrEx+Ujs4XIjRdTL2lYHTzEwb p/J8tJJDmcSw0I0RXIavC4rLQyXqLl0eFeaMw4wRtRiXaIhv9GlVcNUSILxm3apF YVNoBCJ/CgJ3O/R/JWvIbqB7mxptvMEAEYPutTKPPo2I3BrGWuGgkH24Qbvuz+gG uXnW753yZJOh7FYo35pGkPbzrX7U7yd2yY1OJpBcm9dNdgiKB9Ank7/7LnaptmsZ A8ATdcw4tYc6AVk6N6uN =u4xc -----END PGP SIGNATURE----- --+0pH9m6FYzpAKDUB--