Received: from eggs.gnu.org ([2001:4830:134:3::10]:39467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d41QB-0005Fd-Lq for qemu-devel@nongnu.org; Fri, 28 Apr 2017 04:38:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d41Q8-0005NV-H9 for qemu-devel@nongnu.org; Fri, 28 Apr 2017 04:38:35 -0400 Date: Fri, 28 Apr 2017 10:38:26 +0200 From: Igor Mammedov Message-ID: <20170428103826.676072ba@nial.brq.redhat.com> In-Reply-To: <1493323148-32461-1-git-send-email-brogers@suse.com> References: <1493323148-32461-1-git-send-email-brogers@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] ACPI: don't call acpi_pcihp_device_plug_cb on xen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bruce Rogers Cc: qemu-devel@nongnu.org, sstabellini@kernel.org, qemu-stable@nongnu.org, mst@redhat.com On Thu, 27 Apr 2017 13:59:08 -0600 Bruce Rogers wrote: > Commit f0c9d64a exposed the issue that with a xenfv machine using > pci passthrough, acpi cpi hotplug code was being executed by mistake. s/cpi/pci/ > 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 an error that the bus doesn't have the > acpi-pcihp-bsel property set. it would be better to put actual error here. > > Signed-off-by: Bruce Rogers with above fixed up Reviewed-by: Igor Mammedov > --- > hw/acpi/piix4.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c > index a553a7e..c409374 100644 > --- a/hw/acpi/piix4.c > +++ b/hw/acpi/piix4.c > @@ -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);