ACPI: don't call acpi_pcihp_device_plug_cb on xen
PATCH v2 1/1 ACPI: don't call acpi_pcihp_device_plug_cb on xen
Commit f0c9d64a exposed the issue that with a xenfv machine using pci passthrough, acpi pci hotplug code was being executed by mistake. Guard calls to acpi_pcihp_device_plug_cb (and corresponding acpi_pcihp_device_unplug_cb) with a check for xen_enabled(). Without this check I am seeing the following error report: "Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set".
--- hw/acpi/piix4.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
hw/acpi/piix4.c +8 -3
@@ -385,7 +385,10 @@ static void piix4_device_plug_cb(HotplugHandler *hotplug_dev, dev, errp); } }else if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) { -acpi_pcihp_device_plug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, errp); +if (!xen_enabled ()) { +acpi_pcihp_device_plug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, + errp); + } }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) {if (s->cpu_hotplug_legacy) {legacy_acpi_cpu_plug_cb (hotplug_dev, &s->gpe_cpu, dev, errp);
@@ -408,8 +411,10 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,acpi_memory_unplug_request_cb (hotplug_dev, &s->acpi_memory_hotplug, dev, errp); }else if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) { -acpi_pcihp_device_unplug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, - errp); +if (!xen_enabled ()) { +acpi_pcihp_device_unplug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, + errp); + } }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU ) && !s->cpu_hotplug_legacy) {acpi_cpu_unplug_request_cb (hotplug_dev, &s->cpuhp_state, dev, errp);
Signature · 1 line
1.9.0
Quoted 8 lines · On Fri, 28 Apr 2017 05:57:06 -0600 Bruce Rogers <[email protected]> wrote:
Commit
f0c9d64aexposed the issue that with a xenfv machine using pci passthrough, acpi pci hotplug code was being executed by mistake. Guard calls toacpi_pcihp_device_plug_cb(and correspondingacpi_pcihp_device_unplug_cb) with a check forxen_enabled(). Without this check I am seeing the following error report: "Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set".Signed-off-by Bruce Rogers <[email protected]>
Quoted 33 lines
--- hw/acpi/piix4.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)hw/acpi/piix4.c +8
-3@@ -385,7 +385,10 @@ static void piix4_device_plug_cb(HotplugHandler *hotplug_dev, dev, errp); } }else if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) { -acpi_pcihp_device_plug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, errp); +if (!xen_enabled ()) { +acpi_pcihp_device_plug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, + errp); + } }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU )) {if (s->cpu_hotplug_legacy) {legacy_acpi_cpu_plug_cb (hotplug_dev, &s->gpe_cpu, dev, errp);@@ -408,8 +411,10 @@ static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev,acpi_memory_unplug_request_cb (hotplug_dev, &s->acpi_memory_hotplug, dev, errp); }else if (object_dynamic_cast (OBJECT (dev),TYPE_PCI_DEVICE )) { -acpi_pcihp_device_unplug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, - errp); +if (!xen_enabled ()) { +acpi_pcihp_device_unplug_cb (hotplug_dev, &s->acpi_pci_hotplug, dev, + errp); + } }else if (object_dynamic_cast (OBJECT (dev),TYPE_CPU ) && !s->cpu_hotplug_legacy) {acpi_cpu_unplug_request_cb (hotplug_dev, &s->cpuhp_state, dev, errp);