From patchwork Thu Nov 12 15:11:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 543396 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 0FE0B141409 for ; Fri, 13 Nov 2015 02:16:17 +1100 (AEDT) Received: from localhost ([::1]:47256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwtbj-0002yy-3t for incoming@patchwork.ozlabs.org; Thu, 12 Nov 2015 10:16:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwtX6-0002g8-6P for qemu-devel@nongnu.org; Thu, 12 Nov 2015 10:11:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwtX1-0008Ps-40 for qemu-devel@nongnu.org; Thu, 12 Nov 2015 10:11:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwtX0-0008Pn-VS for qemu-devel@nongnu.org; Thu, 12 Nov 2015 10:11:23 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 8D95DA715 for ; Thu, 12 Nov 2015 15:11:22 +0000 (UTC) Received: from work.redhat.com (vpn1-7-213.ams2.redhat.com [10.36.7.213]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tACFBGtH017540; Thu, 12 Nov 2015 10:11:20 -0500 From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Thu, 12 Nov 2015 17:11:13 +0200 Message-Id: <1447341076-11573-2-git-send-email-marcel@redhat.com> In-Reply-To: <1447341076-11573-1-git-send-email-marcel@redhat.com> References: <1447341076-11573-1-git-send-email-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: rth@twiddle.ne, ehabkost@redhat.com, mst@redhat.com, pbonzini@redhat.com, marcel@redhat.com, imammedo@redhat.com Subject: [Qemu-devel] [PATCH 1/4] hw/pxb: remove the built-in pci bridge 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 As part of porting the pxb device to Q35 remove the internal pci-2-pci bridge. The only way to hot-pug devices on the extra PCI root buses is by adding a pci-2-pci to the pxb before the firmware assign the IO/mem resources. Signed-off-by: Marcel Apfelbaum --- hw/pci-bridge/pci_expander_bridge.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c index 57f8a37..0464dec 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -196,7 +196,7 @@ static gint pxb_compare(gconstpointer a, gconstpointer b) static int pxb_dev_initfn(PCIDevice *dev) { PXBDev *pxb = PXB_DEV(dev); - DeviceState *ds, *bds; + DeviceState *ds; PCIBus *bus; const char *dev_name = NULL; @@ -211,18 +211,13 @@ static int pxb_dev_initfn(PCIDevice *dev) } ds = qdev_create(NULL, TYPE_PXB_HOST); - bus = pci_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_PXB_BUS); + bus = pci_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_BUS); bus->parent_dev = dev; bus->address_space_mem = dev->bus->address_space_mem; bus->address_space_io = dev->bus->address_space_io; bus->map_irq = pxb_map_irq_fn; - bds = qdev_create(BUS(bus), "pci-bridge"); - bds->id = dev_name; - qdev_prop_set_uint8(bds, PCI_BRIDGE_DEV_PROP_CHASSIS_NR, pxb->bus_nr); - qdev_prop_set_bit(bds, PCI_BRIDGE_DEV_PROP_SHPC, false); - PCI_HOST_BRIDGE(ds)->bus = bus; if (pxb_register_bus(dev, bus)) { @@ -230,7 +225,6 @@ static int pxb_dev_initfn(PCIDevice *dev) } qdev_init_nofail(ds); - qdev_init_nofail(bds); pci_word_test_and_set_mask(dev->config + PCI_STATUS, PCI_STATUS_66MHZ | PCI_STATUS_FAST_BACK);