From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMqDK-00017M-8S for qemu-devel@nongnu.org; Tue, 12 Jul 2016 01:26:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMqDG-0006eZ-Th for qemu-devel@nongnu.org; Tue, 12 Jul 2016 01:26:34 -0400 Date: Tue, 12 Jul 2016 15:26:17 +1000 From: David Gibson Message-ID: <20160712052617.GX16355@voom.fritz.box> References: <1467696699-8941-1-git-send-email-david@gibson.dropbear.id.au> <1467696699-8941-8-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1IWgL8yD8uKyf/Tu" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PULL 07/14] vfio/spapr: Create DMA window dynamically (SPAPR IOMMU v2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, alex.williamson@redhat.com, qemu-ppc@nongnu.org --1IWgL8yD8uKyf/Tu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 11, 2016 at 03:51:44PM +0200, Paolo Bonzini wrote: >=20 >=20 > On 05/07/2016 07:31, David Gibson wrote: > > + ret =3D ioctl(container->fd, VFIO_IOMMU_SPAPR_TCE_CREATE, &create); > > + if (ret) { > > + error_report("Failed to create a window, ret =3D %d (%m)", ret= ); > > + return -errno; > > + } > > + > > + if (create.start_addr !=3D section->offset_within_address_space) { > > + vfio_spapr_remove_window(container, create.start_addr); > > + > > + error_report("Host doesn't support DMA window at %"HWADDR_PRIx= ", must be %"PRIx64, > > + section->offset_within_address_space, > > + (uint64_t)create.start_addr); > > + ioctl(container->fd, VFIO_IOMMU_SPAPR_TCE_REMOVE, &remove); >=20 > Was this ioctl left there by mistake? It passes the address of the > remove *function* to VFIO_IOMMU_SPAPR_TCE_REMOVE. Heh, good catch. I've posted a fix for this. --=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 --1IWgL8yD8uKyf/Tu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJXhH95AAoJEGw4ysog2bOSNRIP/iqn5dfawa3uiaH4B1ORNtEk m66XnwxS6nVYRGxtksSepqhThQkQzuppu4ZHYobGMnMvoT7yIlp57MWQEU0QAY97 EaXne6DPDghYm3hGEERaqpO45r5UEDh2E0cx2Oti3/GCShGP374CuBeUlR3dxzve dCnUHH57yTLG4BZ6KcUfNXCYK+E7iD6+gMzYYTCT/Kh0qQ/sxYGfwvzrCCjF4KZY wFVyV03tVp2gzDpamZKp5X+uur85mQpaYaToyEuzCmr3QJ/Gqt1twgN+EuZxZi6d jbnF3TZ6Kz9v9EwPNTnQ3gT7brFSLSWRNa7XXCPXQIouvduRcz+Tcr6uXe7PITWD qCcOBtUfXiODG4i4F5zW96G1ktvSzbe3D0ai7k2l+tk09jONBxvUvnstt5i0Bh/c qaLS8ICh9YqDZ0W0RSkYW3DwTP6p7biHJxBG1PRdp8VZAreQHrGMhBr4ngBYDR2/ yJcqrYPeLxBB6KD92vgKW3rwxjvI4wqI166Fcg8VtpjZfjRPwtpojnMirU44qzso han2hkuy48angbBjHQ7ZfQ610l3UxlzqnblEHdQ6n2LD/4FP7F+AWGy6plIcF+on KruhfmzIhdpxE7lXPK+ivoe8g8iwHmjvQA1XQwZkiTW+l5Bl2HPYN0tRoG829rD8 eGoVn2dvuo6Swlr2e3mN =yKpG -----END PGP SIGNATURE----- --1IWgL8yD8uKyf/Tu--