[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/33] x86: pcihp: fix missing bridge AML when intermediate root-
From: |
Igor Mammedov |
Subject: |
[PATCH 08/33] x86: pcihp: fix missing bridge AML when intermediate root-port has 'hotplug=off' set |
Date: |
Fri, 24 Feb 2023 16:37:47 +0100 |
(I practice [1] hasn't broke anything since on hardware side we unset
hotplug_handler on such intermediate port => hotplug behind it has
never worked)
When deciding if bridge should be described, the original
condition was
cold_plugged_bridge && pcihp_bridge_en
which was replaced [1] by
bridge has ACPI_PCIHP_PROP_BSEL
the later however is not the same thing as the original
and flips to false if intermediate bridge has hotplug
turned off (root-port with 'hotplug=off' option).
Since we already in build_pci_bridge_aml(), the question
if it's bridge is answered. Use DeviceState::hotplugged
to make decision if bridge should describe its slots.
What's left out is pcihp_bridge_en, which tells us if
ACPI bridge hotplug is enabled.
With hotplug and non hotplug part now being mostly
separated, omitting this check will only lead to
colplugged bridges describe occupied slots in case
when ACPI bridge hotplug is disabled.
Which makes behavior consistent with occupied slots
on hostbridge.
Ex (pc/DSDT.hpbrroot diff):
...
Device (S20)
{
Name (_ADR, 0x00040000) // _ADR: Address
+ Device (S08)
+ {
+ Name (_ADR, 0x00010000) // _ADR: Address
+ }
+
+ Device (S10)
+ {
+ Name (_ADR, 0x00020000) // _ADR: Address
+ }
}
...
PS:
testing shows that above doesn't affect adversely guest OS
behavior: i.e. if ACPI bridge hotplug is enabled it's
expected behaviour, and with ACPI bridge hotplug is disabled
(a.k. native hotplug), it doesn't break slot enumeration
nor native hotplug. (tested with RHEL9.0 and WS2022).
1)
Fixes: 6c36ec46b0d ("pcihp: make bridge describe itself using
AcpiDevAmlIfClass:build_dev_aml")
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/acpi/pci-bridge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/acpi/pci-bridge.c b/hw/acpi/pci-bridge.c
index 5f3ee5157f..4fbf6da6ad 100644
--- a/hw/acpi/pci-bridge.c
+++ b/hw/acpi/pci-bridge.c
@@ -21,7 +21,7 @@ void build_pci_bridge_aml(AcpiDevAmlIf *adev, Aml *scope)
{
PCIBridge *br = PCI_BRIDGE(adev);
- if (object_property_find(OBJECT(&br->sec_bus), ACPI_PCIHP_PROP_BSEL)) {
+ if (!DEVICE(br)->hotplugged) {
build_append_pci_bus_devices(scope, pci_bridge_get_sec_bus(br));
}
}
--
2.39.1
- [PATCH 00/33] pci(pc/q35): acpi-index support on non-hotpluggable slots, Igor Mammedov, 2023/02/24
- [PATCH 05/33] tests: acpi: extend multi-bridge case with case 'root-port, id=HOHP, hotplug=off root-port, bus=NOHP', Igor Mammedov, 2023/02/24
- [PATCH 02/33] tests: acpi: add test_acpi_q35_tcg_no_acpi_hotplug test and extend test_acpi_piix4_no_acpi_pci_hotplug, Igor Mammedov, 2023/02/24
- [PATCH 01/33] tests: acpi: whitelist new q35.noacpihp test and pc.hpbrroot, Igor Mammedov, 2023/02/24
- [PATCH 03/33] tests: acpi: update expected blobs, Igor Mammedov, 2023/02/24
- [PATCH 08/33] x86: pcihp: fix missing bridge AML when intermediate root-port has 'hotplug=off' set,
Igor Mammedov <=
- [PATCH 12/33] tests: acpi: whitelist DSDT blobs before isolating PCI _DSM func 0 prolog, Igor Mammedov, 2023/02/24
- [PATCH 15/33] tests: acpi: whitelist DSDT before adding EDSM method, Igor Mammedov, 2023/02/24
- [PATCH 14/33] tests: acpi: update expected blobs, Igor Mammedov, 2023/02/24
- [PATCH 16/33] acpi: pci: add EDSM method to DSDT, Igor Mammedov, 2023/02/24
- [PATCH 18/33] tests: acpi: whitelist DSDT before adding device with acpi-index to testcases, Igor Mammedov, 2023/02/24
- [PATCH 17/33] tests: acpi: update expected blobs, Igor Mammedov, 2023/02/24
- [PATCH 09/33] tests: acpi: update expected blobs, Igor Mammedov, 2023/02/24
- [PATCH 04/33] tests: acpi: whitelist q35/DSDT.multi-bridge before extending testcase, Igor Mammedov, 2023/02/24
- [PATCH 06/33] x86: pcihp: fix missing PCNT callchain when intermediate root-port has 'hotplug=off' set, Igor Mammedov, 2023/02/24
- [PATCH 07/33] tests: acpi: whitelist pc/DSDT.hpbrroot and pc/DSDT.hpbridge tests, Igor Mammedov, 2023/02/24