From: Nicholas Piggin <npiggin@gmail.com>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 3/3] ppc/spapr: implement H_SIGNAL_SYS_RESET
Date: Fri, 21 Oct 2016 11:56:34 +1100 [thread overview]
Message-ID: <20161021115634.4db238bc@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <20161020184922.518a2e44@bahia>
On Thu, 20 Oct 2016 18:49:22 +0200
Greg Kurz <groug@kaod.org> wrote:
> On Thu, 20 Oct 2016 17:59:12 +1100
> Nicholas Piggin <npiggin@gmail.com> wrote:
>
> > The H_SIGNAL_SYS_RESET hcall allows a guest CPU to raise a system
> > reset exception on other CPUs in the same guest.
> >
>
> Actually on all CPUs or all-but-self CPUs or a specific CPU (including self).
Exactly right. I'll improve the changelog and try to add something more
official.
> > Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> > ---
> > hw/ppc/spapr_hcall.c | 42 ++++++++++++++++++++++++++++++++++++++++++
> > include/hw/ppc/spapr.h | 8 +++++++-
> > 2 files changed, 49 insertions(+), 1 deletion(-)
> >
> > 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;
> > }
> >
> > +static void do_sys_reset(CPUState *cs, void *arg)
> > +{
> > + cpu_synchronize_state(cs);
> > + ppc_cpu_do_system_reset(cs);
> > +}
> > +
>
> We already have the following function in hw/ppc/spapr.c, which serves the
> same purpose:
>
> static void ppc_cpu_do_nmi_on_cpu(CPUState *cs, void *arg)
> {
> cpu_synchronize_state(cs);
> ppc_cpu_do_system_reset(cs);
> }
>
> What about using it ?
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.
> > --- 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
> > +
>
> I'd rather move these to hw/ppc/spapr_hcall.c just above h_signal_sys_reset(),
> the same way it is done for h_bulk_remove().
Will do.
Thanks,
Nick
next prev parent reply other threads:[~2016-10-21 0:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-20 6:59 [Qemu-devel] (no subject) Nicholas Piggin
2016-10-20 6:59 ` [Qemu-devel] [PATCH 1/3] ppc: fix MSR_ME handling for system reset interrupt Nicholas Piggin
2016-10-20 10:23 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-10-20 10:23 ` Cédric Le Goater
2016-10-21 1:09 ` [Qemu-devel] " David Gibson
2016-10-21 1:49 ` Nicholas Piggin
2016-10-20 6:59 ` [Qemu-devel] [PATCH 2/3] ppc: allow system reset interrupt to be delivered to guests Nicholas Piggin
2016-10-20 13:08 ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2016-10-20 13:40 ` Nicholas Piggin
2016-10-21 1:09 ` David Gibson
2016-10-21 4:35 ` [Qemu-devel] [PATCH v2] ppc: allow certain HV interrupts " Nicholas Piggin
2016-10-21 10:22 ` Cédric Le Goater
2016-10-24 1:16 ` David Gibson
2016-10-24 6:56 ` Nicholas Piggin
2016-10-25 1:23 ` David Gibson
2016-10-20 6:59 ` [Qemu-devel] [PATCH 3/3] ppc/spapr: implement H_SIGNAL_SYS_RESET Nicholas Piggin
2016-10-20 9:21 ` [Qemu-devel] [Qemu-ppc] " Thomas Huth
2016-10-20 13:25 ` Nicholas Piggin
2016-10-20 16:49 ` Greg Kurz
2016-10-21 0:56 ` Nicholas Piggin [this message]
2016-10-21 1:21 ` David Gibson
2016-10-20 11:49 ` [Qemu-devel] [Qemu-ppc] (no subject) Greg Kurz
2016-10-20 13:26 ` Nicholas Piggin
2016-10-20 13:19 ` Cédric Le Goater
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161021115634.4db238bc@roar.ozlabs.ibm.com \
--to=npiggin@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.