[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 20/33] acpi: pci: support acpi-index for non-hotpluggable devices
From: |
Igor Mammedov |
Subject: |
[PATCH 20/33] acpi: pci: support acpi-index for non-hotpluggable devices |
Date: |
Fri, 24 Feb 2023 16:37:59 +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 8db65663fc..c33b43a358 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -451,6 +451,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;
@@ -576,6 +595,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 18/33] tests: acpi: whitelist DSDT before adding device with acpi-index to testcases, (continued)
- [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
- [PATCH 10/33] pcihp: piix4: do not redirect hotplug controller to piix4 when ACPI hotplug is disabled, Igor Mammedov, 2023/02/24
- [PATCH 13/33] pcihp: move PCI _DSM function 0 prolog into separate function, Igor Mammedov, 2023/02/24
- [PATCH 11/33] pci: fix 'hotplugglable' property behavior, Igor Mammedov, 2023/02/24
- [PATCH 19/33] tests: acpi: add device with acpi-index on non-hotpluggble bus, Igor Mammedov, 2023/02/24
- [PATCH 20/33] acpi: pci: support acpi-index for non-hotpluggable devices,
Igor Mammedov <=
- [PATCH 22/33] tests: acpi: whitelist DSDT before exposing non zero functions, Igor Mammedov, 2023/02/24
- [PATCH 21/33] tests: acpi: update expected blobs, Igor Mammedov, 2023/02/24
- [PATCH 26/33] tests: acpi: add non zero function device with acpi-index on non-hotpluggble bus, Igor Mammedov, 2023/02/24
- [PATCH 24/33] tests: acpi: update expected blobs, Igor Mammedov, 2023/02/24
- [PATCH 25/33] tests: acpi: whitelist DSDT before adding non-0 function device with acpi-index to testcases, Igor Mammedov, 2023/02/24
- [PATCH 23/33] acpi: pci: describe all functions on populated slots, Igor Mammedov, 2023/02/24
- [PATCH 29/33] acpi: pci: drop BSEL usage when deciding that device isn't hotpluggable, Igor Mammedov, 2023/02/24
- [PATCH 31/33] acpi: pci: move out ACPI PCI hotplug generator from generic slot generator build_append_pci_bus_devices(), Igor Mammedov, 2023/02/24
- [PATCH 30/33] acpi: pci: move BSEL into build_append_pcihp_slots(), Igor Mammedov, 2023/02/24
- [PATCH 27/33] tests: acpi: update expected blobs, Igor Mammedov, 2023/02/24