From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEfHf-0000sK-Oe for qemu-devel@nongnu.org; Wed, 28 Aug 2013 08:55:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEfHb-0007Ie-Ns for qemu-devel@nongnu.org; Wed, 28 Aug 2013 08:55:39 -0400 Date: Wed, 28 Aug 2013 21:42:03 +1000 From: David Gibson Message-ID: <20130828114203.GB2944@voom.redhat.com> References: <1377682371-12586-1-git-send-email-aik@ozlabs.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wq9mPyueHGvFACwf" Content-Disposition: inline In-Reply-To: <1377682371-12586-1-git-send-email-aik@ozlabs.ru> Subject: Re: [Qemu-devel] [PATCH v2] spapr: add "stop-self" RTAS call required to support hot CPU unplug List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Paolo Bonzini , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, Alexander Graf --wq9mPyueHGvFACwf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 28, 2013 at 07:32:51PM +1000, Alexey Kardashevskiy wrote: > PAPR+ requires two RTAS calls to be supported by the hypervisor in > order to allow hotplugging VCPUs from the guest. The "start-cpu" RTAS > call was already there but "stop-self" was not. >=20 > This adds the "stop-self" RTAS call. >=20 > Signed-off-by: Alexey Kardashevskiy > --- > Changes: > v2: > * exit_request flag change replaced with more correct cpu_exit() call > * fixed commit message, "spapr: support CPU hotplug" > --- > hw/ppc/spapr_rtas.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) >=20 > diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c > index 394ce05..b906294 100644 > --- a/hw/ppc/spapr_rtas.c > +++ b/hw/ppc/spapr_rtas.c > @@ -202,6 +202,17 @@ static void rtas_start_cpu(PowerPCCPU *cpu_, sPAPREn= vironment *spapr, > rtas_st(rets, 0, -3); > } > =20 > +static void rtas_stop_self(PowerPCCPU *cpu, sPAPREnvironment *spapr, > + uint32_t token, uint32_t nargs, > + target_ulong args, > + uint32_t nret, target_ulong rets) > +{ > + CPUState *cs =3D CPU(cpu); > + > + cs->halted =3D 1; Uh.. I think you still need the msr =3D 0, or an interrupt could wake the cpu up again. > + cpu_exit(cs); > +} > + > static struct rtas_call { > const char *name; > spapr_rtas_fn fn; > @@ -322,6 +333,7 @@ static void core_rtas_register_types(void) > spapr_rtas_register("query-cpu-stopped-state", > rtas_query_cpu_stopped_state); > spapr_rtas_register("start-cpu", rtas_start_cpu); > + spapr_rtas_register("stop-self", rtas_stop_self); > } > =20 > type_init(core_rtas_register_types) --=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 --wq9mPyueHGvFACwf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQIcBAEBAgAGBQJSHeILAAoJEGw4ysog2bOSqUwQAJZ3AmMcfRkfRXydPvMkm0tT U8o1nVpG9PhEIeRiGPaLVhsOFf2Wp6WG7eyG3UXt8dTUTRH+U2P35X6+o8fyikTg DTeq2SzK16ruhVgQN9eLajcg45BX5L+oix21K3LdkSqBWrJR78S7I3cvVF4xy4/+ FIiQb//kWt2P5IQUkIAYf/Y660pH/dxfVTY8bGAbklZF8Vux7he0+7tVQEz2zNRC QtcEwsAhhCGa84aMd88JRYGpDOeMudqj6Lh4KzvSO99qWdohVPolq1tcGeoCuKJe RLB5/fFAOPJPqEKdIZ4WZsSH35J3P6AxY6FtzLfzkqCgC0+Kp7UvaS0ENbeXyY4u 3eA2wh4oZk3VM9W4KFS6vD3k5S/swb9H/xm82jENkZb9LcUgneGHVa4EUTwByzBr EcBQIeGLIaNwWWBeCbrt88VUutt4gcSxpMQGhhoITDY9GT14/qBzgOnsKQnJvzRj uB0YLT66PFLz4g+PW43YHpHRr6jvLqWwQCkW5KnKvk8y1eYtpdxGdoxkhh/aOE4h gCBIs2QzAw/oWNSDTN1OFC05DPZuPIYPix3YCWtZy88GA89UMo9J7no6VFYwqKuh 1Xu8QFXrLBgyFBk882neT7ghTPBkHUchMG4MAFFlyVnvK10wjgh3NYalPvM53iH7 Z79SPhdjbLi//5NHCVGH =DFaj -----END PGP SIGNATURE----- --wq9mPyueHGvFACwf--