From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaxFY-0006op-WD for qemu-devel@nongnu.org; Wed, 25 Mar 2015 22:10:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaxFR-0003av-5n for qemu-devel@nongnu.org; Wed, 25 Mar 2015 22:10:24 -0400 Date: Thu, 26 Mar 2015 12:42:45 +1100 From: David Gibson Message-ID: <20150326014245.GJ28039@voom.redhat.com> References: <1427117764-23008-1-git-send-email-bharata@linux.vnet.ibm.com> <1427117764-23008-13-git-send-email-bharata@linux.vnet.ibm.com> <20150325030345.GW25043@voom.fritz.box> <20150325083629.GD32581@in.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GlnCQLZWzqLRJED8" Content-Disposition: inline In-Reply-To: <20150325083629.GD32581@in.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v2 12/23] spapr: CPU hotplug support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, imammedo@redhat.com, afaerber@suse.de --GlnCQLZWzqLRJED8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 25, 2015 at 02:06:29PM +0530, Bharata B Rao wrote: > On Wed, Mar 25, 2015 at 02:03:45PM +1100, David Gibson wrote: > > On Mon, Mar 23, 2015 at 07:05:53PM +0530, Bharata B Rao wrote: > > > Support CPU hotplug via device-add command. Set up device tree > > > entries for the hotplugged CPU core and use the exising EPOW event > > > infrastructure to send CPU hotplug notification to the guest. > > >=20 > > > Signed-off-by: Bharata B Rao > > > --- > > > hw/ppc/spapr.c | 75 +++++++++++++++++++++++++++++++++++++++++= ++++++++++ > > > hw/ppc/spapr_events.c | 8 +++--- > > > hw/ppc/spapr_rtas.c | 11 ++++++++ > > > 3 files changed, 91 insertions(+), 3 deletions(-) > > >=20 > > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > > > index f52d38f..b48994b 100644 > > > --- a/hw/ppc/spapr.c > > > +++ b/hw/ppc/spapr.c > > > @@ -33,6 +33,7 @@ > > > #include "sysemu/block-backend.h" > > > #include "sysemu/cpus.h" > > > #include "sysemu/kvm.h" > > > +#include "sysemu/device_tree.h" > > > #include "kvm_ppc.h" > > > #include "mmu-hash64.h" > > > #include "qom/cpu.h" > > > @@ -660,6 +661,10 @@ static void spapr_populate_cpu_dt(CPUState *cs, = void *fdt, int offset) > > > QemuOpts *opts =3D qemu_opts_find(qemu_find_opts("smp-opts"), NU= LL); > > > unsigned sockets =3D opts ? qemu_opt_get_number(opts, "sockets",= 0) : 0; > > > uint32_t cpus_per_socket =3D sockets ? (smp_cpus / sockets) : 1; > > > + sPAPRDRConnector *drc =3D > > > + spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_CPU, index); > > > + sPAPRDRConnectorClass *drck =3D SPAPR_DR_CONNECTOR_GET_CLASS(drc= ); > > > + int drc_index =3D drck->get_index(drc); > > > =20 > > > _FDT((fdt_setprop_cell(fdt, offset, "reg", index))); > > > _FDT((fdt_setprop_string(fdt, offset, "device_type", "cpu"))); > > > @@ -728,6 +733,8 @@ static void spapr_populate_cpu_dt(CPUState *cs, v= oid *fdt, int offset) > > > =20 > > > _FDT((fdt_setprop_cell(fdt, offset, "ibm,chip-id", > > > cs->cpu_index / cpus_per_socket))); > > > + _FDT((fdt_setprop_cell(fdt, offset, "ibm,my-drc-index", drc_inde= x))); > > > + > >=20 > > What effect will this have when running with DR disabled? >=20 > I realize now that I shouldn't probably populate this at all in that case. > This routine is now common for both bootpath and hotplug path. Will take > care of this in next post. Ok. [snip] > > > +static void spapr_cpu_set_endianness(PowerPCCPU *cpu) > > > +{ > > > + PowerPCCPU *fcpu =3D POWERPC_CPU(first_cpu); > > > + PowerPCCPUClass *pcc =3D POWERPC_CPU_GET_CLASS(fcpu); > >=20 > > In some ways it might be nicer to store the global endian mode in > > sPAPRMachineState, updating it on H_SET_MODE, rather than copying the > > first cpu, although I guess that works. >=20 > I can give it a stab at that if you feel strongly about it. Not that strongly. It's a small cleanup we can consider later. --=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 --GlnCQLZWzqLRJED8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVE2QVAAoJEGw4ysog2bOStmoP/27nS4p86miY/rtbjSSGET6/ v6cj+09fsTmdJ4gEwUqdGX9GYHXQAiRXRvqwzffwfPypwuJ/+TvZPFm8EAHfScZH xfQxk2yGvIJRIQfYl1hv4rdzvu+SkmHEIn+ZkUzTlHVnUgVz5t17x18rvAuX4lk7 6E4aReGblm+ChR0g37Gv/E4MGy3qYTkV4Ct9IQSANDnk2ZvjlLevgOlEihwMBB9H //C39Vjr0yRzwI0CF/E/uudPjjR3hjN0xceS6F36dQhkBbmOKvIMXeDTt9HGr61j FF2aOCnIBPXMBWuhVxjvQoLfuwZnU8Ytowt0ylLvVDG3sJlOxygMaEceSjfhcyLn BID47iByUqwgyMwmvDHiz5H3EsWxsxSrd9RDGYreMhQSWimmR4qKs0xTyIVbPHOC hko06qVHceHfOufphQZDNzEYFQbjyP/piWoIbSZ7zn4EcUz+vd2H3gRRyqwiWFj1 5FiCkozwted/tyoibWT3TUT98XmtvcLiqySUyiXHQSUtxoQ/d9yfkYEZ0R2F5gUm kVdTRMVpAQixiApr4y8UqmMRfjGb9ERagyguwJdq9cOMhbERgiwRuj/aCvxUliLh KxZ4hEkWTFz+Q9MoKxMtL24JP+PJa4Wjm/mcSP70g6SnhAOC3UnT9syXWTjxczcZ RRJ8Z9WJGR0AvFbELDWv =VHkr -----END PGP SIGNATURE----- --GlnCQLZWzqLRJED8--