When initializing the PCI-bus master pci_init_bus_master(PCIDevice *) calls pci_device_iommu_address_space(PCIDevice *) which in turn calls iommu_bus->iommu_fn(bus, opaque,devfn)
If the device entry of the PCI-bus is not initialized to point to the PCIDevice structure, the iommu_fn() function, getting only bus and devno, is unable to retrieve the PCIDevice. Usually it is not a problem as the DMA address space is depending of the BUS but in an architecture like S390x, each PCI Device can have its own DMA address space. Being able to setup the DMA address space at the right moment will greatly simplify the hotplug implementation for these architectures. This patch proposes to setup the bus device entry before calling pci_init_bus_master() and reset the entry in case of error. Pierre Morel (1): pci: Set PCI-bus device entry before initializing bus master hw/pci/pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4