From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUzPt-0007P5-MV for qemu-devel@nongnu.org; Wed, 24 Apr 2013 09:07:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUzPl-00079u-Kc for qemu-devel@nongnu.org; Wed, 24 Apr 2013 09:07:21 -0400 Received: from ozlabs.org ([203.10.76.45]:52796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUzPl-00079i-A2 for qemu-devel@nongnu.org; Wed, 24 Apr 2013 09:07:13 -0400 Date: Wed, 24 Apr 2013 23:07:07 +1000 From: David Gibson Message-ID: <20130424130707.GO4297@truffula.fritz.box> References: <1366804881-553-1-git-send-email-david@gibson.dropbear.id.au> <1366804881-553-3-git-send-email-david@gibson.dropbear.id.au> <5177D14D.5000609@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BuGwuXnZwGGQ9GEc" Content-Disposition: inline In-Reply-To: <5177D14D.5000609@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/5] pci: Don't create an address space object for every PCI device 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 --BuGwuXnZwGGQ9GEc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 24, 2013 at 02:34:21PM +0200, Paolo Bonzini wrote: > Il 24/04/2013 14:01, David Gibson ha scritto: > > So while its true that the DMAContext handling needs to be better > > integrated with the MemoryRegion and AddressSpace handling, that commit > > wasn't actually a step in the right direction for it. Since then, the > > DMAContext has been extended so it can backend onto an AddressSpace, and > > thereby, a MemoryRegion. Effectively a DMAContext is now an AddressSpa= ce > > with iommu translation handling on top. > >=20 > > Therefore, this patch essentially reverts the earlier commit, making all > > PCI devices by default shared the global dma_context_memory which backs > > onto main system memory. Those cases which need to set up different DMA > > address spaces for each PCI device should supply a suitable dma_context= _fn > > in the bus to correctly assign / create suitable DMAContext structures. >=20 > I think this will be handled correctly when I submit IOMMU AddressSpace > patches (next week or so). The structure will be >=20 > PCI device 1 PCI device 2 > --------------------------------------------------------------- > AddressSpace 1 AddressSpace 2 > | | > | (enable/disable) | (enable/disable) > '-------------------. .----------------' > v v > IOMMU AddressSpace > | > | (translation) > v > system memory >=20 > VFIO will be able to access the IOMMU AddressSpace simply via > pci_dev->iommu, and that field will be =3D=3D-identical for different PCI > devices. Hrm, ok. Still seems excessively complicated, but as long as there's a way to get from the pci device to the common address space, I can work with that. --=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 --BuGwuXnZwGGQ9GEc Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlF32PsACgkQaILKxv3ab8aT3gCfZYv2NdYAmoQMO0av4E4RyOFQ 3VwAn1qsU1y8elvP7D6YNzT193HBdnBh =429m -----END PGP SIGNATURE----- --BuGwuXnZwGGQ9GEc--