From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVGTz-00028P-AI for qemu-devel@nongnu.org; Thu, 25 Apr 2013 03:20:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVGTv-000410-1p for qemu-devel@nongnu.org; Thu, 25 Apr 2013 03:20:43 -0400 Received: from ozlabs.org ([2402:b800:7003:1:1::1]:59197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVGTu-00040g-Lg for qemu-devel@nongnu.org; Thu, 25 Apr 2013 03:20:38 -0400 Date: Thu, 25 Apr 2013 16:35:58 +1000 From: David Gibson Message-ID: <20130425063558.GP4297@truffula.fritz.box> References: <1366804881-553-1-git-send-email-david@gibson.dropbear.id.au> <1366804881-553-5-git-send-email-david@gibson.dropbear.id.au> <1366816359.2918.703.camel@bling.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5tINJiUS2/Dn5Rhr" Content-Disposition: inline In-Reply-To: <1366816359.2918.703.camel@bling.home> Subject: Re: [Qemu-devel] [PATCH 4/5] vfio: Move container list to DMAContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: aik@ozlabs.ru, qemu-devel@nongnu.org --5tINJiUS2/Dn5Rhr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 24, 2013 at 09:12:39AM -0600, Alex Williamson wrote: > On Wed, 2013-04-24 at 22:01 +1000, David Gibson wrote: > > At the moment, vfio maintains a global list of containers that are assu= med > > to be more or less interchangeable, since they are all set up with a > > MemoryListener to have all of system memory mapped. However, that only > > makes sense if all the containers are used on devices which really do > > expect a dma address space identical to system memory. > >=20 > > This patch moves towards that by making the list of containers per > > DMAContext (which corresponds to a dma address space) instead of global. >=20 > This seems like an unnecessary intrusion into common code. Why not > create a vfio specific list of dma objects, each with a list of > containers? Thanks, Possible, but ugly. DMAContext *is* the handle for a DMA address space. Having a parallel array of VFIO contextns would be converting =66rom the generic handle to the VFIO one would be a search, rather than just a dereference, and making sure the lifetime of the VFIO one matches the lifetime of the generic object would be unnecessarily awkward. Which reminds me, I forgot to implement a VFIO hook for DMAContext destruction in this patch. That does need to be fixed. --=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 --5tINJiUS2/Dn5Rhr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlF4zs4ACgkQaILKxv3ab8ZBWACff9R1Wi7J9cJv/v+CNSkNhRXt YmwAn27QIfkFs18cMN4nBZu2Xh75lMPV =XeDI -----END PGP SIGNATURE----- --5tINJiUS2/Dn5Rhr--