From nobody Wed Nov 5 22:43:05 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; dkim=fail; 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 1537859267646205.55284853233672; Tue, 25 Sep 2018 00:07:47 -0700 (PDT) Received: from localhost ([::1]:51272 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hRf-00030X-H6 for importer@patchew.org; Tue, 25 Sep 2018 03:07:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4hMO-0006ws-59 for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4hMM-0006S2-9Q for qemu-devel@nongnu.org; Tue, 25 Sep 2018 03:02:15 -0400 Received: from ozlabs.org ([203.11.71.1]:56639) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g4hMK-0006Nm-C9; Tue, 25 Sep 2018 03:02:14 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 42KBp06KbQz9sCv; Tue, 25 Sep 2018 17:01:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1537858920; bh=z+bVtYXz7P2jCY3Ikv7e8fBk9vsSwYypU9v0NGyHqSk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hB2wr/bWl/D4wu4xnaTbkkVrj23hmGwiA8dkX1Tn3vk+AapK79j31vdKFEUMjRf++ ZcR+7G3XFRWJpziIJ8cZBjgERxxXPxa9csw+9fIkCoGegLayFHQoXHcN5XTYczDjC3 bLt3zC+TF0qo6erXSzXCimE8x/rsRJxsONVAllgc= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 25 Sep 2018 17:01:48 +1000 Message-Id: <20180925070154.5812-9-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180925070154.5812-1-david@gibson.dropbear.id.au> References: <20180925070154.5812-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 08/14] spapr_pci: add an extra 'nr_msis' argument to spapr_populate_pci_dt 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: mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater So that we don't have to call qdev_get_machine() to get the machine class and the sPAPRIrq backend holding the number of MSIs. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr.c | 2 +- hw/ppc/spapr_pci.c | 9 +++------ include/hw/pci-host/spapr.h | 5 ++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index eba7d60a30..98868d893a 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1267,7 +1267,7 @@ static void *spapr_build_fdt(sPAPRMachineState *spapr, } =20 QLIST_FOREACH(phb, &spapr->phbs, list) { - ret =3D spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt); + ret =3D spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt, smc->irq->nr= _msis); if (ret < 0) { error_report("couldn't setup PCI devices in fdt"); exit(1); diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index bb736177e7..c2271e6ed4 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -2069,9 +2069,8 @@ static void spapr_phb_pci_enumerate(sPAPRPHBState *ph= b) =20 } =20 -int spapr_populate_pci_dt(sPAPRPHBState *phb, - uint32_t xics_phandle, - void *fdt) +int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void = *fdt, + uint32_t nr_msis) { int bus_off, i, j, ret; gchar *nodename; @@ -2121,7 +2120,6 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, sPAPRTCETable *tcet; PCIBus *bus =3D PCI_HOST_BRIDGE(phb)->bus; sPAPRFDT s_fdt; - sPAPRMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(qdev_get_machine()); =20 /* Start populating the FDT */ nodename =3D g_strdup_printf("pci@%" PRIx64, phb->buid); @@ -2139,8 +2137,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, _FDT(fdt_setprop(fdt, bus_off, "ranges", &ranges, sizeof_ranges)); _FDT(fdt_setprop(fdt, bus_off, "reg", &bus_reg, sizeof(bus_reg))); _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pci-config-space-type", 0x1)); - _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", - smc->irq->nr_msis)); + _FDT(fdt_setprop_cell(fdt, bus_off, "ibm,pe-total-#msi", nr_msis)); =20 /* Dynamic DMA window */ if (phb->ddw_enabled) { diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 0fae4fc6a4..7c66c3872f 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -113,9 +113,8 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct sPAPRP= HBState *phb, int pin) =20 PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index); =20 -int spapr_populate_pci_dt(sPAPRPHBState *phb, - uint32_t xics_phandle, - void *fdt); +int spapr_populate_pci_dt(sPAPRPHBState *phb, uint32_t xics_phandle, void = *fdt, + uint32_t nr_msis); =20 void spapr_pci_rtas_init(void); =20 --=20 2.17.1