This series overrides one previous patchset: https://lore.kernel.org/qemu-devel/20210818194217.110451-1-pet...@redhat.com/
I started from v1 because obviously it's completely different way of doing the same thing, hence versioning upon it would be weird. Patches 1-7 are majorly cleanups for current pci code to finally provide a clean way to loop over all the pci devices on the system. Patch 8 uses the last helper pci_for_each_device_all() to loop over all the devices during x86 vIOMMU realize() function to fail early if e.g. vfio-pci devices are detected. Although this is not exactly what Igor suggested but it should be mostly the same approach, so I kept the Suggested-by credit. Please review, thanks. Peter Xu (8): pci: Define pci_bus_dev_fn type pci: Export pci_for_each_device_under_bus*() pci: Use pci_for_each_device_under_bus*() pci: Define pci_bus_fn/pci_bus_ret_fn type pci: Add pci_for_each_root_bus() pci: Use pci_for_each_root_bus() in current code pci: Add pci_for_each_device_all() x86-iommu: Fail early if vIOMMU specified after vfio-pci hw/arm/virt-acpi-build.c | 31 ++++++--------- hw/i386/acpi-build.c | 39 +++++-------------- hw/i386/x86-iommu.c | 18 +++++++++ hw/pci/pci.c | 77 +++++++++++++++++++++++++++++--------- hw/pci/pcie.c | 4 +- hw/ppc/spapr_pci.c | 12 +++--- hw/ppc/spapr_pci_nvlink2.c | 7 ++-- hw/ppc/spapr_pci_vfio.c | 4 +- hw/s390x/s390-pci-bus.c | 5 +-- hw/xen/xen_pt.c | 4 +- include/hw/pci/pci.h | 28 +++++++++----- 11 files changed, 132 insertions(+), 97 deletions(-) -- 2.32.0