[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [RFC PATCH v2 02/23] spapr: Add DRC dt entries for CPUs
From: |
Bharata B Rao |
Subject: |
Re: [Qemu-ppc] [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.
- [Qemu-ppc] [RFC PATCH v2 00/23] CPU and Memory hotplug for PowerPC sPAPR guests, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 01/23] spapr: enable PHB/CPU/LMB hotplug for pseries-2.3, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 03/23] spapr: Consider max_cpus during xics initialization, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 05/23] spapr: Reorganize CPU dt generation code, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 02/23] spapr: Add DRC dt entries for CPUs, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 04/23] spapr: Support ibm, lrdr-capacity device tree property, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 06/23] spapr: Consolidate cpu init code into a routine, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 08/23] ppc: Prepare CPU socket/core abstraction, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 09/23] spapr: Add CPU hotplug handler, Bharata B Rao, 2015/03/23
- [Qemu-ppc] [RFC PATCH v2 07/23] cpu: Prepare Socket container type, Bharata B Rao, 2015/03/23