From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gesZj-0002bb-6t for qemu-devel@nongnu.org; Wed, 02 Jan 2019 21:17:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gesZh-0005Bb-8D for qemu-devel@nongnu.org; Wed, 02 Jan 2019 21:17:35 -0500 Date: Thu, 3 Jan 2019 13:13:44 +1100 From: David Gibson Message-ID: <20190103021344.GM10853@umbus.fritz.box> References: <154535246529.862554.6113740443866753456.stgit@bahia.lan> <154537411408.891668.13796612948399384908.stgit@bahia.lan> <285a22ed-c71b-b9de-e01a-f0ada3ca6ae4@kaod.org> <20181221105313.119c021a@bahia.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pP0ycGQONqsnqIMP" Content-Disposition: inline In-Reply-To: <20181221105313.119c021a@bahia.lan> Subject: Re: [Qemu-devel] [PATCH 14/15] spapr: Expose the name of the interrupt controller node List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: =?iso-8859-1?Q?C=E9dric?= Le Goater , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Alexey Kardashevskiy , Michael Roth , Paolo Bonzini , "Michael S. Tsirkin" , Marcel Apfelbaum , Eduardo Habkost , David Hildenbrand , Cornelia Huck , Gerd Hoffmann , Dmitry Fleytman --pP0ycGQONqsnqIMP Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 21, 2018 at 10:53:13AM +0100, Greg Kurz wrote: > On Fri, 21 Dec 2018 09:12:24 +0100 > C=E9dric Le Goater wrote: >=20 > > On 12/21/18 7:35 AM, Greg Kurz wrote: > > > This will be needed by PHB hotplug in order to access the phandle pro= perty. > > >=20 > > > Signed-off-by: Greg Kurz =20 > >=20 > > I would have used the prefix 'spapr_dt_', but it's minor. > >=20 >=20 > I guess there might be a v2. I'll do the change. Actually, don't. I'm standardizing on spapr_dt_* for functions which generate pieces of the device tree. This helper is related, but doesn't really fit that pattern. >=20 > > Reviewed-by: C=E9dric Le Goater > >=20 >=20 > Thanks! >=20 > > Thanks, > >=20 > > C. > >=20 > > > --- > > > hw/intc/spapr_xive.c | 9 +++++++-- > > > hw/intc/xics_spapr.c | 9 ++++++++- > > > hw/ppc/spapr_irq.c | 3 +++ > > > include/hw/ppc/spapr_irq.h | 1 + > > > include/hw/ppc/spapr_xive.h | 1 + > > > include/hw/ppc/xics.h | 1 + > > > 6 files changed, 21 insertions(+), 3 deletions(-) > > >=20 > > > diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c > > > index 87424de26c1c..0540aac88d2a 100644 > > > --- a/hw/intc/spapr_xive.c > > > +++ b/hw/intc/spapr_xive.c > > > @@ -1410,6 +1410,12 @@ void spapr_xive_hcall_init(sPAPRMachineState *= spapr) > > > spapr_register_hypercall(H_INT_RESET, h_int_reset); > > > } > > > =20 > > > +gchar *spapr_xive_get_nodename(sPAPRMachineState *spapr) > > > +{ > > > + return g_strdup_printf("interrupt-controller@%" PRIx64, > > > + spapr->xive->tm_base + XIVE_TM_USER_PAGE * (1 <<= TM_SHIFT)); > > > +} > > > + > > > void spapr_dt_xive(sPAPRMachineState *spapr, uint32_t nr_servers, vo= id *fdt, > > > uint32_t phandle) > > > { > > > @@ -1444,8 +1450,7 @@ void spapr_dt_xive(sPAPRMachineState *spapr, ui= nt32_t nr_servers, void *fdt, > > > XIVE_TM_OS_PAGE * (1ull << TM_SHIFT)); > > > timas[3] =3D cpu_to_be64(1ull << TM_SHIFT); > > > =20 > > > - nodename =3D g_strdup_printf("interrupt-controller@%" PRIx64, > > > - xive->tm_base + XIVE_TM_USER_PAGE * (1 <<= TM_SHIFT)); > > > + nodename =3D spapr_xive_get_nodename(spapr); > > > _FDT(node =3D fdt_add_subnode(fdt, 0, nodename)); > > > g_free(nodename); > > > =20 > > > diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c > > > index f67d3c80bf3a..75d40daf518d 100644 > > > --- a/hw/intc/xics_spapr.c > > > +++ b/hw/intc/xics_spapr.c > > > @@ -244,6 +244,13 @@ void xics_spapr_init(sPAPRMachineState *spapr) > > > spapr_register_hypercall(H_IPOLL, h_ipoll); > > > } > > > =20 > > > +#define NODENAME "interrupt-controller" > > > + > > > +gchar *spapr_xics_get_nodename(sPAPRMachineState *spapr) > > > +{ > > > + return g_strdup(NODENAME); > > > +} > > > + > > > void spapr_dt_xics(sPAPRMachineState *spapr, uint32_t nr_servers, vo= id *fdt, > > > uint32_t phandle) > > > { > > > @@ -252,7 +259,7 @@ void spapr_dt_xics(sPAPRMachineState *spapr, uint= 32_t nr_servers, void *fdt, > > > }; > > > int node; > > > =20 > > > - _FDT(node =3D fdt_add_subnode(fdt, 0, "interrupt-controller")); > > > + _FDT(node =3D fdt_add_subnode(fdt, 0, NODENAME)); > > > =20 > > > _FDT(fdt_setprop_string(fdt, node, "device_type", > > > "PowerPC-External-Interrupt-Presentation= ")); > > > diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c > > > index 0999a2b2d69c..703c3a3c20d5 100644 > > > --- a/hw/ppc/spapr_irq.c > > > +++ b/hw/ppc/spapr_irq.c > > > @@ -223,6 +223,7 @@ sPAPRIrq spapr_irq_xics =3D { > > > .qirq =3D spapr_qirq_xics, > > > .print_info =3D spapr_irq_print_info_xics, > > > .dt_populate =3D spapr_dt_xics, > > > + .get_nodename =3D spapr_xics_get_nodename, > > > .cpu_intc_create =3D spapr_irq_cpu_intc_create_xics, > > > .post_load =3D spapr_irq_post_load_xics, > > > }; > > > @@ -349,6 +350,7 @@ sPAPRIrq spapr_irq_xive =3D { > > > .qirq =3D spapr_qirq_xive, > > > .print_info =3D spapr_irq_print_info_xive, > > > .dt_populate =3D spapr_dt_xive, > > > + .get_nodename =3D spapr_xive_get_nodename, > > > .cpu_intc_create =3D spapr_irq_cpu_intc_create_xive, > > > .post_load =3D spapr_irq_post_load_xive, > > > .reset =3D spapr_irq_reset_xive, > > > @@ -462,6 +464,7 @@ sPAPRIrq spapr_irq_xics_legacy =3D { > > > .qirq =3D spapr_qirq_xics, > > > .print_info =3D spapr_irq_print_info_xics, > > > .dt_populate =3D spapr_dt_xics, > > > + .get_nodename =3D spapr_xics_get_nodename, > > > .cpu_intc_create =3D spapr_irq_cpu_intc_create_xics, > > > .post_load =3D spapr_irq_post_load_xics, > > > }; > > > diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h > > > index b34d5a00381b..59a1cf8bbc1d 100644 > > > --- a/include/hw/ppc/spapr_irq.h > > > +++ b/include/hw/ppc/spapr_irq.h > > > @@ -42,6 +42,7 @@ typedef struct sPAPRIrq { > > > void (*print_info)(sPAPRMachineState *spapr, Monitor *mon); > > > void (*dt_populate)(sPAPRMachineState *spapr, uint32_t nr_server= s, > > > void *fdt, uint32_t phandle); > > > + gchar *(*get_nodename)(sPAPRMachineState *spapr); > > > Object *(*cpu_intc_create)(sPAPRMachineState *spapr, Object *cpu, > > > Error **errp); > > > int (*post_load)(sPAPRMachineState *spapr, int version_id); > > > diff --git a/include/hw/ppc/spapr_xive.h b/include/hw/ppc/spapr_xive.h > > > index 728735dbcfbe..d280310ed587 100644 > > > --- a/include/hw/ppc/spapr_xive.h > > > +++ b/include/hw/ppc/spapr_xive.h > > > @@ -47,6 +47,7 @@ typedef struct sPAPRMachineState sPAPRMachineState; > > > void spapr_xive_hcall_init(sPAPRMachineState *spapr); > > > void spapr_dt_xive(sPAPRMachineState *spapr, uint32_t nr_servers, vo= id *fdt, > > > uint32_t phandle); > > > +gchar *spapr_xive_get_nodename(sPAPRMachineState *spapr); > > > void spapr_xive_set_tctx_os_cam(XiveTCTX *tctx); > > > =20 > > > #endif /* PPC_SPAPR_XIVE_H */ > > > diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h > > > index 14afda198cdb..eafb6428787f 100644 > > > --- a/include/hw/ppc/xics.h > > > +++ b/include/hw/ppc/xics.h > > > @@ -204,6 +204,7 @@ typedef struct sPAPRMachineState sPAPRMachineStat= e; > > > =20 > > > void spapr_dt_xics(sPAPRMachineState *spapr, uint32_t nr_servers, vo= id *fdt, > > > uint32_t phandle); > > > +gchar *spapr_xics_get_nodename(sPAPRMachineState *spapr); > > > int xics_kvm_init(sPAPRMachineState *spapr, Error **errp); > > > void xics_spapr_init(sPAPRMachineState *spapr); > > > =20 > > > =20 > >=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 --pP0ycGQONqsnqIMP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEdfRlhq5hpmzETofcbDjKyiDZs5IFAlwtb9gACgkQbDjKyiDZ s5Lg7w//W9RWBt0uwTggqfn0WRir38VaqoDlvb1NYlmIlHWhLquXGBXegVinVmGY TDVTO+3iE9s+GsR2TI5s1MCqutT76jQs9YyzZ9JbZ0ogYgzMfiHT5wPFAsJAdoyF /jOm8vqGQ3jXFyay5hqF5aaWE7W2DblBzDtX2o0/2P9iTF3vmlmECXjaPONfIO4f 32+coHNCvySHMwMU/n3DFuv3l4JVWQdRT92zWWfRoZbYYjliZDpLZMOUyKWOGPI2 qAIRIXj40BWj6z9M34uo7DotwDIpkpdIVADMkAlIpXVu7ti0BjfRVZzMmS5L+aq8 SHTb7UNcJ6DZMLyyXtGETCSTPA66JvxFpQnUOadjDCWO1ibl0NVlH4923gXkbO02 xw9a/eLXpzvYsOANoTswdg91/pBAiATfqa91yxwCd6hjLCUwwrrCmp0bl+csR/8a CsofKHWFy3Gm65V4hk9G7ui8ZdfYzqFfUUPGsmNsqmHcoUpfohLsmtcxkjvIBRMJ iWuQ3TLUWmUN4GixPIotFB27xOy08ej61/Ol3IhP3+3qVhNX6jUhBXP6SqYcoT55 4GbaVA1Iy8HldieG02lDqwHoM7G06RxhzsZ3V1p6BWTSJM2wUnNPRmmAee6DVe8d t1ZT7hhR/jLmpxo/JEHuto3F72CPj86QdO91OQlDqlJ5xxqh+X4= =JT6K -----END PGP SIGNATURE----- --pP0ycGQONqsnqIMP--