qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 7/9] spapr_iommu: Get rid of window_size in sPAP


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 7/9] spapr_iommu: Get rid of window_size in sPAPRTCETable
Date: Thu, 22 May 2014 00:05:48 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0


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 <address@hidden>
---
  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]