Revision 59760f2d hw/ppc/spapr_rtas.c

b/hw/ppc/spapr_rtas.c
202 202
    rtas_st(rets, 0, -3);
203 203
}
204 204

  
205
static void rtas_stop_self(PowerPCCPU *cpu, sPAPREnvironment *spapr,
206
                           uint32_t token, uint32_t nargs,
207
                           target_ulong args,
208
                           uint32_t nret, target_ulong rets)
209
{
210
    CPUState *cs = CPU(cpu);
211
    CPUPPCState *env = &cpu->env;
212

  
213
    cs->halted = 1;
214
    cpu_exit(cs);
215
    /*
216
     * While stopping a CPU, the guest calls H_CPPR which
217
     * effectively disables interrupts on XICS level.
218
     * However decrementer interrupts in TCG can still
219
     * wake the CPU up so here we disable interrupts in MSR
220
     * as well.
221
     * As rtas_start_cpu() resets the whole MSR anyway, there is
222
     * no need to bother with specific bits, we just clear it.
223
     */
224
    env->msr = 0;
225
}
226

  
205 227
static struct rtas_call {
206 228
    const char *name;
207 229
    spapr_rtas_fn fn;
......
322 344
    spapr_rtas_register("query-cpu-stopped-state",
323 345
                        rtas_query_cpu_stopped_state);
324 346
    spapr_rtas_register("start-cpu", rtas_start_cpu);
347
    spapr_rtas_register("stop-self", rtas_stop_self);
325 348
}
326 349

  
327 350
type_init(core_rtas_register_types)

Also available in: Unified diff