From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bxOWd-0005We-RO for qemu-devel@nongnu.org; Thu, 20 Oct 2016 21:21:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bxOWc-0000By-Ik for qemu-devel@nongnu.org; Thu, 20 Oct 2016 21:21:35 -0400 Date: Fri, 21 Oct 2016 12:21:21 +1100 From: David Gibson Message-ID: <20161021012121.GA3111@umbus.fritz.box> References: <20161020065912.16132-1-npiggin@gmail.com> <20161020065912.16132-4-npiggin@gmail.com> <20161020184922.518a2e44@bahia> <20161021115634.4db238bc@roar.ozlabs.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bg08WKrSYDhXBjb5" Content-Disposition: inline In-Reply-To: <20161021115634.4db238bc@roar.ozlabs.ibm.com> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/3] ppc/spapr: implement H_SIGNAL_SYS_RESET List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nicholas Piggin Cc: Greg Kurz , qemu-devel@nongnu.org, qemu-ppc@nongnu.org --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 21, 2016 at 11:56:34AM +1100, Nicholas Piggin wrote: > On Thu, 20 Oct 2016 18:49:22 +0200 > Greg Kurz wrote: >=20 > > On Thu, 20 Oct 2016 17:59:12 +1100 > > Nicholas Piggin wrote: > >=20 > > > The H_SIGNAL_SYS_RESET hcall allows a guest CPU to raise a system > > > reset exception on other CPUs in the same guest. > > > =20 > >=20 > > Actually on all CPUs or all-but-self CPUs or a specific CPU (including = self). >=20 > Exactly right. I'll improve the changelog and try to add something more > official. >=20 > =20 > > > Signed-off-by: Nicholas Piggin > > > --- > > > hw/ppc/spapr_hcall.c | 42 ++++++++++++++++++++++++++++++++++++++++= ++ > > > include/hw/ppc/spapr.h | 8 +++++++- > > > 2 files changed, 49 insertions(+), 1 deletion(-) > > >=20 > > > diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c > > > index c5e7e8c..5ae84f0 100644 > > > --- a/hw/ppc/spapr_hcall.c > > > +++ b/hw/ppc/spapr_hcall.c > > > @@ -880,6 +880,47 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, = sPAPRMachineState *spapr, > > > return ret; > > > } > > > =20 > > > +static void do_sys_reset(CPUState *cs, void *arg) > > > +{ > > > + cpu_synchronize_state(cs); > > > + ppc_cpu_do_system_reset(cs); > > > +} > > > + =20 > >=20 > > We already have the following function in hw/ppc/spapr.c, which serves = the > > same purpose: > >=20 > > static void ppc_cpu_do_nmi_on_cpu(CPUState *cs, void *arg) > > { > > cpu_synchronize_state(cs); > > ppc_cpu_do_system_reset(cs); > > } > >=20 > > What about using it ? >=20 > I suppose. "nmi" isn't really architected, whereas system reset is. > I was considering ppc_cpu_do_nmi_on_cpu call do_sys_reset, but it > didn't seem like much of an improvement. I'll use a single function > for both if you prefer. I think system_reset is a better name, so it's probably best to rename the existing function. >=20 > > > --- a/include/hw/ppc/spapr.h > > > +++ b/include/hw/ppc/spapr.h > > > @@ -339,7 +339,13 @@ struct sPAPRMachineState { > > > #define H_XIRR_X 0x2FC > > > #define H_RANDOM 0x300 > > > #define H_SET_MODE 0x31C > > > -#define MAX_HCALL_OPCODE H_SET_MODE > > > +#define H_SIGNAL_SYS_RESET 0x380 > > > +#define MAX_HCALL_OPCODE H_SIGNAL_SYS_RESET > > > + > > > +/* Parameters to H_SIGNAL_SYS_RESET */ > > > +#define H_SIGNAL_SYS_RESET_ALL -1 > > > +#define H_SIGNAL_SYS_RESET_ALLBUTSELF -2 > > > + =20 > >=20 > > I'd rather move these to hw/ppc/spapr_hcall.c just above h_signal_sys_r= eset(), > > the same way it is done for h_bulk_remove(). >=20 > Will do. >=20 > Thanks, > Nick >=20 --=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 --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYCW2PAAoJEGw4ysog2bOS5+wQAM/ss1NbgLwDXBinYQBCXJtd Ak0by3Akkiix55I2ijplICeNkS8jcTB0mJvF4C/kpxBeoiTLlMFiO1tVLiAeMbRg NEPI0BFtyFkKPhXGkXhRBc5gM+RGyAeWVhLCms63sB3dgEzgjLO4pqUFTiIGxywH zruDfHo4hBLSe+euF6LccL8VL0P+0eRMR3QHdBAcOzCl0Fey3WWfBL2helUcBaJO 8NQ9nTbuQtXTKGzv7AQ0M4sANh4xYeluKKYgcTDlDDiemTk0MajzbAT2uGM7inAF OuLRjj+1Q2+a22uGwRmCOq3EtdXcHtI9u1hrE7bJTGWdv14yI05guvXPJf2aMmhL lJsm7jex9th7MQ4tCCpAjgN47wB018UQxezT078ru2wqHrSOD0YFtKn+SNa+h1Nm 5iZfQrIEtOn+s7v7k9cJUpThMRVUTNz/ViHe7qjQX3bipgozyRsh0WOIywB5Xbs6 XIasThee8o6fIjvsLf1V7ZSzcoqj6zjuAVYP/T+Y5HOAqdQBBpA2FSa5cta7Rk4d IAhJ7H1OwVQSDxlnaiLRlHSPQg6V+gp67nmToCVRiOrf1wn4VbY0dMMywYx4IFBX Lo4ISqR2jIgl310p9CzGpf5h4a1aF0k7metLAGccbQHX2U+yowKdRBd2aAI7M9L1 w7gtNgQ/Fte60jCvkWXF =TZ3+ -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5--