[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/40] pci: acpi hotplug: rename x-native-hotplug to x-do-not-exp
From: |
Igor Mammedov |
Subject: |
[PATCH 09/40] pci: acpi hotplug: rename x-native-hotplug to x-do-not-expose-native-hotplug-cap |
Date: |
Thu, 12 Jan 2023 15:02:41 +0100 |
When ACPI PCI hotplug for Q35 was introduced (6.1), it was implemented
by hiding HPC capability on PCIE slot. That however led to a number of
regressions and to fix it, it was decided to keep HPC cap exposed
in ACPI PCI hotplug case and force guest in ACPI PCI hotplug mode
by other means [1].
That reduced meaning of x-native-hotplug to a compat knob [2] for
broken 6.1 machine type.
Rename property to match its current purpose.
1) 211afe5c69 (hw/i386/acpi-build: Deny control on PCIe Native Hot-plug in _OSC)
2) c318bef762 (hw/acpi/ich9: Add compat prop to keep HPC bit set for 6.1
machine type)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
include/hw/pci/pcie_port.h | 3 ++-
hw/i386/pc_q35.c | 5 +++--
hw/pci-bridge/gen_pcie_root_port.c | 7 ++++++-
hw/pci/pcie.c | 6 +++---
hw/pci/pcie_port.c | 3 ++-
5 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h
index fd484afb30..6c40e3733f 100644
--- a/include/hw/pci/pcie_port.h
+++ b/include/hw/pci/pcie_port.h
@@ -63,7 +63,8 @@ struct PCIESlot {
/* Indicates whether any type of hot-plug is allowed on the slot */
bool hotplug;
- bool native_hotplug;
+ /* broken ACPI hotplug compat knob to preserve 6.1 ABI intact */
+ bool hide_native_hotplug_cap;
QLIST_ENTRY(PCIESlot) next;
};
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 67ceb04bcc..f6b9688964 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -256,8 +256,9 @@ static void pc_q35_init(MachineState *machine)
NULL);
if (!keep_pci_slot_hpc && acpi_pcihp) {
- object_register_sugar_prop(TYPE_PCIE_SLOT, "x-native-hotplug",
- "false", true);
+ object_register_sugar_prop(TYPE_PCIE_SLOT,
+ "x-do-not-expose-native-hotplug-cap",
+ "true", true);
}
/* irq lines */
diff --git a/hw/pci-bridge/gen_pcie_root_port.c
b/hw/pci-bridge/gen_pcie_root_port.c
index 20099a8ae3..1ce4e7beba 100644
--- a/hw/pci-bridge/gen_pcie_root_port.c
+++ b/hw/pci-bridge/gen_pcie_root_port.c
@@ -87,7 +87,12 @@ static void gen_rp_realize(DeviceState *dev, Error **errp)
return;
}
- if (grp->res_reserve.io == -1 && s->hotplug && !s->native_hotplug) {
+ /*
+ * reserving IO space led to worse issues in 6.1, when this hunk was
+ * introduced. (see commit: 211afe5c69b59). Keep this broken for 6.1
+ * machine type ABI compatibility only
+ */
+ if (s->hide_native_hotplug_cap && grp->res_reserve.io == -1 && s->hotplug)
{
grp->res_reserve.io = GEN_PCIE_ROOT_DEFAULT_IO_RANGE;
}
int rc = pci_bridge_qemu_reserve_cap_init(d, 0,
diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
index 68a62da0b5..924fdabd15 100644
--- a/hw/pci/pcie.c
+++ b/hw/pci/pcie.c
@@ -611,11 +611,11 @@ void pcie_cap_slot_init(PCIDevice *dev, PCIESlot *s)
PCI_EXP_SLTCAP_ABP);
/*
- * Enable native hot-plug on all hot-plugged bridges unless
- * hot-plug is disabled on the slot.
+ * Expose native hot-plug on all bridges if hot-plug is enabled on the
slot.
+ * (unless broken 6.1 ABI is enforced for compat reasons)
*/
if (s->hotplug &&
- (s->native_hotplug || DEVICE(dev)->hotplugged)) {
+ (!s->hide_native_hotplug_cap || DEVICE(dev)->hotplugged)) {
pci_long_test_and_set_mask(dev->config + pos + PCI_EXP_SLTCAP,
PCI_EXP_SLTCAP_HPS |
PCI_EXP_SLTCAP_HPC);
diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c
index 687e4e763a..65a397ad23 100644
--- a/hw/pci/pcie_port.c
+++ b/hw/pci/pcie_port.c
@@ -173,7 +173,8 @@ static Property pcie_slot_props[] = {
DEFINE_PROP_UINT8("chassis", PCIESlot, chassis, 0),
DEFINE_PROP_UINT16("slot", PCIESlot, slot, 0),
DEFINE_PROP_BOOL("hotplug", PCIESlot, hotplug, true),
- DEFINE_PROP_BOOL("x-native-hotplug", PCIESlot, native_hotplug, true),
+ DEFINE_PROP_BOOL("x-do-not-expose-native-hotplug-cap", PCIESlot,
+ hide_native_hotplug_cap, false),
DEFINE_PROP_END_OF_LIST()
};
--
2.31.1
- [PATCH 00/40] x86: fixing and cleaning up ACPI PCI code part 3, Igor Mammedov, 2023/01/12
- [PATCH 05/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 02/40] tests: acpi: cleanup arguments to make them more readable, Igor Mammedov, 2023/01/12
- [PATCH 18/40] pcihp: drop pcihp_bridge_en dependency when composing PCNT method, Igor Mammedov, 2023/01/12
- [PATCH 11/40] pci: acpihp: assign BSEL only to coldplugged bridges, Igor Mammedov, 2023/01/12
- [PATCH 27/40] x86: pcihp: acpi: prepare slot ignore rule to work with self describing bridges, Igor Mammedov, 2023/01/12
- [PATCH 15/40] tests: boot_sector_test(): make it multi-shot, Igor Mammedov, 2023/01/12
- [PATCH 03/40] tests: acpi: whitelist DSDT blobs for tests that use pci-bridges, Igor Mammedov, 2023/01/12
- [PATCH 09/40] pci: acpi hotplug: rename x-native-hotplug to x-do-not-expose-native-hotplug-cap,
Igor Mammedov <=
- [PATCH 14/40] tests: acpi: extend bridge tests with hotplugged bridges, Igor Mammedov, 2023/01/12
- [PATCH 08/40] x86: acpi: pcihp: clean up duplicate bridge_in_acpi assignment, Igor Mammedov, 2023/01/12
- [PATCH 12/40] x86: pcihp: fix invalid AML PCNT calls to hotplugged bridges, Igor Mammedov, 2023/01/12
- [PATCH 22/40] pcihp: do not put empty PCNT in DSDT, Igor Mammedov, 2023/01/12
- [PATCH 06/40] tests: acpi: cleanup use_uefi argument usage, Igor Mammedov, 2023/01/12
- [PATCH 17/40] tests: acpi: whitelist DSDT before refactoring acpi based PCI hotplug machinery, Igor Mammedov, 2023/01/12
- [PATCH 19/40] tests: acpi: update expected blobs, Igor Mammedov, 2023/01/12
- [PATCH 10/40] pcihp: piix4: do not call acpi_pcihp_reset() when ACPI PCI hotplug is disabled, Igor Mammedov, 2023/01/12
- [PATCH 29/40] pcihp: make bridge describe itself using AcpiDevAmlIfClass:build_dev_aml, Igor Mammedov, 2023/01/12
- [PATCH 01/40] tests: qtest: print device_add error before failing test, Igor Mammedov, 2023/01/12