qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: "Cédric Le Goater" <clg@kaod.org>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	qemu-s390x@nongnu.org, David Gibson <david@gibson.dropbear.id.au>,
	Alexey Kardashevskiy <aik@ozlabs.ru>,
	Michael Roth <mdroth@linux.vnet.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	David Hildenbrand <david@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Dmitry Fleytman <dmitry.fleytman@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 14/15] spapr: Expose the name of the interrupt controller node
Date: Fri, 21 Dec 2018 10:53:13 +0100	[thread overview]
Message-ID: <20181221105313.119c021a@bahia.lan> (raw)
In-Reply-To: <285a22ed-c71b-b9de-e01a-f0ada3ca6ae4@kaod.org>

On Fri, 21 Dec 2018 09:12:24 +0100
Cédric Le Goater <clg@kaod.org> wrote:

> On 12/21/18 7:35 AM, Greg Kurz wrote:
> > This will be needed by PHB hotplug in order to access the phandle property.
> > 
> > Signed-off-by: Greg Kurz <groug@kaod.org>  
> 
> I would have used the prefix 'spapr_dt_', but it's minor.
> 

I guess there might be a v2. I'll do the change.

> Reviewed-by: Cédric Le Goater <clg@kaod.org>
> 

Thanks!

> Thanks,
> 
> C.
> 
> > ---
> >  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(-)
> > 
> > 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);
> >  }
> >  
> > +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, void *fdt,
> >                     uint32_t phandle)
> >  {
> > @@ -1444,8 +1450,7 @@ void spapr_dt_xive(sPAPRMachineState *spapr, uint32_t nr_servers, void *fdt,
> >                             XIVE_TM_OS_PAGE * (1ull << TM_SHIFT));
> >      timas[3] = cpu_to_be64(1ull << TM_SHIFT);
> >  
> > -    nodename = g_strdup_printf("interrupt-controller@%" PRIx64,
> > -                           xive->tm_base + XIVE_TM_USER_PAGE * (1 << TM_SHIFT));
> > +    nodename = spapr_xive_get_nodename(spapr);
> >      _FDT(node = fdt_add_subnode(fdt, 0, nodename));
> >      g_free(nodename);
> >  
> > 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);
> >  }
> >  
> > +#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, void *fdt,
> >                     uint32_t phandle)
> >  {
> > @@ -252,7 +259,7 @@ void spapr_dt_xics(sPAPRMachineState *spapr, uint32_t nr_servers, void *fdt,
> >      };
> >      int node;
> >  
> > -    _FDT(node = fdt_add_subnode(fdt, 0, "interrupt-controller"));
> > +    _FDT(node = fdt_add_subnode(fdt, 0, NODENAME));
> >  
> >      _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 = {
> >      .qirq        = spapr_qirq_xics,
> >      .print_info  = spapr_irq_print_info_xics,
> >      .dt_populate = spapr_dt_xics,
> > +    .get_nodename = spapr_xics_get_nodename,
> >      .cpu_intc_create = spapr_irq_cpu_intc_create_xics,
> >      .post_load   = spapr_irq_post_load_xics,
> >  };
> > @@ -349,6 +350,7 @@ sPAPRIrq spapr_irq_xive = {
> >      .qirq        = spapr_qirq_xive,
> >      .print_info  = spapr_irq_print_info_xive,
> >      .dt_populate = spapr_dt_xive,
> > +    .get_nodename = spapr_xive_get_nodename,
> >      .cpu_intc_create = spapr_irq_cpu_intc_create_xive,
> >      .post_load   = spapr_irq_post_load_xive,
> >      .reset       = spapr_irq_reset_xive,
> > @@ -462,6 +464,7 @@ sPAPRIrq spapr_irq_xics_legacy = {
> >      .qirq        = spapr_qirq_xics,
> >      .print_info  = spapr_irq_print_info_xics,
> >      .dt_populate = spapr_dt_xics,
> > +    .get_nodename = spapr_xics_get_nodename,
> >      .cpu_intc_create = spapr_irq_cpu_intc_create_xics,
> >      .post_load   = 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_servers,
> >                          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, void *fdt,
> >                     uint32_t phandle);
> > +gchar *spapr_xive_get_nodename(sPAPRMachineState *spapr);
> >  void spapr_xive_set_tctx_os_cam(XiveTCTX *tctx);
> >  
> >  #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 sPAPRMachineState;
> >  
> >  void spapr_dt_xics(sPAPRMachineState *spapr, uint32_t nr_servers, void *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);
> >  
> >   
> 

  reply	other threads:[~2018-12-21  9:53 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21  0:34 [Qemu-devel] [PATCH 00/15] spapr: Add support for PHB hotplug Greg Kurz
2018-12-21  0:34 ` [Qemu-devel] [PATCH 01/15] ppc/spapr: Receive and store device tree blob from SLOF Greg Kurz
2018-12-21 17:39   ` [Qemu-devel] [Qemu-ppc] " Murilo Opsfelder Araujo
2019-01-02  3:25     ` David Gibson
2019-01-03  0:32   ` [Qemu-devel] " David Gibson
2018-12-21  0:35 ` [Qemu-devel] [PATCH 02/15] spapr: move spapr_create_phb() to core machine code Greg Kurz
2019-01-03  0:33   ` David Gibson
2018-12-21  0:35 ` [Qemu-devel] [PATCH 03/15] pci: allow cleanup/unregistration of PCI root buses Greg Kurz
2018-12-21 16:19   ` Michael S. Tsirkin
2019-01-03  0:36     ` David Gibson
2019-01-03  3:27       ` Michael S. Tsirkin
2019-01-03  3:41         ` David Gibson
2018-12-21  0:35 ` [Qemu-devel] [PATCH 04/15] spapr_pci: add proper rollback on PHB realize error path Greg Kurz
2019-01-03  1:59   ` David Gibson
2019-01-07 16:40     ` Greg Kurz
2018-12-21  0:36 ` [Qemu-devel] [PATCH 05/15] spapr_pci: add PHB unrealize Greg Kurz
2018-12-21  0:36 ` [Qemu-devel] [PATCH 06/15] spapr: enable PHB hotplug for default pseries machine type Greg Kurz
2019-01-03  2:00   ` David Gibson
2019-01-08  9:55     ` Greg Kurz
2018-12-21  0:36 ` [Qemu-devel] [PATCH 07/15] spapr_pci: Define SPAPR_MAX_PHBS in hw/pci-host/spapr.h Greg Kurz
2018-12-21  8:03   ` Cédric Le Goater
2018-12-21  9:50     ` Greg Kurz
2019-01-03  2:07   ` David Gibson
2018-12-21  0:37 ` [Qemu-devel] [PATCH 08/15] spapr: create DR connectors for PHBs Greg Kurz
2018-12-21  0:37 ` [Qemu-devel] [PATCH 09/15] spapr: populate PHB DRC entries for root DT node Greg Kurz
2018-12-21  0:37 ` [Qemu-devel] [PATCH 10/15] spapr_events: add support for phb hotplug events Greg Kurz
2018-12-21  0:38 ` [Qemu-devel] [PATCH 11/15] qdev: pass an Object * to qbus_set_hotplug_handler() Greg Kurz
2018-12-21  0:38 ` [Qemu-devel] [PATCH 12/15] spapr_pci: provide node start offset via spapr_populate_pci_dt() Greg Kurz
2018-12-21  0:38 ` [Qemu-devel] [PATCH 13/15] spapr_pci: add ibm, my-drc-index property for PHB hotplug Greg Kurz
2018-12-21  6:35 ` [Qemu-devel] [PATCH 14/15] spapr: Expose the name of the interrupt controller node Greg Kurz
2018-12-21  8:12   ` Cédric Le Goater
2018-12-21  9:53     ` Greg Kurz [this message]
2019-01-03  2:13       ` David Gibson
2018-12-21  6:36 ` [Qemu-devel] [PATCH 15/15] spapr: add hotplug hooks for PHB hotplug Greg Kurz
2019-01-03  2:17   ` David Gibson
2019-01-08 10:18     ` Greg Kurz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181221105313.119c021a@bahia.lan \
    --to=groug@kaod.org \
    --cc=aik@ozlabs.ru \
    --cc=clg@kaod.org \
    --cc=cohuck@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=david@redhat.com \
    --cc=dmitry.fleytman@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcel@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).