From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFrPQ-000804-O4 for qemu-devel@nongnu.org; Mon, 26 Jan 2015 16:41:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFrPK-000256-Du for qemu-devel@nongnu.org; Mon, 26 Jan 2015 16:41:24 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:47438) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFrPK-00024c-AO for qemu-devel@nongnu.org; Mon, 26 Jan 2015 16:41:18 -0500 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 26 Jan 2015 16:41:17 -0500 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <20150119052254.GX5297@voom.fritz.box> References: <1419337831-16552-1-git-send-email-mdroth@linux.vnet.ibm.com> <1419337831-16552-15-git-send-email-mdroth@linux.vnet.ibm.com> <20150119052254.GX5297@voom.fritz.box> Message-ID: <20150126204404.23721.41041@loki> Date: Mon, 26 Jan 2015 14:44:04 -0600 Subject: Re: [Qemu-devel] [PATCH v4 14/17] spapr_pci: populate DRC dt entries for PHBs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: aik@ozlabs.ru, qemu-devel@nongnu.org, agraf@suse.de, ncmike@ncultra.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, bharata.rao@gmail.com, nfont@linux.vnet.ibm.com Quoting David Gibson (2015-01-18 23:22:54) > On Tue, Dec 23, 2014 at 06:30:28AM -0600, Michael Roth wrote: > > Reserve 32 entries of type PCI in each PHB's initial FDT. This > > advertises to guests that each PHB is DR-capable device with > > physical hotpluggable slots. This is necessary for allowing > > hotplugging of devices to it later via bus rescan or guest rpaphp > > hotplug module. > > = > > Signed-off-by: Michael Roth > > --- > > hw/ppc/spapr_pci.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > = > > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c > > index 73e86a4..a5d7791 100644 > > --- a/hw/ppc/spapr_pci.c > > +++ b/hw/ppc/spapr_pci.c > > @@ -47,6 +47,8 @@ > > #define RTAS_TYPE_MSI 1 > > #define RTAS_TYPE_MSIX 2 > > = > > +#define FDT_MAX_SIZE 0x10000 > = > This define doesn't appear to be used in the new code. > = > > #include "hw/ppc/spapr_drc.h" > > = > > static sPAPRPHBState *find_phb(sPAPREnvironment *spapr, uint64_t buid) > > @@ -872,7 +874,7 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, > > uint32_t xics_phandle, > > void *fdt) > > { > > - int bus_off, i, j; > > + int bus_off, i, j, ret; > > char nodename[256]; > > uint32_t bus_range[] =3D { cpu_to_be32(0), cpu_to_be32(0xff) }; > > struct { > > @@ -951,6 +953,11 @@ int spapr_populate_pci_dt(sPAPRPHBState *phb, > > object_child_foreach(OBJECT(phb), spapr_phb_children_dt, > > &((sPAPRTCEDT){ .fdt =3D fdt, .node_off =3D b= us_off })); > > = > > + ret =3D spapr_drc_populate_dt(fdt, bus_off, SPAPR_DR_CONNECTOR_TYP= E_PCI); > = > AFAICT this will add information for all PCI connectors in the > system. Shouldn't it only add the ones belonging to this PHB? Argh, yes indeed. Since we pass in the parent device during spapr_dr_connector_new() I think I can simply have this pass in the parent = PHB we want to generate entries for as a filter. Will add this for v5 and do so= me testing with multiple PHBs. > = > -- = > David Gibson | I'll have my music baroque, and my code > david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _othe= r_ > | _way_ _around_! > http://www.ozlabs.org/~dgibson