From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53144) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcSky-0000ip-AO for qemu-devel@nongnu.org; Tue, 14 May 2013 23:52:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcSku-0000y5-BV for qemu-devel@nongnu.org; Tue, 14 May 2013 23:52:00 -0400 Date: Wed, 15 May 2013 13:51:51 +1000 From: David Gibson Message-ID: <20130515035151.GQ14944@truffula.fritz.box> References: <1368522837-20747-1-git-send-email-david@gibson.dropbear.id.au> <1368522837-20747-10-git-send-email-david@gibson.dropbear.id.au> <1368550415.5520.117.camel@ul30vt.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="80Ds8Z/hZmemMosa" Content-Disposition: inline In-Reply-To: <1368550415.5520.117.camel@ul30vt.home> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 09/11] memory: Add iova to IOMMUTLBEntry List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: pbonzini@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, mst@redhat.com --80Ds8Z/hZmemMosa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 14, 2013 at 10:53:35AM -0600, Alex Williamson wrote: > On Tue, 2013-05-14 at 19:13 +1000, David Gibson wrote: > > Currently, the IOMMUTLBEntry structure contains the translated address, > > but not the IOVA (original untranslated address). We're going to need = it > > for upcoming changes, so add it in here, and populate it correctly in o= ur > > one existing iommu implementation. > >=20 > > Signed-off-by: David Gibson > > --- > > hw/ppc/spapr_iommu.c | 2 ++ > > include/exec/memory.h | 2 +- > > 2 files changed, 3 insertions(+), 1 deletion(-) > >=20 > > diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c > > index 90469b3..07a6307 100644 > > --- a/hw/ppc/spapr_iommu.c > > +++ b/hw/ppc/spapr_iommu.c > > @@ -80,6 +80,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(Memory= Region *iommu, hwaddr addr) > > =20 > > if (tcet->bypass) { > > return (IOMMUTLBEntry) { > > + .iova =3D 0, > > .translated_addr =3D 0, > > .addr_mask =3D ~(hwaddr)0, > > .perm =3D { true, true }, > > @@ -102,6 +103,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(Memo= ryRegion *iommu, hwaddr addr) > > #endif > > =20 > > return (IOMMUTLBEntry) { > > + .iova =3D addr & ~SPAPR_TCE_PAGE_MASK, > > .translated_addr =3D tce & ~SPAPR_TCE_PAGE_MASK, > > .addr_mask =3D SPAPR_TCE_PAGE_MASK, > > .perm =3D { [0] =3D tce & SPAPR_TCE_RO, [1] =3D tce & SPAPR_TC= E_WO }, > > diff --git a/include/exec/memory.h b/include/exec/memory.h > > index b97ace7..cd33439 100644 > > --- a/include/exec/memory.h > > +++ b/include/exec/memory.h > > @@ -116,7 +116,7 @@ typedef struct IOMMUTLBEntry IOMMUTLBEntry; > > typedef struct MemoryRegionIOMMUOps MemoryRegionIOMMUOps; > > =20 > > struct IOMMUTLBEntry { > > - hwaddr translated_addr; > > + hwaddr iova, translated_addr; >=20 > Being a struct definition, I assume we'd want to keep these on separate > lines for clarity (and preferably comments). Good idea, adjusted accordingly. --=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 --80Ds8Z/hZmemMosa Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlGTBlcACgkQaILKxv3ab8bQXQCfQTuAkt6U6G5LdLAIhtROPzsb 740AoJJHmIXnekKLj7Zivkp0R45qAeHd =Dyj8 -----END PGP SIGNATURE----- --80Ds8Z/hZmemMosa--