diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-06-20 16:53:39 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-06-20 16:53:39 -0500 |
commit | 576156ffed72ab4feb0b752979db86ff8759a2a1 (patch) | |
tree | 840956ef1f6138f7a0be8d497f8baad6a31d7722 /hw/ppc/spapr_pci.c | |
parent | b1588c3fd6daf6e23ba727c758f84ada279ae731 (diff) | |
parent | 2eb74e1a1ef145034aa41255c4a6f469d560c96d (diff) |
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
# By Paolo Bonzini (12) and others
# Via Paolo Bonzini
* bonzini/iommu-for-anthony: (25 commits)
memory: render_memory_region: factor out fr constant setters
memory: as_update_topology_pass: Improve comments
memory: Fix comment typo
memory: give name to every AddressSpace
dma: eliminate DMAContext
spapr_vio: take care of creating our own AddressSpace/DMAContext
pci: use memory core for iommu support
dma: eliminate old-style IOMMU support
spapr: use memory core for iommu support
spapr: make IOMMU translation go through IOMMUTLBEntry
spapr: convert TCE API to use an opaque type
vfio: abort if an emulated iommu is used
memory: Add iommu map/unmap notifiers
memory: iommu support
memory: make section size a 128-bit integer
exec: reorganize mem_add to match Int128 version
Revert "s390x: reduce TARGET_PHYS_ADDR_SPACE_BITS to 62"
Revert "memory: limit sections in the radix tree to the actual address space size"
exec: return MemoryRegion from address_space_translate
exec: Implement subpage_read/write via address_space_rw
...
Message-id: 1371739493-10187-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ppc/spapr_pci.c')
-rw-r--r-- | hw/ppc/spapr_pci.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 62ff323f73..04e836257c 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 phb->dma; + return &phb->iommu_as; } static int spapr_phb_init(SysBusDevice *s) @@ -646,12 +645,15 @@ static int spapr_phb_init(SysBusDevice *s) sphb->dma_window_start = 0; sphb->dma_window_size = 0x40000000; - sphb->dma = spapr_tce_new_dma_context(sphb->dma_liobn, sphb->dma_window_size); - if (!sphb->dma) { + sphb->tcet = spapr_tce_new_table(sphb->dma_liobn, sphb->dma_window_size); + if (!sphb->tcet) { 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), + sphb->dtbusname); + + pci_setup_iommu(bus, spapr_pci_dma_iommu, sphb); QLIST_INSERT_HEAD(&spapr->phbs, sphb, list); @@ -676,7 +678,7 @@ static void spapr_phb_reset(DeviceState *qdev) sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(s); /* Reset the IOMMU state */ - spapr_tce_reset(sphb->dma); + spapr_tce_reset(sphb->tcet); } static Property spapr_phb_properties[] = { |