diff options
author | Avi Kivity <avi.kivity@gmail.com> | 2012-10-30 13:47:48 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-06-20 16:32:47 +0200 |
commit | e00387d58243d4ae24ac68008a2aea76313ab997 (patch) | |
tree | 4ddf35610b30e5f3a5a063c66dc8d539e34abf79 /hw/ppc/spapr_pci.c | |
parent | 24addbc76dcbb1d1c85b3062bbf7a030831cc7a9 (diff) | |
download | qemu-e00387d58243d4ae24ac68008a2aea76313ab997.zip |
pci: use memory core for iommu support
Use the new iommu support in the memory core for iommu support. The only
user, spapr, is also converted, but it still provides a DMAContext
interface until the non-PCI bits switch to AddressSpace.
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Avi Kivity <avi.kivity@gmail.com>
[ Do not calls memory_region_del_subregion() on the device's
bus_master_enable_region, it is an alias; return an AddressSpace
from the IOMMU hook and remove the destructor hook. - David Gibson ]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ppc/spapr_pci.c')
-rw-r--r-- | hw/ppc/spapr_pci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index eb64a8f997..459398c1e5 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -506,12 +506,11 @@ static const MemoryRegionOps spapr_msi_ops = { /* * PHB PCI device */ -static DMAContext *spapr_pci_dma_context_fn(PCIBus *bus, void *opaque, - int devfn) +static AddressSpace *spapr_pci_dma_iommu(PCIBus *bus, void *opaque, int devfn) { sPAPRPHBState *phb = opaque; - return spapr_tce_get_dma(phb->tcet); + return &phb->iommu_as; } static int spapr_phb_init(SysBusDevice *s) @@ -651,7 +650,8 @@ static int spapr_phb_init(SysBusDevice *s) fprintf(stderr, "Unable to create TCE table for %s\n", sphb->dtbusname); return -1; } - pci_setup_iommu(bus, spapr_pci_dma_context_fn, sphb); + address_space_init(&sphb->iommu_as, spapr_tce_get_iommu(sphb->tcet)); + pci_setup_iommu(bus, spapr_pci_dma_iommu, sphb); QLIST_INSERT_HEAD(&spapr->phbs, sphb, list); |