From nobody Wed Nov 5 02:14:26 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 150100559190356.28315142199267; Tue, 25 Jul 2017 10:59:51 -0700 (PDT) Received: from localhost ([::1]:33868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da47a-0001Hw-B3 for importer@patchew.org; Tue, 25 Jul 2017 13:59:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da46F-0000MS-TW for qemu-devel@nongnu.org; Tue, 25 Jul 2017 13:58:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da46C-0000oi-UW for qemu-devel@nongnu.org; Tue, 25 Jul 2017 13:58:28 -0400 Received: from 18.mo5.mail-out.ovh.net ([178.33.45.10]:45301) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da46C-0000oJ-I9 for qemu-devel@nongnu.org; Tue, 25 Jul 2017 13:58:24 -0400 Received: from player760.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id 0E0F711634A for ; Tue, 25 Jul 2017 19:58:23 +0200 (CEST) Received: from [192.168.0.243] (gar31-1-82-66-74-139.fbx.proxad.net [82.66.74.139]) (Authenticated sender: groug@kaod.org) by player760.ha.ovh.net (Postfix) with ESMTPA id 989CE20067; Tue, 25 Jul 2017 19:58:15 +0200 (CEST) From: Greg Kurz To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 19:58:15 +0200 Message-ID: <150100549536.27487.11322702271540744350.stgit@bahia> In-Reply-To: <150100547373.27487.3154210751350595400.stgit@bahia> References: <150100547373.27487.3154210751350595400.stgit@bahia> User-Agent: StGit/0.17.1-20-gc0b1b-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 9709197850122951129 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelkedrheehgdduvddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 178.33.45.10 Subject: [Qemu-devel] [for-2.11 PATCH 01/26] 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: "Michael S. Tsirkin" , Michael Roth , qemu-ppc@nongnu.org, Bharata B Rao , Paolo Bonzini , Daniel Henrique Barboza , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 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 2a3e53d5d58c..53969315ac24 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2142,6 +2142,17 @@ static void spapr_init_cpus(sPAPRMachineState *spapr) g_free(type); } =20 +static PCIHostState *spapr_create_default_phb(sPAPRMachineState *spapr) +{ + 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 ppc_spapr_init(MachineState *machine) { @@ -2374,7 +2385,7 @@ static void ppc_spapr_init(MachineState *machine) /* Set up PCI */ spapr_pci_rtas_init(); =20 - phb =3D spapr_create_phb(spapr, 0); + phb =3D spapr_create_default_phb(spapr); =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 d84abf1070a0..70a99a032267 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1982,17 +1982,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 38470b2f0e5c..5a4e9686d562 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 xics_get_qirq(XICS_FABRIC(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);