qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 08/13] acpi: Always try to init PCI hotplug I/O base


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 08/13] acpi: Always try to init PCI hotplug I/O base
Date: Wed, 2 Dec 2015 20:22:53 -0200

Instead of making pcihp_io_base/pcihp_io_len initialization
specific to piix4, just check if ACPI_PCIHP_IO_BASE_PROP property
is present.

No behavior is changed, as only piix4 initializes the
ACPI_PCIHP_IO_BASE_PROP property today.

Signed-off-by: Eduardo Habkost <address@hidden>
---
 hw/i386/acpi-build.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 6774ced..617cd53 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -141,6 +141,11 @@ static void acpi_get_cpu_info(AcpiCpuInfo *cpu)
     object_child_foreach(root, acpi_add_cpu_info, cpu);
 }
 
+static bool acpi_pci_hotplug_enabled(Object *acpi_dev)
+{
+    return object_property_find(acpi_dev, ACPI_PCIHP_IO_BASE_PROP, NULL);
+}
+
 static void acpi_get_pm_info(AcpiPmInfo *pm)
 {
     Object *piix = piix4_pm_find();
@@ -151,6 +156,13 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
     pm->pcihp_io_len = 0;
     if (piix) {
         obj = piix;
+    }
+    if (lpc) {
+        obj = lpc;
+    }
+    assert(obj);
+
+    if (acpi_pci_hotplug_enabled(obj)) {
         pm->pcihp_io_base =
             object_property_get_int(obj, ACPI_PCIHP_IO_BASE_PROP,
                                     &error_abort);
@@ -158,10 +170,6 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
             object_property_get_int(obj, ACPI_PCIHP_IO_LEN_PROP,
                                     &error_abort);
     }
-    if (lpc) {
-        obj = lpc;
-    }
-    assert(obj);
 
     pm->cpu_hp_io_base =
         object_property_get_int(obj, ACPI_CPUHP_IO_BASE_PROP, &error_abort);
-- 
2.1.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]