[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v4 50/83] acpi: enumerate SMB bridge automatically along with othe
From: |
Michael S. Tsirkin |
Subject: |
[PULL v4 50/83] acpi: enumerate SMB bridge automatically along with other PCI devices |
Date: |
Mon, 7 Nov 2022 17:51:35 -0500 |
From: Igor Mammedov <imammedo@redhat.com>
to make that happen (bridge sits at _ADR: 0x001F0003),
relax PCI enumeration logic to include devices with *function* > 0
if device has something to say about itself (i.e. has build_dev_aml
callback set).
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20221017102146.2254096-8-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 | 27 +++------------------------
1 file changed, 3 insertions(+), 24 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index e1483bb11a..916343d8d6 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -448,9 +448,10 @@ static void build_append_pci_bus_devices(Aml
*parent_scope, PCIBus *bus,
/*
* allow describing coldplugged bridges in ACPI even if they are
not
* on function 0, as they are not unpluggable, for all other
devices
- * generate description only for function 0 per slot
+ * generate description only for function 0 per slot, and for other
+ * functions if device on function provides its own AML
*/
- if (func && !bridge_in_acpi) {
+ if (func && !bridge_in_acpi && !get_dev_aml_func(DEVICE(pdev))) {
continue;
}
} else {
@@ -1319,25 +1320,6 @@ static Aml *build_q35_osc_method(bool
enable_native_pcie_hotplug)
return method;
}
-static void build_smb0(Aml *table, int devnr, int func)
-{
- Aml *scope = aml_scope("_SB.PCI0");
- Aml *dev = aml_device("SMB0");
- bool ambiguous;
- Object *obj;
- /*
- * temporarily fish out device hosting SMBUS, build_smb0 will be gone once
- * PCI enumeration will be switched to call_dev_aml_func()
- */
- obj = object_resolve_path_type("", TYPE_ICH9_SMB_DEVICE, &ambiguous);
- assert(obj && !ambiguous);
-
- aml_append(dev, aml_name_decl("_ADR", aml_int(devnr << 16 | func)));
- call_dev_aml_func(DEVICE(obj), dev);
- aml_append(scope, dev);
- aml_append(table, scope);
-}
-
static void build_acpi0017(Aml *table)
{
Aml *dev, *scope, *method;
@@ -1440,9 +1422,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base);
}
build_q35_pci0_int(dsdt);
- if (pcms->smbus) {
- build_smb0(dsdt, ICH9_SMB_DEV, ICH9_SMB_FUNC);
- }
}
if (misc->has_hpet) {
--
MST
- [PULL v4 46/83] acpi: pc/q35: drop ad-hoc PCI-ISA bridge AML routines and let bus ennumeration generate AML, (continued)
[PULL v4 49/83] acpi: add get_dev_aml_func() helper, Michael S. Tsirkin, 2022/11/07
[PULL v4 50/83] acpi: enumerate SMB bridge automatically along with other PCI devices,
Michael S. Tsirkin <=
[PULL v4 51/83] tests: acpi: update expected blobs, Michael S. Tsirkin, 2022/11/07
[PULL v4 52/83] tests: acpi: pc/q35 whitelist DSDT before \_GPE cleanup, Michael S. Tsirkin, 2022/11/07
[PULL v4 53/83] acpi: pc/35: sanitize _GPE declaration order, Michael S. Tsirkin, 2022/11/07
[PULL v4 54/83] tests: acpi: update expected blobs, Michael S. Tsirkin, 2022/11/07
[PULL v4 55/83] hw/acpi/erst.c: Fix memory handling issues, Michael S. Tsirkin, 2022/11/07
[PULL v4 56/83] MAINTAINERS: Add qapi/virtio.json to section "virtio", Michael S. Tsirkin, 2022/11/07
[PULL v4 57/83] msix: Assert that specified vector is in range, Michael S. Tsirkin, 2022/11/07
[PULL v4 58/83] hw/i386/pc.c: CXL Fixed Memory Window should not reserve e820 in bios, Michael S. Tsirkin, 2022/11/07
[PULL v4 59/83] hw/i386/acpi-build: Remove unused struct, Michael S. Tsirkin, 2022/11/07
[PULL v4 60/83] hw/i386/acpi-build: Resolve redundant attribute, Michael S. Tsirkin, 2022/11/07