qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH v2 02/23] spapr: Add DRC dt entries for CPUs


From: Bharata B Rao
Subject: Re: [Qemu-devel] [RFC PATCH v2 02/23] spapr: Add DRC dt entries for CPUs
Date: Wed, 25 Mar 2015 10:32:32 +0530
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Mar 25, 2015 at 11:07:10AM +1100, David Gibson wrote:
> On Mon, Mar 23, 2015 at 07:05:43PM +0530, Bharata B Rao wrote:
> > Advertise CPU DR-capability to the guest via device tree.
> > 
> > Signed-off-by: Bharata B Rao <address@hidden>
> > Signed-off-by: Michael Roth <address@hidden>
> >                [spapr_drc_reset implementation]
> > Reviewed-by: David Gibson <address@hidden>
> > ---
> >  hw/ppc/spapr.c | 29 +++++++++++++++++++++++++++++
> >  1 file changed, 29 insertions(+)
> > 
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index a782e28..920e650 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -807,6 +807,15 @@ static void spapr_finalize_fdt(sPAPREnvironment *spapr,
> >          spapr_populate_chosen_stdout(fdt, spapr->vio_bus);
> >      }
> >  
> > +    if (spapr->dr_cpu_enabled) {
> > +        int offset = fdt_path_offset(fdt, "/cpus");
> > +        ret = spapr_drc_populate_dt(fdt, offset, NULL,
> > +                                    SPAPR_DR_CONNECTOR_TYPE_CPU);
> > +        if (ret < 0) {
> > +            fprintf(stderr, "Couldn't set up CPU DR device tree 
> > properties\n");
> > +        }
> > +    }
> > +
> >      _FDT((fdt_pack(fdt)));
> >  
> >      if (fdt_totalsize(fdt) > FDT_MAX_SIZE) {
> > @@ -1393,6 +1402,16 @@ static SaveVMHandlers savevm_htab_handlers = {
> >      .load_state = htab_load,
> >  };
> >  
> > +static void spapr_drc_reset(void *opaque)
> > +{
> > +    sPAPRDRConnector *drc = opaque;
> > +    DeviceState *d = DEVICE(drc);
> > +
> > +    if (d) {
> > +        device_reset(d);
> > +    }
> > +}
> > +
> >  /* pSeries LPAR / sPAPR hardware init */
> >  static void ppc_spapr_init(MachineState *machine)
> >  {
> > @@ -1418,6 +1437,7 @@ static void ppc_spapr_init(MachineState *machine)
> >      long load_limit, fw_size;
> >      bool kernel_le = false;
> >      char *filename;
> > +    int smt = kvmppc_smt_threads();
> >  
> >      msi_supported = true;
> >  
> > @@ -1564,6 +1584,15 @@ static void ppc_spapr_init(MachineState *machine)
> >      spapr->dr_cpu_enabled = smc->dr_cpu_enabled;
> >      spapr->dr_lmb_enabled = smc->dr_lmb_enabled;
> >  
> > +    if (spapr->dr_cpu_enabled) {
> > +        for (i = 0; i < max_cpus/smp_threads; i++) {
> > +            sPAPRDRConnector *drc =
> > +                spapr_dr_connector_new(OBJECT(machine),
> > +                                       SPAPR_DR_CONNECTOR_TYPE_CPU, i * 
> > smt);
> > +            qemu_register_reset(spapr_drc_reset, drc);
> 
> This seems to be per-core, rather than per-socket as your patch
> comments suggest.

Though we initialize socket-wise at boot time and add one CPU socket
at a time during hot add, the DR connectors are still per-core. 
ibm,my-drc-index property is still per-core.

Also the hotplug event that is sent to the kernel is  per-core and kernel
will bring up one full core (including all its thread) in response to
hot-add.

Socket addition is just a higher level notion but we still do hotplug
at core-level underneath.

Regards,
Bharata.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]