[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 58/73] acpi: pci: move out ACPI PCI hotplug generator from generic
From: |
Michael S. Tsirkin |
Subject: |
[PULL 58/73] acpi: pci: move out ACPI PCI hotplug generator from generic slot generator build_append_pci_bus_devices() |
Date: |
Tue, 7 Mar 2023 20:13:43 -0500 |
From: Igor Mammedov <imammedo@redhat.com>
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>
---
include/hw/acpi/pcihp.h | 2 ++
hw/acpi/pci-bridge.c | 12 +++++++++++-
hw/i386/acpi-build.c | 9 ++++-----
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h
index 7e268c2c9c..cd18ebdcdc 100644
--- a/include/hw/acpi/pcihp.h
+++ b/include/hw/acpi/pcihp.h
@@ -71,6 +71,8 @@ void acpi_pcihp_device_unplug_request_cb(HotplugHandler
*hotplug_dev,
/* Called on reset */
void acpi_pcihp_reset(AcpiPciHpState *s, bool acpihp_root_off);
+void build_append_pcihp_slots(Aml *parent_scope, PCIBus *bus);
+
extern const VMStateDescription vmstate_acpi_pcihp_pci_status;
#define VMSTATE_PCI_HOTPLUG(pcihp, state, test_pcihp, test_acpi_index) \
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);
+ }
}
}
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 0459acfbb4..ec857a117e 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -520,7 +520,7 @@ static bool is_devfn_ignored_hotplug(const int devfn, const
PCIBus *bus)
return false;
}
-static void build_append_pcihp_slots(Aml *parent_scope, PCIBus *bus)
+void build_append_pcihp_slots(Aml *parent_scope, PCIBus *bus)
{
int devfn;
Aml *dev, *notify_method = NULL, *method;
@@ -599,10 +599,6 @@ void build_append_pci_bus_devices(Aml *parent_scope,
PCIBus *bus)
/* device descriptor has been composed, add it into parent context */
aml_append(parent_scope, dev);
}
-
- if (object_property_find(OBJECT(bus), ACPI_PCIHP_PROP_BSEL)) {
- build_append_pcihp_slots(parent_scope, bus);
- }
}
static bool build_append_notfication_callback(Aml *parent_scope,
@@ -1790,6 +1786,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
Aml *scope = aml_scope("PCI0");
/* Scan all PCI buses. Generate tables to support hotplug. */
build_append_pci_bus_devices(scope, bus);
+ if (object_property_find(OBJECT(bus), ACPI_PCIHP_PROP_BSEL)) {
+ build_append_pcihp_slots(scope, bus);
+ }
aml_append(sb_scope, scope);
}
}
--
MST
- [PULL 52/73] tests: acpi: whitelist DSDT before adding non-0 function device with acpi-index to testcases, (continued)
- [PULL 52/73] tests: acpi: whitelist DSDT before adding non-0 function device with acpi-index to testcases, Michael S. Tsirkin, 2023/03/07
- [PULL 54/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 53/73] tests: acpi: add non zero function device with acpi-index on non-hotpluggble bus, Michael S. Tsirkin, 2023/03/07
- [PULL 50/73] acpi: pci: describe all functions on populated slots, Michael S. Tsirkin, 2023/03/07
- [PULL 49/73] tests: acpi: whitelist DSDT before exposing non zero functions, Michael S. Tsirkin, 2023/03/07
- [PULL 55/73] pci: move acpi-index uniqueness check to generic PCI device code, Michael S. Tsirkin, 2023/03/07
- [PULL 51/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 56/73] acpi: pci: drop BSEL usage when deciding that device isn't hotpluggable, Michael S. Tsirkin, 2023/03/07
- [PULL 57/73] acpi: pci: move BSEL into build_append_pcihp_slots(), Michael S. Tsirkin, 2023/03/07
- [PULL 59/73] pcihp: move fields enabling hotplug into AcpiPciHpState, Michael S. Tsirkin, 2023/03/07
- [PULL 58/73] acpi: pci: move out ACPI PCI hotplug generator from generic slot generator build_append_pci_bus_devices(),
Michael S. Tsirkin <=
- [PULL 60/73] pcihp: add ACPI PCI hotplug specific is_hotpluggable_bus() callback, Michael S. Tsirkin, 2023/03/07
- [PULL 61/73] hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register, Michael S. Tsirkin, 2023/03/07
- [PULL 62/73] hw/pci/aer: Add missing routing for AER errors, Michael S. Tsirkin, 2023/03/07
- [PULL 63/73] hw/pci-bridge/cxl_root_port: Wire up AER, Michael S. Tsirkin, 2023/03/07
- [PULL 64/73] hw/pci-bridge/cxl_root_port: Wire up MSI, Michael S. Tsirkin, 2023/03/07
- [PULL 65/73] hw/mem/cxl-type3: Add AER extended capability, Michael S. Tsirkin, 2023/03/07
- [PULL 66/73] hw/cxl: Fix endian issues in CXL RAS capability defaults / masks, Michael S. Tsirkin, 2023/03/07
- [PULL 67/73] hw/pci/aer: Make PCIE AER error injection facility available for other emulation to use., Michael S. Tsirkin, 2023/03/07
- [PULL 68/73] hw/mem/cxl_type3: Add CXL RAS Error Injection Support., Michael S. Tsirkin, 2023/03/07
- [PULL 69/73] hw/pci: Add pcie_count_ds_port() and pcie_find_port_first() helpers, Michael S. Tsirkin, 2023/03/07