From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUzPt-0007P2-Ic for qemu-devel@nongnu.org; Wed, 24 Apr 2013 09:07:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUzPl-00079v-KS for qemu-devel@nongnu.org; Wed, 24 Apr 2013 09:07:21 -0400 Received: from ozlabs.org ([203.10.76.45]:41974) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUzPl-00079h-9x for qemu-devel@nongnu.org; Wed, 24 Apr 2013 09:07:13 -0400 Date: Wed, 24 Apr 2013 23:06:09 +1000 From: David Gibson Message-ID: <20130424130609.GN4297@truffula.fritz.box> References: <1366804881-553-1-git-send-email-david@gibson.dropbear.id.au> <1366804881-553-2-git-send-email-david@gibson.dropbear.id.au> <5177D1DE.10803@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZaW/dtY/7oMe/vLp" Content-Disposition: inline In-Reply-To: <5177D1DE.10803@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/5] pci: Simpler implementation of PCI_COMMAND_MASTER bit 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 --ZaW/dtY/7oMe/vLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 24, 2013 at 02:36:46PM +0200, Paolo Bonzini wrote: > Il 24/04/2013 14:01, David Gibson ha scritto: > > In commit 1c380f9460522f32c8dd2577b2a53d518ec91c6d "pci: honor > > PCI_COMMAND_MASTER" the PCI_COMMAND_MASTER bit of the PCI command regis= ter > > was implemented by toggling the enable bit on a memory region alias > > interposed between the PCI device's dma address space and the main > > system memory region. > >=20 > > Introducing an extra alias region for every PCI device just to implement > > that bit seems like serious overkill. Furthermore, it doesn't work when > > there's a (guest side) iommu present, since that uses a different path = for > > constructing the PCI device's dma address space. > >=20 > > This patch removes the aliased window, instead implementing > > PCI_COMMAND_MASTER with tests in the PCI DMA functions. > >=20 > > Signed-off-by: David Gibson >=20 > This doesn't work. Well.. say rather that it fails to work in a different set of circumstances from those in which the current scheme fails to work. > You have no guarantee that PCI devices use the PCI DMA functions. The > device could just pass the DMAContext to another function, and indeed > the OHCI controller does exactly that. Ah, good point. Drat. > This will be even simpler after IOMMU/DMAContext are also unified in the > AddressSpace framework. >=20 > Paolo >=20 --=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 --ZaW/dtY/7oMe/vLp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlF32MEACgkQaILKxv3ab8at6wCeNN0JXvjUn9zIqkFvD54c/HsG OdQAoIP9BPcwZTi/vWijCsYFrdCMsAFA =H6Fo -----END PGP SIGNATURE----- --ZaW/dtY/7oMe/vLp--