From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58516) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX5Wz-0002QK-Gl for qemu-devel@nongnu.org; Tue, 30 Apr 2013 04:03:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UX5Wu-00074s-EO for qemu-devel@nongnu.org; Tue, 30 Apr 2013 04:03:21 -0400 Received: from ozlabs.org ([203.10.76.45]:45873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UX5Wu-00073K-3B for qemu-devel@nongnu.org; Tue, 30 Apr 2013 04:03:16 -0400 Date: Tue, 30 Apr 2013 17:54:12 +1000 From: David Gibson Message-ID: <20130430075412.GD20202@truffula.fritz.box> References: <517BC1F2.70405@redhat.com> <20130428015822.GE20202@truffula.fritz.box> <517E2B1A.8000209@redhat.com> <20130429110047.GL20202@truffula.fritz.box> <517E5B9E.1020006@redhat.com> <20130429115653.GQ20202@truffula.fritz.box> <517E794B.1060307@redhat.com> <20130430020539.GT20202@truffula.fritz.box> <20130430022329.GV20202@truffula.fritz.box> <517F7304.1010205@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m1G908gh+QHqN0Gd" Content-Disposition: inline In-Reply-To: <517F7304.1010205@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/4] vfio: Move container list to iommu MemoryRegion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aik@ozlabs.ru, alex.williamson@redhat.com, qemu-devel@nongnu.org --m1G908gh+QHqN0Gd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 30, 2013 at 09:30:12AM +0200, Paolo Bonzini wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 >=20 > Il 30/04/2013 04:23, David Gibson ha scritto: > >>> I think this is a different problem. Basically the question is > >>> "what happens if a MemoryRegion 'disappears' while an > >>> AddressSpace is still referring to it", and the answer right > >>> now is "badness". > >>=20 > >> Well.. no. The same problem may well exist for AddressSpace > >> objects, but in this case it's for the VFIO private > >> per-address-space object. >=20 > Well, once we clarify the lifetime of AddressSpaces, we can clarify > the lifetime of the VFIO private object. Hrm. I don't see why. The VFIO private data is tied to the MemoryRegion, not an AddressSpace since that's what represents the iommu. > >>> We should look at generic fixes before dropping hooks in the > >>> code. At the very least an "assert(mr->parent =3D=3D NULL);" is > >>> missing in memory_region_destroy. > >>=20 > >> Well, sure that's probably also a good idea. But the whole point > >> here is you're insisting that the MemoryRegion code doesn't know > >> about the vfio private data, even as an opaque handle, and so > >> there's no possible assert we can put there to check it has been > >> destroyed. > >=20 > > Oh, yes, forgot to ask. I'm still unclear on what the conceptual=20 > > difference is supposed to between a MemoryRegion and an > > AddressSpace. AFAICT AddressSpace seems to be roughly just a > > wrapper on a MemoryRegion that gives it some more features. >=20 > Yes, an AddressSpace is a wrapper for a MemoryRegion that has a NULL > - ->parent, with two extra features: >=20 > - - QEMU computes the "flat" view of the MemoryRegion and a compressed > radix tree representation of that view Ok. It's not clear to me what that means in practice. --=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 --m1G908gh+QHqN0Gd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlF/eKQACgkQaILKxv3ab8b+mwCeIS9FYeDss5vMwzXTXY850/ul YLAAn1OntDpXJsgMQmido3QCaseK9CRD =8/+r -----END PGP SIGNATURE----- --m1G908gh+QHqN0Gd--