qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH v2] spapr: add "stop-self" RTAS call required to support hot CPU unplug
Date: Wed, 28 Aug 2013 21:42:03 +1000	[thread overview]
Message-ID: <20130828114203.GB2944@voom.redhat.com> (raw)
In-Reply-To: <1377682371-12586-1-git-send-email-aik@ozlabs.ru>

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

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.
> 
> This adds the "stop-self" RTAS call.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> 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(+)
> 
> 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_, 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);
> +
> +    cs->halted = 1;

Uh.. I think you still need the msr = 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);
>  }
>  
>  type_init(core_rtas_register_types)

-- 
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-28 12:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28  9:32 [Qemu-devel] [PATCH v2] spapr: add "stop-self" RTAS call required to support hot CPU unplug Alexey Kardashevskiy
2013-08-28 11:42 ` David Gibson [this message]
2013-08-29  9:04   ` Alexey Kardashevskiy
2013-08-29 10: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=20130828114203.GB2944@voom.redhat.com \
    --to=david@gibson.dropbear.id.au \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=pbonzini@redhat.com \
    --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).