All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: nikunj@linux.vnet.ibm.com, aik@ozlabs.ru, mdroth@linux.vnet.ibm.com
Cc: thuth@redhat.com, lvivier@redhat.com, qemu-ppc@nongnu.org,
	qemu-devel@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [RFC 14/17] pseries: Reset CPU compatibility mode
Date: Sun, 30 Oct 2016 22:12:05 +1100	[thread overview]
Message-ID: <1477825928-10803-15-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1477825928-10803-1-git-send-email-david@gibson.dropbear.id.au>

Currently, the CPU compatibility mode is set when the cpu is initialized,
then again when the guest negotiates features.  This means if a guest
negotiates a compatibility mode, then reboots, that compatibility mode
will be retained across the reset.

Usually that will get overridden when features are negotiated on the next
boot, but it's still not really correct.  This patch moves the initial set
up of the compatibility mode from cpu init to reset time.  The mode *is*
retained if the reboot was caused by the feature negotiation (it might
be important in that case, though it's unlikely).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 hw/ppc/spapr.c          |  2 ++
 hw/ppc/spapr_cpu_core.c | 10 ----------
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index b983faa..2aa0900 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1169,6 +1169,8 @@ static void ppc_spapr_reset(void)
     if (!spapr->cas_reboot) {
         spapr_ovec_cleanup(spapr->ov5_cas);
         spapr->ov5_cas = spapr_ovec_new();
+
+        ppc_set_compat_all(spapr->max_compat_pvr, &error_abort);
     }
 
     fdt = spapr_build_fdt(spapr, rtas_addr, spapr->rtas_size);
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 0319516..4b6134b 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -103,16 +103,6 @@ static void spapr_cpu_init(sPAPRMachineState *spapr, PowerPCCPU *cpu,
     cpu_ppc_set_vhyp(cpu, PPC_VIRTUAL_HYPERVISOR(spapr));
     cpu_ppc_set_papr(cpu);
 
-    if (spapr->max_compat_pvr) {
-        Error *local_err = NULL;
-
-        ppc_set_compat(cpu, spapr->max_compat_pvr, &local_err);
-        if (local_err) {
-            error_propagate(errp, local_err);
-            return;
-        }
-    }
-
     /* Set NUMA node for the added CPUs  */
     i = numa_get_node_for_cpu(cs->cpu_index);
     if (i < nb_numa_nodes) {
-- 
2.7.4

  parent reply	other threads:[~2016-10-30 11:12 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-30 11:11 [Qemu-devel] [RFC 00/17] Clean up compatibility mode handling David Gibson
2016-10-30 11:11 ` [Qemu-devel] [RFC 01/17] ppc: Remove some stub POWER6 models David Gibson
2016-10-31  7:38   ` Thomas Huth
2016-10-31  8:37     ` David Gibson
2016-11-08  3:40   ` David Gibson
2016-10-30 11:11 ` [Qemu-devel] [RFC 02/17] powernv: CPU compatibility modes don't make sense for powernv David Gibson
2016-10-31  7:46   ` Thomas Huth
2016-10-31  8:38     ` David Gibson
2016-10-31 10:35   ` Greg Kurz
2016-10-30 11:11 ` [Qemu-devel] [RFC 03/17] pseries: Always use core objects for CPU construction David Gibson
2016-11-03  8:11   ` Alexey Kardashevskiy
2016-11-04  9:51     ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-11-08  5:34       ` David Gibson
2016-10-30 11:11 ` [Qemu-devel] [RFC 04/17] pseries: Make cpu_update during CAS unconditional David Gibson
2016-11-03  8:24   ` Alexey Kardashevskiy
2016-11-04 10:45   ` Thomas Huth
2016-11-08  3:44     ` David Gibson
2016-10-30 11:11 ` [Qemu-devel] [RFC 05/17] ppc: Clean up and QOMify hypercall emulation David Gibson
2016-11-03  8:50   ` Alexey Kardashevskiy
2016-10-30 11:11 ` [Qemu-devel] [RFC 06/17] ppc: Rename cpu_version to compat_pvr David Gibson
2016-11-04  2:26   ` Alexey Kardashevskiy
2016-11-08  3:48     ` David Gibson
2016-11-04 10:51   ` Thomas Huth
2016-10-30 11:11 ` [Qemu-devel] [RFC 07/17] ppc: Rewrite ppc_set_compat() David Gibson
2016-11-04  2:57   ` Alexey Kardashevskiy
2016-11-08  3:49     ` David Gibson
2016-10-30 11:11 ` [Qemu-devel] [RFC 08/17] ppc: Rewrite ppc_get_compat_smt_threads() David Gibson
2016-11-04  3:37   ` Alexey Kardashevskiy
2016-11-08  5:13     ` David Gibson
2016-10-30 11:12 ` [Qemu-devel] [RFC 09/17] ppc: Validate compatibility modes when setting David Gibson
2016-10-31  5:55   ` Alexey Kardashevskiy
2016-10-31  8:39     ` David Gibson
2016-11-04  3:45       ` Alexey Kardashevskiy
2016-11-08  5:14         ` David Gibson
2016-10-30 11:12 ` [Qemu-devel] [RFC 10/17] pseries: Rewrite CAS PVR compatibility logic David Gibson
2016-10-31  5:00   ` Alexey Kardashevskiy
2016-10-31  5:44     ` David Gibson
2016-11-10 17:54   ` Michael Roth
2016-11-10 23:50     ` David Gibson
2016-10-30 11:12 ` [Qemu-devel] [RFC 11/17] ppc: Add ppc_set_compat_all() David Gibson
2016-11-04  4:01   ` Alexey Kardashevskiy
2016-11-08  5:18     ` David Gibson
2016-11-09  1:27       ` Alexey Kardashevskiy
2016-11-09  3:52         ` David Gibson
2016-11-09  5:18           ` Alexey Kardashevskiy
2016-11-10  3:13             ` David Gibson
2016-10-30 11:12 ` [Qemu-devel] [RFC 12/17] ppc: Migrate compatibility mode David Gibson
2016-11-04  5:58   ` Alexey Kardashevskiy
2016-11-08  5:19     ` David Gibson
2016-11-08  5:51       ` Alexey Kardashevskiy
2016-11-10  1:59         ` David Gibson
2016-11-10 23:55           ` Michael Roth
2016-11-14  1:15             ` David Gibson
2016-10-30 11:12 ` [Qemu-devel] [RFC 13/17] pseries: Move CPU compatibility property to machine David Gibson
2016-11-04  7:43   ` Alexey Kardashevskiy
2016-11-08  5:26     ` David Gibson
2016-11-08  5:56       ` Alexey Kardashevskiy
2016-11-09  4:41         ` David Gibson
2016-10-30 11:12 ` David Gibson [this message]
2016-11-04  7:50   ` [Qemu-devel] [RFC 14/17] pseries: Reset CPU compatibility mode Alexey Kardashevskiy
2016-10-30 11:12 ` [Qemu-devel] [RFC 15/17] ppc: Check that CPU model stays consistent across migration David Gibson
2016-11-04  7:54   ` Alexey Kardashevskiy
2016-11-08  5:29     ` David Gibson
2016-11-08  6:03       ` Alexey Kardashevskiy
2016-11-09  4:24         ` David Gibson
2016-11-09  6:06           ` Alexey Kardashevskiy
2016-11-09  6:40             ` David Gibson
2016-10-30 11:12 ` [Qemu-devel] [RFC 16/17] ppc: Remove counter-productive "sanity checks" in migration David Gibson
2016-11-04  5:52   ` Alexey Kardashevskiy
2016-11-08  5:31     ` David Gibson
2016-11-11 18:13       ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2016-11-14  2:34         ` Alexey Kardashevskiy
2016-11-14  6:08           ` David Gibson
2016-10-30 11:12 ` [Qemu-devel] [RFC 17/17] pseries: Default to POWER8 compatibility mode David Gibson
2016-10-30 11:58   ` David Gibson

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=1477825928-10803-15-git-send-email-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=aik@ozlabs.ru \
    --cc=lvivier@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=nikunj@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thuth@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.