From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnGXq-0001dH-Ty for qemu-devel@nongnu.org; Thu, 22 Sep 2016 22:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnGXo-0002FI-Ky for qemu-devel@nongnu.org; Thu, 22 Sep 2016 22:48:57 -0400 Date: Fri, 23 Sep 2016 10:37:22 +1000 From: David Gibson Message-ID: <20160923003722.GL2085@umbus.fritz.box> References: <1474266577-11704-1-git-send-email-nikunj@linux.vnet.ibm.com> <1474266577-11704-6-git-send-email-nikunj@linux.vnet.ibm.com> <20160921234011.GG1809@umbus.fritz.box> <1d8585c6-d204-9c19-67d0-929681ee7f0e@kaod.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gwtGiOGliFx8mAnm" Content-Disposition: inline In-Reply-To: <1d8585c6-d204-9c19-67d0-929681ee7f0e@kaod.org> Subject: Re: [Qemu-devel] [PATCH v4 5/9] ppc/xics: Use a helper to add a new ICS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: Nikunj A Dadhania , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, benh@kernel.crashing.org --gwtGiOGliFx8mAnm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 22, 2016 at 08:21:00AM +0200, C=E9dric Le Goater wrote: > On 09/22/2016 01:40 AM, David Gibson wrote: > > On Mon, Sep 19, 2016 at 11:59:33AM +0530, Nikunj A Dadhania wrote: > >> From: Benjamin Herrenschmidt > >> > >> Signed-off-by: Benjamin Herrenschmidt > >> [Move object allocation and adding child to the helper] > >> Signed-off-by: Nikunj A Dadhania > >> Reviewed-by: David Gibson > >> --- > >> hw/intc/xics.c | 10 ++++++++++ > >> hw/intc/xics_spapr.c | 6 +----- > >> include/hw/ppc/xics.h | 1 + > >> 3 files changed, 12 insertions(+), 5 deletions(-) > >> > >> diff --git a/hw/intc/xics.c b/hw/intc/xics.c > >> index 05e938f..c7901c4 100644 > >> --- a/hw/intc/xics.c > >> +++ b/hw/intc/xics.c > >> @@ -109,6 +109,16 @@ static void xics_common_reset(DeviceState *d) > >> } > >> } > >> =20 > >> +void xics_add_ics(XICSState *xics) > >> +{ > >> + ICSState *ics; > >> + > >> + ics =3D ICS(object_new(TYPE_ICS)); > >> + object_property_add_child(OBJECT(xics), "ics", OBJECT(ics), NULL); > >=20 > > You'll need to construct a name here so you don't have all the ics > > objects called an indistinguishable "ics". >=20 > Yes, exactly, and so PowerNV does not use it because at least three ics= =20 > are needed :=20 >=20 > qemu) info qom-tree=20 > /machine (powernv-machine) > /unattached (container) > /sysbus (System) > /ipmi-bt[0] (qemu:memory-region) > /device[0] (pnv-phb3) > /ics-phb-lsi (ics) > /ics-phb-msi (phb3-msi) >=20 > ... >=20 > /psi (pnv-psi) > /xscom-psi[0] (qemu:memory-region) > /psihb[0] (qemu:memory-region) > /ics-psi (ics) >=20 >=20 > I think we can drop that patch.=20 >=20 >=20 > However some routine like this one : >=20 > +void xics_insert_ics(XICSState *xics, ICSState *ics) > +{ > + ics->xics =3D xics; > + QLIST_INSERT_HEAD(&xics->ics, ics, list); > +} > + >=20 > would be useful to hide the list details below xics : Yes, that makes sense. >=20 >=20 > /* link in the PSI ICS */ > xics_insert_ics(XICS_COMMON(&chip->xics), &chip->psi.ics); >=20 > .... >=20 > /* insert the ICS in XICS */ > xics_insert_ics(xics, phb->lsi_ics); > xics_insert_ics(xics, ICS_BASE(phb->msis)); >=20 >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --gwtGiOGliFx8mAnm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJX5HlBAAoJEGw4ysog2bOSzNgQAM3LFtGol8i4GMHOPnkmwGIt 05ArTdIZkya4eq2sGayZGCroHImwKHxaHCedwEfBj0LcfPGRQuwuqe+kL67Qx0Tj WQU31ZhMQ1SljaRDHgUiPyLxsvVsOhnA2OrqBoZ8ypZ61lUePMV9b73ozELKJyoo d/vOOyXRsbf0bQ/nL4zzvp7umy6zrlVFBnJKPRfZgeR9+uHUDWlJCboHAEd+iemZ yp4X9Sl0+QJ/OMdJDtCWrZ/BXLn1vcOUZLaAB2zmZSG677Ej2CZ0Kq8DhKc+s2xg DmtOfUS2KVQkaYne9PbaIZ9BTBraS+VeQm9P3BgxGuZM1IOpuaogBaZkix/UnKoG mQfmhV14N3kAolRmXP6MNOqYw+GEI1C+oUAbotxWNtLeHXOehtusVOQteOhKxQKk OYH3NvBeNpdxA2B3PMW910sgDRdEWVVMeht3ZImRaf6vGmC8iygItLzPDCicFP8H 94mKrRhfyheJ4gTXEQglXidZ6xS9AUsAQit7Qm28sUgxfDfa2dAbBPbP0AYuMElm PEQbncYKKG0xay5W68i8octoC+za/I5gj39Cl9j6pGp7bN7C6g9GRkeRJ+ic7TB3 RipJ0MSARFZAnZe3RR4KiAFnt9En72vgu2KILanqpBuqE6CHDmfC5WFldIkJ+r1C 0my2Upja/nGtrcSh3uxY =r/hM -----END PGP SIGNATURE----- --gwtGiOGliFx8mAnm--