From patchwork Wed Jan 28 16:30:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 433904 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 56581140168 for ; Thu, 29 Jan 2015 03:32:01 +1100 (AEDT) Received: from localhost ([::1]:54738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGVX5-0006Yx-Ic for incoming@patchwork.ozlabs.org; Wed, 28 Jan 2015 11:31:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGVVy-0004yS-7u for qemu-devel@nongnu.org; Wed, 28 Jan 2015 11:30:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGVVq-0001lp-NM for qemu-devel@nongnu.org; Wed, 28 Jan 2015 11:30:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58931) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGVVq-0001lk-FP; Wed, 28 Jan 2015 11:30:42 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0SGUfJ3013208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 28 Jan 2015 11:30:41 -0500 Received: from redhat.com (ovpn-116-147.ams2.redhat.com [10.36.116.147]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t0SGUciq029684; Wed, 28 Jan 2015 11:30:39 -0500 Date: Wed, 28 Jan 2015 18:30:38 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1422462623-2887-2-git-send-email-mst@redhat.com> References: <1422462623-2887-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1422462623-2887-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , qemu-stable@nongnu.org, Anthony Liguori , Richard Henderson Subject: [Qemu-devel] [PATCH 2/2] acpi-build: skip hotplugged bridges X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org hotplugged bridges don't get bsel allocated so acpi hotplug doesn't work for them anyway. OTOH adding them in ACPI creates a host of problems, e.g. they can't be hot-unplugged themselves which is surprising to users. So let's just skip these. Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 74586f3..ff42de5 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -857,8 +857,10 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state) /* * Skip bridge subtree creation if bridge hotplug is disabled * to make acpi tables compatible with legacy machine types. + * Skip creation for hotplugged bridges as well. */ - if (!child->pcihp_bridge_en && bus->parent_dev) { + if (bus->parent_dev && (!child->pcihp_bridge_en || + DEVICE(bus->parent_dev)->hotplugged)) { build_free_array(bus_table); build_pci_bus_state_cleanup(child); g_free(child); @@ -915,8 +917,10 @@ static void build_pci_bus_end(PCIBus *bus, void *bus_state) /* When hotplug for bridges is enabled, bridges are * described in ACPI separately (see build_pci_bus_end). * In this case they aren't themselves hot-pluggable. + * Hotplugged bridges *are* hot-pluggable. */ - bridge_in_acpi = pc->is_bridge && child->pcihp_bridge_en; + bridge_in_acpi = pc->is_bridge && child->pcihp_bridge_en && + !DEVICE(pdev)->hotplugged; if (pc->class_id == PCI_CLASS_BRIDGE_ISA || bridge_in_acpi) { set_bit(slot, slot_device_system);