[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 28/56] pcihp: drop pcihp_bridge_en dependency when composing PCNT
From: |
Michael S. Tsirkin |
Subject: |
[PULL 28/56] pcihp: drop pcihp_bridge_en dependency when composing PCNT method |
Date: |
Mon, 30 Jan 2023 15:20:15 -0500 |
From: Igor Mammedov <imammedo@redhat.com>
.. and use only BSEL presence to decide on how PCNT should be composed.
That simplifies possible combinations to consider, but mainly it makes
PCIHP AML be governed only by BSEL, which is property of PCIBus
(aka part of bridge) and as result it opens possibility to convert
build_append_pci_bus_devices() into AcpiDevAmlIf::build_dev_aml
callback to make bridges self describing.
PS:
used approach leaves unused PCNT, when ACPI hotplug is completely
disabled but that's harmless and followup commits will get rid of
it later.
Scope (PCI0)
...
Method (PCNT, 0, NotSerialized)
{
}
...
}
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20230112140312.3096331-19-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 | 53 ++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 29 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 1c51ab01fc..27f2cc4180 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -494,39 +494,34 @@ static void build_append_pci_bus_devices(Aml
*parent_scope, PCIBus *bus,
aml_append(parent_scope, notify_method);
}
- /* Append PCNT method to notify about events on local and child buses.
- * Add this method for root bus only when hotplug is enabled since DSDT
- * expects it.
+ /*
+ * Append PCNT method to notify about events on local and child buses.
*/
- if (bsel || pcihp_bridge_en) {
- method = aml_method("PCNT", 0, AML_NOTSERIALIZED);
+ method = aml_method("PCNT", 0, AML_NOTSERIALIZED);
- /* If bus supports hotplug select it and notify about local events */
- if (bsel) {
- uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
+ /* If bus supports hotplug select it and notify about local events */
+ if (bsel) {
+ uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
- aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
- aml_append(method, aml_call2("DVNT", aml_name("PCIU"),
- aml_int(1))); /* Device Check */
- aml_append(method, aml_call2("DVNT", aml_name("PCID"),
- aml_int(3))); /* Eject Request */
- }
-
- /* Notify about child bus events in any case */
- if (pcihp_bridge_en) {
- QLIST_FOREACH(sec, &bus->child, sibling) {
- if (pci_bus_is_root(sec) ||
- !object_property_find(OBJECT(sec), ACPI_PCIHP_PROP_BSEL)) {
- continue;
- }
-
- aml_append(method, aml_name("^S%.02X.PCNT",
- sec->parent_dev->devfn));
- }
- }
-
- aml_append(parent_scope, method);
+ aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
+ aml_append(method, aml_call2("DVNT", aml_name("PCIU"),
+ aml_int(1))); /* Device Check */
+ aml_append(method, aml_call2("DVNT", aml_name("PCID"),
+ aml_int(3))); /* Eject Request */
}
+
+ /* Notify about child bus events in any case */
+ QLIST_FOREACH(sec, &bus->child, sibling) {
+ if (pci_bus_is_root(sec) ||
+ !object_property_find(OBJECT(sec), ACPI_PCIHP_PROP_BSEL)) {
+ continue;
+ }
+
+ aml_append(method, aml_name("^S%.02X.PCNT", sec->parent_dev->devfn));
+ }
+
+ aml_append(parent_scope, method);
+
qobject_unref(bsel);
}
--
MST
- [PULL 17/56] pci_bridge: remove whitespace, (continued)
- [PULL 17/56] pci_bridge: remove whitespace, Michael S. Tsirkin, 2023/01/30
- [PULL 16/56] tests: acpi: cleanup use_uefi argument usage, Michael S. Tsirkin, 2023/01/30
- [PULL 20/56] pcihp: piix4: do not call acpi_pcihp_reset() when ACPI PCI hotplug is disabled, Michael S. Tsirkin, 2023/01/30
- [PULL 01/56] shpc: disallow unplug when power indicator is blinking, Michael S. Tsirkin, 2023/01/30
- [PULL 18/56] x86: acpi: pcihp: clean up duplicate bridge_in_acpi assignment, Michael S. Tsirkin, 2023/01/30
- [PULL 19/56] pci: acpi hotplug: rename x-native-hotplug to x-do-not-expose-native-hotplug-cap, Michael S. Tsirkin, 2023/01/30
- [PULL 24/56] tests: acpi: extend bridge tests with hotplugged bridges, Michael S. Tsirkin, 2023/01/30
- [PULL 22/56] x86: pcihp: fix invalid AML PCNT calls to hotplugged bridges, Michael S. Tsirkin, 2023/01/30
- [PULL 23/56] tests: boot_sector_test: avoid crashing if status is not available yet, Michael S. Tsirkin, 2023/01/30
- [PULL 11/56] tests: qtest: print device_add error before failing test, Michael S. Tsirkin, 2023/01/30
- [PULL 28/56] pcihp: drop pcihp_bridge_en dependency when composing PCNT method,
Michael S. Tsirkin <=
- [PULL 27/56] tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug machinery, Michael S. Tsirkin, 2023/01/30
- [PULL 29/56] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/01/30
- [PULL 21/56] pci: acpihp: assign BSEL only to coldplugged bridges, Michael S. Tsirkin, 2023/01/30
- [PULL 30/56] tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug machinery, Michael S. Tsirkin, 2023/01/30
- [PULL 31/56] pcihp: compose PCNT callchain right before its user _GPE._E01, Michael S. Tsirkin, 2023/01/30
- [PULL 33/56] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/01/30
- [PULL 38/56] pci: acpi: wire up AcpiDevAmlIf interface to generic bridge, Michael S. Tsirkin, 2023/01/30
- [PULL 35/56] tests: acpi: add endpoint devices to bridges, Michael S. Tsirkin, 2023/01/30
- [PULL 26/56] tests: acpi: add reboot cycle to bridge test, Michael S. Tsirkin, 2023/01/30
- [PULL 55/56] Revert "vhost-user: Introduce nested event loop in vhost_user_read()", Michael S. Tsirkin, 2023/01/30