From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFFlx-0005Jq-1F for qemu-devel@nongnu.org; Tue, 21 Jun 2016 03:06:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFFlu-0002iu-Rn for qemu-devel@nongnu.org; Tue, 21 Jun 2016 03:06:55 -0400 Date: Tue, 21 Jun 2016 16:50:17 +1000 From: David Gibson Message-ID: <20160621065017.GC17957@voom.fritz.box> References: <1466471645-5396-1-git-send-email-aik@ozlabs.ru> <1466471645-5396-4-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kVXhAStRUZ/+rrGn" Content-Disposition: inline In-Reply-To: <1466471645-5396-4-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH qemu v18 3/5] vfio: Add host side DMA window capabilities List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Alex Williamson --kVXhAStRUZ/+rrGn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 21, 2016 at 11:14:03AM +1000, Alexey Kardashevskiy wrote: > There are going to be multiple IOMMUs per a container. This moves > the single host IOMMU parameter set to a list of VFIOHostDMAWindow. >=20 > This should cause no behavioral change and will be used later by > the SPAPR TCE IOMMU v2 which will also add a vfio_host_win_del() helper. >=20 > Signed-off-by: Alexey Kardashevskiy > Reviewed-by: David Gibson Looks ok to me. Again, Alex, your tree or mine? One minor point.. [snip] > @@ -878,17 +908,14 @@ static int vfio_connect_container(VFIOGroup *group,= AddressSpace *as) > * existing Type1 IOMMUs generally support any IOVA we're > * going to actually try in practice. > */ > - container->min_iova =3D 0; > - container->max_iova =3D (hwaddr)-1; > - > - /* Assume just 4K IOVA page size */ > - container->iova_pgsizes =3D 0x1000; > info.argsz =3D sizeof(info); > ret =3D ioctl(fd, VFIO_IOMMU_GET_INFO, &info); > /* Ignore errors */ > - if ((ret =3D=3D 0) && (info.flags & VFIO_IOMMU_INFO_PGSIZES)) { > - container->iova_pgsizes =3D info.iova_pgsizes; > + if (ret || !(info.flags & VFIO_IOMMU_INFO_PGSIZES)) { > + /* Assume 4k IOVA page size */ > + info.iova_pgsizes =3D 4096; > } > + vfio_host_win_add(container, 0, (hwaddr)-1, info.iova_pgsizes); I don't think it needs to hold this patch up, but at some point we should work out the real range covered by the x86 IOMMU tables and put that in here. I'm pretty sure it won't actually be 2^64-1. --=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 --kVXhAStRUZ/+rrGn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXaOOpAAoJEGw4ysog2bOSxtIP/AwZ1oSfdeUoIELmGzqamHKJ n3UZ4VZV9szwVlQGvbz7AD8RhI7U/UciVkQy1n2gaSyXytIaygEZxVF327avo0wd HlBuoJR9YYt6vvAhaCKkca2ORglPFEHWxDeiMY6tQO8ucihMG6qleMcpoTrA5U16 wqXbWh374KmHGFIla+8E8DHx8xsO7I3d7fCTxqpQTC6yK97mbVnJwtIMzhFCXITm 0nLgmZoiL+AkD3BuD70jz578v2yPLJHt8+TG8eXDUY/RRJ93xfb814iyQdQ3iC87 lo7zBBibEtv74oVF7RQwTmoqZRvywvJRGuGkvf0dhad/fsEL3uWAOgTooE2BlYqS IgVItVKN7uh6lpuo7yAcdVq+cMnSwzGHQxDsUBSOuoclkfu9gtx/GhIjtTOB4NRJ pYXe7XUUuH3gowdw48WfOLqnNntU0uYhvVxBMdWMNL0rlOioErq8GbSCaC5AqLCj sbDmqniZmhxpXiDMXx77GdXVgGCcdiWuebj7zyfS5PK1o+7Ucjy2wL8m61XrcXvi xVCuGk09YN1C1T0HLq+5NycwegBOBhJAAFQ6eO7INHhOhkL3R1+c1nxF0/Hcl9Ex qttJLEaBspbwIM04wdWehx+wDLmlo1o3oNqltljpVOQ/TT7051X9zIn5IUemV1rB z4kg3A9lo9crPTS18b8G =VbYD -----END PGP SIGNATURE----- --kVXhAStRUZ/+rrGn--