qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH v2 3/4] spapr/rtas: fix reboot of a SMP TCG guest


From: Nikunj A Dadhania
Subject: Re: [Qemu-ppc] [PATCH v2 3/4] spapr/rtas: fix reboot of a SMP TCG guest
Date: Thu, 12 Oct 2017 10:04:58 +0530

Cédric Le Goater <address@hidden> writes:

> 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 <address@hidden>
>
> Signed-off-by: Cédric Le Goater <address@hidden>

Reviewed-by: Nikunj A Dadhania <address@hidden>

> ---
>  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]