aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x/s390-pci-bus.h
diff options
context:
space:
mode:
authorYi Min Zhao <zyimin@linux.vnet.ibm.com>2016-12-08 13:03:18 +0800
committerCornelia Huck <cornelia.huck@de.ibm.com>2017-01-20 10:01:18 +0100
commit03805be08195fca358b12dacc26370f8d1b2c27b (patch)
treee594e55fe2140114975efd16f6d1c1aa6d61076e /hw/s390x/s390-pci-bus.h
parentde91ea92e9082609dc413f0109abc77283b4ff0a (diff)
s390x/pci: dynamically allocate iommu
When initializing a PCI device, an address space is required during PCI core initialization and before the call to the embedding object hotplug callback. To provide this AS, we allocate a S390PCIIOMMU object containing this AS. Initialization of S390PCIIOMMU object is done before the PCI device is completely created. So that we cannot associate the IOMMU with the device at the moment. To track the IOMMU object, we use g_hash functions with the PCI device's bus address as a key to provide an array of pointers indexed by the PCI device's devfn to the allocated IOMMU. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x/s390-pci-bus.h')
-rw-r--r--hw/s390x/s390-pci-bus.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h
index 1d05c1a92e..fe108e9330 100644
--- a/hw/s390x/s390-pci-bus.h
+++ b/hw/s390x/s390-pci-bus.h
@@ -274,6 +274,11 @@ typedef struct S390PCIIOMMU {
uint64_t pal;
} S390PCIIOMMU;
+typedef struct S390PCIIOMMUTable {
+ uint64_t key;
+ S390PCIIOMMU *iommu[PCI_SLOT_MAX];
+} S390PCIIOMMUTable;
+
typedef struct S390PCIBusDevice {
DeviceState qdev;
PCIDevice *pdev;
@@ -304,7 +309,7 @@ typedef struct S390pciState {
PCIHostState parent_obj;
S390PCIBus *bus;
S390PCIBusDevice *pbdev[PCI_SLOT_MAX];
- S390PCIIOMMU *iommu[PCI_SLOT_MAX];
+ GHashTable *iommu_table;
QTAILQ_HEAD(, SeiContainer) pending_sei;
} S390pciState;