Received: from eggs.gnu.org ([2001:4830:134:3::10]:39226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3lay-0006s8-6T for qemu-devel@nongnu.org; Thu, 27 Apr 2017 11:44:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3lat-0002rp-UK for qemu-devel@nongnu.org; Thu, 27 Apr 2017 11:44:40 -0400 Message-Id: <590211DF02000048001438FF@prv-mh.provo.novell.com> Date: Thu, 27 Apr 2017 09:44:31 -0600 From: "Bruce Rogers" References: <1493233622-14485-1-git-send-email-brogers@suse.com> <20170427111135.7a7bbfa9@nial.brq.redhat.com> In-Reply-To: <20170427111135.7a7bbfa9@nial.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Qemu-devel] [PATCH] ACPI: call acpi_set_pci_info when only acpi enabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: sstabellini@kernel.org, qemu-devel@nongnu.org, qemu-stable@nongnu.org, mst@redhat.com >>> On 4/27/2017 at 03:11 AM, Igor Mammedov = wrote:=20 > On Wed, 26 Apr 2017 13:07:02 -0600 > Bruce Rogers wrote: >=20 >> Commit f0c9d64a exposed an issue with the code order in acpi_setup. >> As of that commit, a xenfv machine type guest will no longer start >> if using pci passthrough. Re-order the code in that function to >> allow acpi_set_pci_info to be called before bailing on the other, >> non-related conditions. With this change I can again use pci >> passthrough and xenfv together. >>=20 >> Signed-off-by: Bruce Rogers > it doesn't look right, > acpi_set_pci_info() is supposed to affect only ACPI based hotplug >=20 > could you elaborate more on what's going on and > what error you see at startup? I am using libvirt, driving the creation of the Xen HVM guest via libxl. libxl dynamically attaches the pci device via QMP. In the context of qmp_device_add(), we get a failure in hw/acpi/pcihp.c: acpi_pcihp_device_plug_cb() when it checks for bsel, and errors with the message: "Unsupported bus. Bus doesn't have property 'acpi-pcihp-bsel' set". I guess it wasn't clear from my description that hotplug was involved. Bruce >=20 >> --- >> hw/i386/acpi-build.c | 14 +++++++------- >> 1 file changed, 7 insertions(+), 7 deletions(-) >>=20 >> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c >> index 2073108..1ec072f 100644 >> --- a/hw/i386/acpi-build.c >> +++ b/hw/i386/acpi-build.c >> @@ -2834,6 +2834,13 @@ void acpi_setup(void) >> AcpiBuildState *build_state; >> Object *vmgenid_dev; >> =20 >> + if (!acpi_enabled) { >> + ACPI_BUILD_DPRINTF("ACPI disabled. Bailing out.\n"); >> + return; >> + } >> + >> + acpi_set_pci_info(); >> + >> if (!pcms->fw_cfg) { >> ACPI_BUILD_DPRINTF("No fw cfg. Bailing out.\n"); >> return; >> @@ -2844,15 +2851,8 @@ void acpi_setup(void) >> return; >> } >> =20 >> - if (!acpi_enabled) { >> - ACPI_BUILD_DPRINTF("ACPI disabled. Bailing out.\n"); >> - return; >> - } >> - >> build_state =3D g_malloc0(sizeof *build_state); >> =20 >> - acpi_set_pci_info(); >> - >> acpi_build_tables_init(&tables); >> acpi_build(&tables, MACHINE(pcms)); >> =20