qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Alexander Graf <agraf@suse.de>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	qemu-ppc@nongnu.org, Paul Mackerras <paulus@samba.org>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] spapr: support CPU hotplug
Date: Tue, 27 Aug 2013 01:29:02 +1000	[thread overview]
Message-ID: <20130826152902.GB9120@voom.fritz.box> (raw)
In-Reply-To: <CE3F191B-738A-4494-8F5B-B0C1DED31D5B@suse.de>

[-- Attachment #1: Type: text/plain, Size: 1968 bytes --]

On Mon, Aug 26, 2013 at 02:24:49PM +0200, Alexander Graf wrote:
> 
> On 23.08.2013, at 13:30, 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.
> > 
> > This adds the "stop-self" RTAS call.
> > 
> > Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> > ---
> > hw/ppc/spapr_rtas.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> > 
> > diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
> > index 394ce05..8a4cfa0 100644
> > --- a/hw/ppc/spapr_rtas.c
> > +++ b/hw/ppc/spapr_rtas.c
> > @@ -202,6 +202,19 @@ static void rtas_start_cpu(PowerPCCPU *cpu_, sPAPREnvironment *spapr,
> >     rtas_st(rets, 0, -3);
> > }
> > 
> > +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 = CPU(cpu);
> > +    CPUPPCState *env = &cpu->env;
> > +
> > +    cs->halted = 1;
> > +    env->msr = 0;
> 
> So this is here to make sure we don't accidentally get out of halted state by an interrupt on that vcpu. Could you please somehow make that part obvious? Either by adding a comment or by only explicitly masking DEC and EE and a comment :).
> 
> > +    cs->exit_request = 1;
> 
> This should probably be qemu_cpu_kick_self().

Uh, no, I don't think so.  This is there purely to make sure we exit
the inner loop, and actually test cpu_can_run() which will test
halted.  AFAICT qemu_cpu_kick_self() won't do anything similar.

-- 
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

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-08-27  1:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-23 11:30 [Qemu-devel] [PATCH] spapr: support CPU hotplug Alexey Kardashevskiy
2013-08-26 12:24 ` Alexander Graf
2013-08-26 15:29   ` David Gibson [this message]
2013-08-27  6:37     ` Alexey Kardashevskiy
2013-08-27  7:02       ` Paolo Bonzini
2013-08-27  7:41         ` Alexey Kardashevskiy
2013-08-27  8:54           ` Alexander Graf
2013-08-27  9:03             ` Alexey Kardashevskiy
2013-08-27  9:11               ` Alexander Graf

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=20130826152902.GB9120@voom.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=paulus@samba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).