c2077e2c "pci: Adjust PCI config limit based on bus topology" introduced checking the availability of extended config space for PCI-E devices which are in a bus topology that doesn't permit extended config space access (e.g. under PCI-E to PCI then PCI to PCI-E bridges).
This caused some problems for the spapr para-virtual PCI bus which _does_ allow extended config space access, despite acting in most ways like a vanilla PCI bus. Greg Kurz made a fix for that which was merged as 1c685a90263 "pci: Allow PCI bus subtypes to support extended config space accesses". While that was an appropriate minimal fix for the 4.0 hard freeze, it was kind of a hack longer term. This series implements a simpler way of handling the extended config space permission, which works for both the normal and weird-PAPR cases. While we're there, we also make other small cleanups to the PCI code. Changes since v3: * Remove a redundant call to pci_find_bus_nr() found during review Changes since v2: * Add some minor additional cleanups (patches 4 & 5) * Minor whitespace tweak to patch 3 David Gibson (5): pcie: Remove redundant test in pcie_mmcfg_data_{read,write}() pci: Simplify pci_bus_is_root() pcie: Simplify pci_adjust_config_limit() pci: Make is_bridge a bool pci: Fold pci_get_bus_devfn() into its sole caller hw/pci-bridge/dec.c | 4 +- hw/pci-bridge/i82801b11.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 2 +- hw/pci-bridge/pci_expander_bridge.c | 6 -- hw/pci-bridge/pcie_pci_bridge.c | 2 +- hw/pci-bridge/pcie_root_port.c | 2 +- hw/pci-bridge/simba.c | 2 +- hw/pci-bridge/xio3130_downstream.c | 2 +- hw/pci-bridge/xio3130_upstream.c | 2 +- hw/pci/pci.c | 115 +++++++++++++--------------- hw/pci/pci_host.c | 13 +--- hw/pci/pcie_host.c | 10 --- hw/ppc/spapr_pci.c | 34 +++----- hw/virtio/virtio-pci.c | 1 + include/hw/pci/pci.h | 4 +- include/hw/pci/pci_bus.h | 20 ++++- 16 files changed, 95 insertions(+), 126 deletions(-) -- 2.21.0