Just like for hot unplugged CPUs, when a guest is rebooted, the secondary CPUs can be awaken by the decrementer and start entering SLOF at the same time the boot CPU is.
To be safe, let's disable the decrementer interrupt in the LPCR for the secondaries. Based on previous work from Nikunj A Dadhania <nik...@linux.vnet.ibm.com> Signed-off-by: Cédric Le Goater <c...@kaod.org> --- hw/ppc/spapr_cpu_core.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 37beb56e8b18..112868dc39d5 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -20,6 +20,7 @@ #include "sysemu/numa.h" #include "sysemu/hw_accel.h" #include "qemu/error-report.h" +#include "target/ppc/cpu-models.h" void spapr_cpu_parse_features(sPAPRMachineState *spapr) { @@ -86,6 +87,17 @@ static void spapr_cpu_reset(void *opaque) cs->halted = 1; env->spr[SPR_HIOR] = 0; + + /* Don't let the decremeter wake up CPUs other than the boot + * CPUs. this can cause issues when rebooting the guest */ + if (cs != first_cpu) { + if (ppc_cpu_pvr_match(cpu, CPU_POWERPC_LOGICAL_3_00)) { + env->spr[SPR_LPCR] &= ~LPCR_DEE; + } else { + /* P7 and P8 both have same bit for DECR */ + env->spr[SPR_LPCR] &= ~LPCR_P8_PECE3; + } + } } static void spapr_cpu_destroy(PowerPCCPU *cpu) -- 2.13.6