aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi/pci-bridge.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2023-03-02 17:15:41 +0100
committerMichael S. Tsirkin <mst@redhat.com>2023-03-07 12:39:00 -0500
commit02c106139a5c01a5668246c748939b5a4bb0c467 (patch)
tree41a4ccde6fdbc308674cfaf4a13840dc7d43e70c /hw/acpi/pci-bridge.c
parent62dd55fcf736994958eb5706cee5806480acfe25 (diff)
acpi: pci: move out ACPI PCI hotplug generator from generic slot generator build_append_pci_bus_devices()
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230302161543.286002-33-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/acpi/pci-bridge.c')
-rw-r--r--hw/acpi/pci-bridge.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/hw/acpi/pci-bridge.c b/hw/acpi/pci-bridge.c
index 4fbf6da6ad..7baa7034a1 100644
--- a/hw/acpi/pci-bridge.c
+++ b/hw/acpi/pci-bridge.c
@@ -22,6 +22,16 @@ void build_pci_bridge_aml(AcpiDevAmlIf *adev, Aml *scope)
PCIBridge *br = PCI_BRIDGE(adev);
if (!DEVICE(br)->hotplugged) {
- build_append_pci_bus_devices(scope, pci_bridge_get_sec_bus(br));
+ PCIBus *sec_bus = pci_bridge_get_sec_bus(br);
+
+ build_append_pci_bus_devices(scope, sec_bus);
+
+ /*
+ * generate hotplug slots descriptors if
+ * bridge has ACPI PCI hotplug attached,
+ */
+ if (object_property_find(OBJECT(sec_bus), ACPI_PCIHP_PROP_BSEL)) {
+ build_append_pcihp_slots(scope, sec_bus);
+ }
}
}