[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 21/34] acpi: pci: support acpi-index for non-hotpluggable devi
From: |
Igor Mammedov |
Subject: |
[PATCH v2 21/34] acpi: pci: support acpi-index for non-hotpluggable devices |
Date: |
Thu, 2 Mar 2023 17:15:30 +0100 |
Inject static _DSM (EDSM) if non-hotpluggable device has
acpi-index configured on it.
It lets use acpi-index non-hotpluggable devices / devices
attached to non-hotpluggable bus.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/i386/acpi-build.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 6f5501fb74..46f78e9338 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -452,6 +452,25 @@ static Aml *aml_pci_edsm(void)
return method;
}
+static Aml *aml_pci_static_endpoint_dsm(PCIDevice *pdev)
+{
+ Aml *method;
+
+ g_assert(pdev->acpi_index != 0);
+ method = aml_method("_DSM", 4, AML_SERIALIZED);
+ {
+ Aml *params = aml_local(0);
+ Aml *pkg = aml_package(1);
+ aml_append(pkg, aml_int(pdev->acpi_index));
+ aml_append(method, aml_store(pkg, params));
+ aml_append(method,
+ aml_return(aml_call5("EDSM", aml_arg(0), aml_arg(1),
+ aml_arg(2), aml_arg(3), params))
+ );
+ }
+ return method;
+}
+
static void build_append_pcihp_notify_entry(Aml *method, int slot)
{
Aml *if_ctx;
@@ -577,6 +596,12 @@ void build_append_pci_bus_devices(Aml *parent_scope,
PCIBus *bus)
aml_append(dev, aml_name_decl("_ADR", aml_int(adr)));
call_dev_aml_func(DEVICE(bus->devices[devfn]), dev);
+ /* add _DSM if device has acpi-index set */
+ if (pdev->acpi_index && !bsel &&
+ !object_property_get_bool(OBJECT(pdev), "hotpluggable",
+ &error_abort)) {
+ aml_append(dev, aml_pci_static_endpoint_dsm(pdev));
+ }
/* device descriptor has been composed, add it into parent context */
aml_append(parent_scope, dev);
--
2.39.1
- [PATCH v2 00/34] pci(pc/q35): acpi-index support on non-hotpluggable slots, Igor Mammedov, 2023/03/02
- [PATCH v2 01/34] Revert "tests/qtest: Check for devices in bios-tables-test", Igor Mammedov, 2023/03/02
- [PATCH v2 03/34] tests: acpi: add test_acpi_q35_tcg_no_acpi_hotplug test and extend test_acpi_piix4_no_acpi_pci_hotplug, Igor Mammedov, 2023/03/02
- [PATCH v2 19/34] tests: acpi: whitelist DSDT before adding device with acpi-index to testcases, Igor Mammedov, 2023/03/02
- [PATCH v2 10/34] tests: acpi: update expected blobs, Igor Mammedov, 2023/03/02
- [PATCH v2 21/34] acpi: pci: support acpi-index for non-hotpluggable devices,
Igor Mammedov <=
- [PATCH v2 27/34] tests: acpi: add non zero function device with acpi-index on non-hotpluggble bus, Igor Mammedov, 2023/03/02
- [PATCH v2 06/34] tests: acpi: extend multi-bridge case with case 'root-port, id=HOHP, hotplug=off root-port, bus=NOHP', Igor Mammedov, 2023/03/02
- [PATCH v2 15/34] tests: acpi: update expected blobs, Igor Mammedov, 2023/03/02
- [PATCH v2 11/34] pcihp: piix4: do not redirect hotplug controller to piix4 when ACPI hotplug is disabled, Igor Mammedov, 2023/03/02
- [PATCH v2 23/34] tests: acpi: whitelist DSDT before exposing non zero functions, Igor Mammedov, 2023/03/02
- [PATCH v2 26/34] tests: acpi: whitelist DSDT before adding non-0 function device with acpi-index to testcases, Igor Mammedov, 2023/03/02
- [PATCH v2 13/34] tests: acpi: whitelist DSDT blobs before isolating PCI _DSM func 0 prolog, Igor Mammedov, 2023/03/02
- [PATCH v2 14/34] pcihp: move PCI _DSM function 0 prolog into separate function, Igor Mammedov, 2023/03/02
- [PATCH v2 18/34] tests: acpi: update expected blobs, Igor Mammedov, 2023/03/02
- [PATCH v2 04/34] tests: acpi: update expected blobs, Igor Mammedov, 2023/03/02