[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 33/73] x86: pcihp: fix missing PCNT callchain when intermediate ro
From: |
Michael S. Tsirkin |
Subject: |
[PULL 33/73] x86: pcihp: fix missing PCNT callchain when intermediate root-port has 'hotplug=off' set |
Date: |
Tue, 7 Mar 2023 20:12:28 -0500 |
From: Igor Mammedov <imammedo@redhat.com>
Beside BSEL numbers change (due to 2 extra root-ports in q35/miltibridge test),
following change is expected:
Scope (\_SB.PCI0)
{
...
+ Scope (S50)
+ {
+ Scope (S00)
+ {
+ Method (PCNT, 0, NotSerialized)
+ {
+ BNUM = Zero
+ DVNT (PCIU, One)
+ DVNT (PCID, 0x03)
+ }
+ }
+
+ Method (PCNT, 0, NotSerialized)
+ {
+ ^S00.PCNT
+ }
+ }
...
Method (PCNT, 0, NotSerialized)
{
+ ^S50.PCNT ()
^S13.PCNT ()
^S12.PCNT ()
^S11.PCNT ()
I practice [1] hasn't broke anything since on hardware side we unset
hotplug_handler on such intermediate port => hotplug behind it has
not been properly wired and as result not worked.
1)
Fixes: ddab4d3fae4e8 ("pcihp: compose PCNT callchain right before its user
_GPE._E01")
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20230302161543.286002-8-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 | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index b19fb4259e..c691104d47 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -517,16 +517,24 @@ static bool build_append_notfication_callback(Aml
*parent_scope,
PCIBus *sec;
QObject *bsel;
int nr_notifiers = 0;
+ GQueue *pcnt_bus_list = g_queue_new();
QLIST_FOREACH(sec, &bus->child, sibling) {
Aml *br_scope = aml_scope("S%.02X", sec->parent_dev->devfn);
- if (pci_bus_is_root(sec) ||
- !object_property_find(OBJECT(sec), ACPI_PCIHP_PROP_BSEL)) {
+ if (pci_bus_is_root(sec)) {
continue;
}
nr_notifiers = nr_notifiers +
build_append_notfication_callback(br_scope, sec);
- aml_append(parent_scope, br_scope);
+ /*
+ * add new child scope to parent
+ * and keep track of bus that have PCNT,
+ * bus list is used later to call children PCNTs from this level PCNT
+ */
+ if (nr_notifiers) {
+ g_queue_push_tail(pcnt_bus_list, sec);
+ aml_append(parent_scope, br_scope);
+ }
}
/*
@@ -550,17 +558,13 @@ static bool build_append_notfication_callback(Aml
*parent_scope,
}
/* 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;
- }
-
+ while ((sec = g_queue_pop_head(pcnt_bus_list))) {
aml_append(method, aml_name("^S%.02X.PCNT", sec->parent_dev->devfn));
}
aml_append(parent_scope, method);
qobject_unref(bsel);
+ g_queue_free(pcnt_bus_list);
return !!nr_notifiers;
}
--
MST
- [PULL 22/73] vdpa net: block migration if the device has CVQ, (continued)
- [PULL 22/73] vdpa net: block migration if the device has CVQ, Michael S. Tsirkin, 2023/03/07
- [PULL 24/73] vdpa: block migration if SVQ does not admit a feature, Michael S. Tsirkin, 2023/03/07
- [PULL 26/73] vdpa: return VHOST_F_LOG_ALL in vhost-vdpa devices, Michael S. Tsirkin, 2023/03/07
- [PULL 23/73] vdpa: block migration if device has unsupported features, Michael S. Tsirkin, 2023/03/07
- [PULL 28/73] tests: acpi: whitelist new q35.noacpihp test and pc.hpbrroot, Michael S. Tsirkin, 2023/03/07
- [PULL 29/73] tests: acpi: add test_acpi_q35_tcg_no_acpi_hotplug test and extend test_acpi_piix4_no_acpi_pci_hotplug, Michael S. Tsirkin, 2023/03/07
- [PULL 30/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 25/73] vdpa net: allow VHOST_F_LOG_ALL, Michael S. Tsirkin, 2023/03/07
- [PULL 27/73] Revert "tests/qtest: Check for devices in bios-tables-test", Michael S. Tsirkin, 2023/03/07
- [PULL 31/73] tests: acpi: whitelist q35/DSDT.multi-bridge before extending testcase, Michael S. Tsirkin, 2023/03/07
- [PULL 33/73] x86: pcihp: fix missing PCNT callchain when intermediate root-port has 'hotplug=off' set,
Michael S. Tsirkin <=
- [PULL 32/73] tests: acpi: extend multi-bridge case with case 'root-port,id=HOHP,hotplug=off root-port,bus=NOHP', Michael S. Tsirkin, 2023/03/07
- [PULL 34/73] tests: acpi: whitelist pc/DSDT.hpbrroot and pc/DSDT.hpbridge tests, Michael S. Tsirkin, 2023/03/07
- [PULL 35/73] x86: pcihp: fix missing bridge AML when intermediate root-port has 'hotplug=off' set, Michael S. Tsirkin, 2023/03/07
- [PULL 36/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 37/73] pcihp: piix4: do not redirect hotplug controller to piix4 when ACPI hotplug is disabled, Michael S. Tsirkin, 2023/03/07
- [PULL 38/73] pci: fix 'hotplugglable' property behavior, Michael S. Tsirkin, 2023/03/07
- [PULL 40/73] pcihp: move PCI _DSM function 0 prolog into separate function, Michael S. Tsirkin, 2023/03/07
- [PULL 39/73] tests: acpi: whitelist DSDT blobs before isolating PCI _DSM func 0 prolog, Michael S. Tsirkin, 2023/03/07
- [PULL 41/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 42/73] tests: acpi: whitelist DSDT before adding EDSM method, Michael S. Tsirkin, 2023/03/07