qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
To: "Cédric Le Goater" <clg@kaod.org>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Benjamin Herrenschmidt" <benh@kernel.crashing.org>
Subject: Re: [Qemu-devel] [PATCH v2 3/4] spapr/rtas: fix reboot of a SMP TCG guest
Date: Thu, 12 Oct 2017 10:04:58 +0530	[thread overview]
Message-ID: <87shep3rwt.fsf@localhost.localdomain.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <20171009154930.29095-4-clg@kaod.org>

Cédric Le Goater <clg@kaod.org> 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 <nikunj@linux.vnet.ibm.com>
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>

> ---
>  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	other threads:[~2017-10-12  4:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 15:49 [Qemu-devel] [PATCH v2 0/4] disable the decrementer interrupt when a CPU is unplugged Cédric Le Goater
2017-10-09 15:49 ` [Qemu-devel] [PATCH v2 1/4] target/ppc: export ppc_cpu_pvr_match() helper Cédric Le Goater
2017-10-11  6:41   ` David Gibson
2017-10-09 15:49 ` [Qemu-devel] [PATCH v2 2/4] spapr/rtas: disable the decrementer interrupt when a CPU is unplugged Cédric Le Goater
2017-10-10  8:08   ` Benjamin Herrenschmidt
2017-10-10 15:56     ` Cédric Le Goater
2017-10-11  6:45   ` David Gibson
2017-10-11 11:55     ` Cédric Le Goater
2017-10-11 22:46       ` David Gibson
2017-10-12  9:25         ` Cédric Le Goater
2017-10-12  9:29           ` Cédric Le Goater
2017-10-09 15:49 ` [Qemu-devel] [PATCH v2 3/4] spapr/rtas: fix reboot of a SMP TCG guest Cédric Le Goater
2017-10-12  4:34   ` Nikunj A Dadhania [this message]
2017-10-09 15:49 ` [Qemu-devel] [PATCH v2 4/4] spapr/rtas: do not reset the MSR in stop-self command Cédric Le Goater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87shep3rwt.fsf@localhost.localdomain.i-did-not-set--mail-host-address--so-tickle-me \
    --to=nikunj@linux.vnet.ibm.com \
    --cc=benh@kernel.crashing.org \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).