[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 57/73] acpi: pci: move BSEL into build_append_pcihp_slots()
From: |
Michael S. Tsirkin |
Subject: |
[PULL 57/73] acpi: pci: move BSEL into build_append_pcihp_slots() |
Date: |
Tue, 7 Mar 2023 20:13:40 -0500 |
From: Igor Mammedov <imammedo@redhat.com>
Generic PCI enumeration code doesn't really need access to
BSEL value, it is only used as means to decide if hotplug
enumerator should be called.
Use stateless object_property_find() to do that, and move
the rest of BSEL handling into build_append_pcihp_slots()
where it belongs.
This cleans up generic code a bit from hotplug stuff
and follow up patch will remove remaining call to
build_append_pcihp_slots() from generic code, making
it possible to use without ACPI PCI hotplug dependencies.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20230302161543.286002-32-imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/i386/acpi-build.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index ce14866eda..0459acfbb4 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -520,12 +520,14 @@ 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,
- QObject *bsel)
+static void build_append_pcihp_slots(Aml *parent_scope, PCIBus *bus)
{
int devfn;
Aml *dev, *notify_method = NULL, *method;
+ QObject *bsel = object_property_get_qobject(OBJECT(bus),
+ ACPI_PCIHP_PROP_BSEL, NULL);
uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
+ qobject_unref(bsel);
aml_append(parent_scope, aml_name_decl("BSEL", aml_int(bsel_val)));
notify_method = aml_method("DVNT", 2, AML_NOTSERIALIZED);
@@ -570,12 +572,9 @@ static void build_append_pcihp_slots(Aml *parent_scope,
PCIBus *bus,
void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus)
{
- QObject *bsel;
int devfn;
Aml *dev;
- bsel = object_property_get_qobject(OBJECT(bus), ACPI_PCIHP_PROP_BSEL,
NULL);
-
for (devfn = 0; devfn < ARRAY_SIZE(bus->devices); devfn++) {
/* ACPI spec: 1.0b: Table 6-2 _ADR Object Bus Types, PCI type */
int adr = PCI_SLOT(devfn) << 16 | PCI_FUNC(devfn);
@@ -601,11 +600,9 @@ void build_append_pci_bus_devices(Aml *parent_scope,
PCIBus *bus)
aml_append(parent_scope, dev);
}
- if (bsel) {
- build_append_pcihp_slots(parent_scope, bus, bsel);
+ if (object_property_find(OBJECT(bus), ACPI_PCIHP_PROP_BSEL)) {
+ build_append_pcihp_slots(parent_scope, bus);
}
-
- qobject_unref(bsel);
}
static bool build_append_notfication_callback(Aml *parent_scope,
--
MST
- [PULL 47/73] acpi: pci: support acpi-index for non-hotpluggable devices, (continued)
- [PULL 47/73] acpi: pci: support acpi-index for non-hotpluggable devices, Michael S. Tsirkin, 2023/03/07
- [PULL 48/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [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 <=
- [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, 2023/03/07
- [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