From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UcMgP-0007Um-Eb for qemu-devel@nongnu.org; Tue, 14 May 2013 17:22:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UcMgO-0001wC-CJ for qemu-devel@nongnu.org; Tue, 14 May 2013 17:22:53 -0400 Sender: Paolo Bonzini Message-ID: <5192AB22.9080500@redhat.com> Date: Tue, 14 May 2013 23:22:42 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1368522837-20747-1-git-send-email-david@gibson.dropbear.id.au> <1368522837-20747-10-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1368522837-20747-10-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/11] memory: Add iova to IOMMUTLBEntry List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: aik@ozlabs.ru, alex.williamson@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, mst@redhat.com Il 14/05/2013 11:13, David Gibson ha scritto: > 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 our > one existing iommu implementation. > > Signed-off-by: David Gibson > --- > hw/ppc/spapr_iommu.c | 2 ++ > include/exec/memory.h | 2 +- > 2 files changed, 3 insertions(+), 1 deletion(-) > > 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(MemoryRegion *iommu, hwaddr addr) > > if (tcet->bypass) { > return (IOMMUTLBEntry) { > + .iova = 0, > .translated_addr = 0, > .addr_mask = ~(hwaddr)0, > .perm = { true, true }, > @@ -102,6 +103,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(MemoryRegion *iommu, hwaddr addr) > #endif > > return (IOMMUTLBEntry) { > + .iova = addr & ~SPAPR_TCE_PAGE_MASK, > .translated_addr = tce & ~SPAPR_TCE_PAGE_MASK, > .addr_mask = SPAPR_TCE_PAGE_MASK, > .perm = { [0] = tce & SPAPR_TCE_RO, [1] = tce & SPAPR_TCE_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; > > struct IOMMUTLBEntry { > - hwaddr translated_addr; > + hwaddr iova, translated_addr; > hwaddr addr_mask; /* 0xfff = 4k translation */ > bool perm[2]; /* permissions, [0] for read, [1] for write */ > }; > Split and squashed into various patches of my iommu tree. Paolo