From patchwork Wed Apr 26 19:07:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Rogers X-Patchwork-Id: 9701879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0B7BB60245 for ; Wed, 26 Apr 2017 19:09:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E491E2860B for ; Wed, 26 Apr 2017 19:09:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8B4B28608; Wed, 26 Apr 2017 19:09:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C8D22861F for ; Wed, 26 Apr 2017 19:08:59 +0000 (UTC) Received: from localhost ([::1]:56762 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3SJ8-0006Of-V2 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Apr 2017 15:08:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3SIK-0006ON-IB for qemu-devel@nongnu.org; Wed, 26 Apr 2017 15:08:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3SIG-0006Ay-TO for qemu-devel@nongnu.org; Wed, 26 Apr 2017 15:08:08 -0400 Received: from inet-orm.provo.novell.com ([137.65.248.124]:58208 helo=mail.novell.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3SIG-00066D-Jx; Wed, 26 Apr 2017 15:08:04 -0400 Received: from brogers1.gns.novell.com ([137.65.222.43]) by mail.novell.com with ESMTP (NOT encrypted); Wed, 26 Apr 2017 13:07:58 -0600 From: Bruce Rogers To: qemu-devel@nongnu.org Date: Wed, 26 Apr 2017 13:07:02 -0600 Message-Id: <1493233622-14485-1-git-send-email-brogers@suse.com> X-Mailer: git-send-email 1.9.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 137.65.248.124 Subject: [Qemu-devel] [PATCH] ACPI: call acpi_set_pci_info when only acpi enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bruce Rogers , imammedo@redhat.com, sstabellini@kernel.org, qemu-stable@nongnu.org, mst@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Bruce Rogers --- hw/i386/acpi-build.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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; + 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; } - if (!acpi_enabled) { - ACPI_BUILD_DPRINTF("ACPI disabled. Bailing out.\n"); - return; - } - build_state = g_malloc0(sizeof *build_state); - acpi_set_pci_info(); - acpi_build_tables_init(&tables); acpi_build(&tables, MACHINE(pcms));