[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/18] spapr: add "stop-self" RTAS call required to s
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 17/18] spapr: add "stop-self" RTAS call required to support hot CPU unplug |
Date: |
Mon, 2 Sep 2013 10:11:32 +0200 |
From: Alexey Kardashevskiy <address@hidden>
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 <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc/spapr_rtas.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c
index 394ce05..eb542f2 100644
--- a/hw/ppc/spapr_rtas.c
+++ b/hw/ppc/spapr_rtas.c
@@ -202,6 +202,28 @@ 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;
+ cpu_exit(cs);
+ /*
+ * While stopping a CPU, the guest calls H_CPPR which
+ * effectively disables interrupts on XICS level.
+ * However decrementer interrupts in TCG can still
+ * wake the CPU up so here we disable interrupts in MSR
+ * as well.
+ * As rtas_start_cpu() resets the whole MSR anyway, there is
+ * no need to bother with specific bits, we just clear it.
+ */
+ env->msr = 0;
+}
+
static struct rtas_call {
const char *name;
spapr_rtas_fn fn;
@@ -322,6 +344,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.1.4
- [Qemu-devel] [PULL 07/18] ppc405_boards: Disable debug output, (continued)
- [Qemu-devel] [PULL 07/18] ppc405_boards: Disable debug output, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 16/18] PPC: KVM: Compile fix for qemu_notify_event, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 05/18] disas/ppc.c: Fix little endian disassembly, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 03/18] target-ppc: USE LPCR_ILE to control exception endian on POWER7, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 08/18] ppc405_uc: Disable debug output, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 02/18] pseries: Fix stalls on hypervisor virtual console, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 09/18] ppc405_boards: Don't enforce presence of firmware for qtest, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 04/18] target-ppc: POWER7 supports the MSR_LE bit, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 14/18] xics: move registration of global state to realize(), Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 12/18] target-ppc: Use #define instead of opencoding SLB valid bit, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 17/18] spapr: add "stop-self" RTAS call required to support hot CPU unplug,
Alexander Graf <=
- [Qemu-devel] [PULL 11/18] spapr-pci: fix config space access to support bridges, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 18/18] PPC: spapr: iommu: rework traces, Alexander Graf, 2013/09/02
- [Qemu-devel] [PULL 13/18] spapr-pci: rework MSI/MSIX, Alexander Graf, 2013/09/02
- Re: [Qemu-devel] [PULL 00/18] ppc patch queue 2013-09-02, Aurelien Jarno, 2013/09/03