[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 47/73] acpi: pci: support acpi-index for non-hotpluggable devices
From: |
Michael S. Tsirkin |
Subject: |
[PULL 47/73] acpi: pci: support acpi-index for non-hotpluggable devices |
Date: |
Tue, 7 Mar 2023 20:13:11 -0500 |
From: Igor Mammedov <imammedo@redhat.com>
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>
Message-Id: <20230302161543.286002-22-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 | 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);
--
MST
- [PULL 37/73] pcihp: piix4: do not redirect hotplug controller to piix4 when ACPI hotplug is disabled, (continued)
- [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
- [PULL 43/73] acpi: pci: add EDSM method to DSDT, Michael S. Tsirkin, 2023/03/07
- [PULL 44/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 45/73] tests: acpi: whitelist DSDT before adding device with acpi-index to testcases, Michael S. Tsirkin, 2023/03/07
- [PULL 46/73] tests: acpi: add device with acpi-index on non-hotpluggble bus, Michael S. Tsirkin, 2023/03/07
- [PULL 47/73] acpi: pci: support acpi-index for non-hotpluggable devices,
Michael S. Tsirkin <=
- [PULL 48/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 52/73] tests: acpi: whitelist DSDT before adding non-0 function device with acpi-index to testcases, Michael S. Tsirkin, 2023/03/07
- [PULL 54/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 53/73] tests: acpi: add non zero function device with acpi-index on non-hotpluggble bus, Michael S. Tsirkin, 2023/03/07
- [PULL 50/73] acpi: pci: describe all functions on populated slots, Michael S. Tsirkin, 2023/03/07
- [PULL 49/73] tests: acpi: whitelist DSDT before exposing non zero functions, Michael S. Tsirkin, 2023/03/07
- [PULL 55/73] pci: move acpi-index uniqueness check to generic PCI device code, Michael S. Tsirkin, 2023/03/07
- [PULL 51/73] tests: acpi: update expected blobs, Michael S. Tsirkin, 2023/03/07
- [PULL 56/73] acpi: pci: drop BSEL usage when deciding that device isn't hotpluggable, Michael S. Tsirkin, 2023/03/07
- [PULL 57/73] acpi: pci: move BSEL into build_append_pcihp_slots(), Michael S. Tsirkin, 2023/03/07