diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-04-11 12:38:50 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-06-20 16:32:48 +0200 |
commit | 96478592a93f93322ecc20d0a6eccb4d4ef33c7a (patch) | |
tree | fb82480c4492f6d617494b5b4a88d19128dcd195 /hw/ppc/spapr_vio.c | |
parent | e00387d58243d4ae24ac68008a2aea76313ab997 (diff) |
spapr_vio: take care of creating our own AddressSpace/DMAContext
Fetch the root region from the sPAPRTCETable, and use it to build
an AddressSpace and DMAContext.
Now, everywhere we have a DMAContext we also have access to the
corresponding AddressSpace (either because we create it just before
the DMAContext, or because dma_context_memory's AddressSpace is
trivially address_space_memory).
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ppc/spapr_vio.c')
-rw-r--r-- | hw/ppc/spapr_vio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index ae906a74a6..09cda646b0 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -454,7 +454,8 @@ static int spapr_vio_busdev_init(DeviceState *qdev) if (pc->rtce_window_size) { uint32_t liobn = SPAPR_VIO_BASE_LIOBN | dev->reg; dev->tcet = spapr_tce_new_table(liobn, pc->rtce_window_size); - dev->dma = spapr_tce_get_dma(dev->tcet); + address_space_init(&dev->as, spapr_tce_get_iommu(dev->tcet)); + dma_context_init(&dev->dma, &dev->as); } return pc->init(dev); |