summaryrefslogtreecommitdiff
path: root/hw/s390x/s390-pci-bus.h
diff options
context:
space:
mode:
authorYi Min Zhao <zyimin@linux.vnet.ibm.com>2016-05-11 15:10:36 +0800
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-07-11 09:48:05 +0200
commit67d5cd9722b230027d3d4267ae6069c5d8a65463 (patch)
tree2abba345f34b917108721ef936cd1ab58aa6a0a4 /hw/s390x/s390-pci-bus.h
parent90a0f9afec5e148065f4f48b9dbe4422b0bfd131 (diff)
downloadqemu-67d5cd9722b230027d3d4267ae6069c5d8a65463.tar.gz
s390x/pci: introduce S390PCIIOMMU
Currently each zpci device holds its own DMA address space and memory region. At the same time, all instances of zpci device are stored in S390pciState. So duirng the initialization of S390pciState, all zpci devices are created and then all DMA address spaces are created. Thus, when initializing pci devices, their corresponding DMA address spaces could be found. But zpci qdev will be introduced later. Zpci device may be initialized and plugged afterwards generic pci device. So we should initialize all DMA address spaces and memory regions before initializing zpci devices. We introduce a new struct named S390PCIIOMMU. And a new field of S390pciState, which is an array to store all instances of S390PCIIOMMU, is added so that qemu pci code could find the corresponding DMA address space when initializing a generic pci device. And this should be done before the connection of a zpci device and a generic pci device is built. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Acked-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.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h
index c4d40794de..ea1efcc0a0 100644
--- a/hw/s390x/s390-pci-bus.h
+++ b/hw/s390x/s390-pci-bus.h
@@ -248,6 +248,11 @@ typedef struct S390MsixInfo {
uint32_t pba_offset;
} S390MsixInfo;
+typedef struct S390PCIIOMMU {
+ AddressSpace as;
+ MemoryRegion mr;
+} S390PCIIOMMU;
+
typedef struct S390PCIBusDevice {
PCIDevice *pdev;
ZpciState state;
@@ -263,8 +268,7 @@ typedef struct S390PCIBusDevice {
uint8_t sum;
S390MsixInfo msix;
AdapterRoutes routes;
- AddressSpace as;
- MemoryRegion mr;
+ S390PCIIOMMU *iommu;
MemoryRegion iommu_mr;
IndAddr *summary_ind;
IndAddr *indicator;
@@ -278,6 +282,7 @@ typedef struct S390pciState {
PCIHostState parent_obj;
S390PCIBus *bus;
S390PCIBusDevice pbdev[PCI_SLOT_MAX];
+ S390PCIIOMMU *iommu[PCI_SLOT_MAX];
AddressSpace msix_notify_as;
MemoryRegion msix_notify_mr;
QTAILQ_HEAD(, SeiContainer) pending_sei;