From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEc7k-0003f7-DZ for qemu-devel@nongnu.org; Wed, 28 Aug 2013 05:33:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEc7a-00028w-HN for qemu-devel@nongnu.org; Wed, 28 Aug 2013 05:33:12 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:49927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEc7Z-00028f-Rt for qemu-devel@nongnu.org; Wed, 28 Aug 2013 05:33:02 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Aug 2013 19:25:40 +1000 From: Alexey Kardashevskiy Date: Wed, 28 Aug 2013 19:32:51 +1000 Message-Id: <1377682371-12586-1-git-send-email-aik@ozlabs.ru> Subject: [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: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Paolo Bonzini , qemu-ppc@nongnu.org, Alexander Graf , David Gibson 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 --- 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; + 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) -- 1.8.4.rc4