From nobody Fri Nov 7 04:09:25 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545352802689667.7372482279238; Thu, 20 Dec 2018 16:40:02 -0800 (PST) Received: from localhost ([::1]:41668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ga8rB-0008BJ-76 for importer@patchew.org; Thu, 20 Dec 2018 19:40:01 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ga8mq-0004k9-Pd for qemu-devel@nongnu.org; Thu, 20 Dec 2018 19:35:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ga8mn-0004gp-H6 for qemu-devel@nongnu.org; Thu, 20 Dec 2018 19:35:32 -0500 Received: from 4.mo5.mail-out.ovh.net ([178.33.111.247]:50017) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ga8ml-0004XS-Gb for qemu-devel@nongnu.org; Thu, 20 Dec 2018 19:35:29 -0500 Received: from player795.ha.ovh.net (unknown [10.109.159.222]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id C406D20BC57 for ; Fri, 21 Dec 2018 01:35:25 +0100 (CET) Received: from kaod.org (lns-bzn-46-82-253-208-248.adsl.proxad.net [82.253.208.248]) (Authenticated sender: groug@kaod.org) by player795.ha.ovh.net (Postfix) with ESMTPSA id CEAED1007975; Fri, 21 Dec 2018 00:35:09 +0000 (UTC) From: Greg Kurz To: qemu-devel@nongnu.org Date: Fri, 21 Dec 2018 01:35:09 +0100 Message-ID: <154535250941.862554.15763512831843902652.stgit@bahia.lan> In-Reply-To: <154535246529.862554.6113740443866753456.stgit@bahia.lan> References: <154535246529.862554.6113740443866753456.stgit@bahia.lan> User-Agent: StGit/unknown-version MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 3840726059116698050 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrudejgedgvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.33.111.247 Subject: [Qemu-devel] [PATCH 02/15] spapr: move spapr_create_phb() to core machine code 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: Cornelia Huck , Gerd Hoffmann , Eduardo Habkost , "Michael S. Tsirkin" , Alexey Kardashevskiy , David Hildenbrand , Michael Roth , qemu-s390x@nongnu.org, Dmitry Fleytman , qemu-ppc@nongnu.org, =?utf-8?q?C=C3=A9dric?= Le Goater , Marcel Apfelbaum , Paolo Bonzini , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" This function is only used when creating the default PHB. Let's rename it and move it to the core machine code for clarity. Signed-off-by: Greg Kurz Reviewed-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- hw/ppc/spapr.c | 13 ++++++++++++- hw/ppc/spapr_pci.c | 11 ----------- include/hw/pci-host/spapr.h | 2 -- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 8ea680fcde1e..1f17b5d01f4f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2551,6 +2551,17 @@ static void spapr_init_cpus(sPAPRMachineState *spapr) } } =20 +static PCIHostState *spapr_create_default_phb(void) +{ + DeviceState *dev; + + dev =3D qdev_create(NULL, TYPE_SPAPR_PCI_HOST_BRIDGE); + qdev_prop_set_uint32(dev, "index", 0); + qdev_init_nofail(dev); + + return PCI_HOST_BRIDGE(dev); +} + /* pSeries LPAR / sPAPR hardware init */ static void spapr_machine_init(MachineState *machine) { @@ -2782,7 +2793,7 @@ static void spapr_machine_init(MachineState *machine) /* Set up PCI */ spapr_pci_rtas_init(); =20 - phb =3D spapr_create_phb(spapr, 0); + phb =3D spapr_create_default_phb(); =20 for (i =3D 0; i < nb_nics; i++) { NICInfo *nd =3D &nd_table[i]; diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 2374d55fc112..e59adbe706bb 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1979,17 +1979,6 @@ static const TypeInfo spapr_phb_info =3D { } }; =20 -PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index) -{ - DeviceState *dev; - - dev =3D qdev_create(NULL, TYPE_SPAPR_PCI_HOST_BRIDGE); - qdev_prop_set_uint32(dev, "index", index); - qdev_init_nofail(dev); - - return PCI_HOST_BRIDGE(dev); -} - typedef struct sPAPRFDT { void *fdt; int node_off; diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 7c66c3872f96..a65cfef16945 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -111,8 +111,6 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct sPAPRP= HBState *phb, int pin) return spapr_qirq(spapr, phb->lsi_table[pin].irq); } =20 -PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index); - int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void = *fdt, uint32_t nr_msis); =20