From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnEe5-0005gn-IO for qemu-devel@nongnu.org; Wed, 21 May 2014 18:06:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnEdz-0004bb-7e for qemu-devel@nongnu.org; Wed, 21 May 2014 18:05:57 -0400 Message-ID: <537D233C.2050909@suse.de> Date: Thu, 22 May 2014 00:05:48 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1400682080-30724-1-git-send-email-aik@ozlabs.ru> <1400682080-30724-8-git-send-email-aik@ozlabs.ru> In-Reply-To: <1400682080-30724-8-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/9] spapr_iommu: Get rid of window_size in sPAPRTCETable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org On 21.05.14 16:21, Alexey Kardashevskiy wrote: > This removes window_size as it is basically a copy of nb_table > shifted by SPAPR_TCE_PAGE_SHIFT. As new dynamic DMA windows are > going to support windows as big as the entire RAM and this number > will be bigger that 32 capacity, we will have to do something > about @window_size anyway and removal seems to be the right way to go. > > This removes dma_window_start/dma_window_size from sPAPRPHBState as > they are no longer used. > > Signed-off-by: Alexey Kardashevskiy > --- > hw/ppc/spapr_iommu.c | 41 +++++++++++++++-------------------------- > hw/ppc/spapr_pci.c | 6 ++---- > hw/ppc/spapr_vio.c | 4 +++- > include/hw/pci-host/spapr.h | 2 -- > include/hw/ppc/spapr.h | 3 +-- > target-ppc/kvm.c | 4 ++-- > target-ppc/kvm_ppc.h | 2 +- > 7 files changed, 24 insertions(+), 38 deletions(-) > > diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c > index 0dd6509..90de3e3 100644 > --- a/hw/ppc/spapr_iommu.c > +++ b/hw/ppc/spapr_iommu.c > @@ -70,7 +70,7 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(MemoryRegion *iommu, hwaddr addr) > > if (tcet->bypass) { > ret.perm = IOMMU_RW; > - } else if (addr < tcet->window_size) { > + } else if ((addr >> SPAPR_TCE_PAGE_SHIFT) < tcet->nb_table) { > /* Check if we are in bound */ > tce = tcet->table[addr >> SPAPR_TCE_PAGE_SHIFT]; > ret.iova = addr & ~SPAPR_TCE_PAGE_MASK; > @@ -84,25 +84,15 @@ static IOMMUTLBEntry spapr_tce_translate_iommu(MemoryRegion *iommu, hwaddr addr) > return ret; > } > > -static int spapr_tce_table_pre_load(void *opaque) > -{ > - sPAPRTCETable *tcet = SPAPR_TCE_TABLE(opaque); > - > - tcet->nb_table = tcet->window_size >> SPAPR_TCE_PAGE_SHIFT; > - > - return 0; > -} > - > static const VMStateDescription vmstate_spapr_tce_table = { > .name = "spapr_iommu", > - .version_id = 1, > + .version_id = 2, > .minimum_version_id = 1, Doesn't this have to become 2 as well? Alex