From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: agraf@suse.de, thuth@redhat.com, lvivier@redhat.com,
sursingh@redhat.com, sbobroff@redhat.com,
mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org,
qemu-devel@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 04/21] pseries: Reset CPU compatibility mode
Date: Fri, 30 Jun 2017 20:46:15 +1000 [thread overview]
Message-ID: <20170630104632.27942-5-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20170630104632.27942-1-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>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
---
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 67d4c13..81007b9 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1346,6 +1346,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_fatal);
}
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 97472fd..d6719d5 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -118,16 +118,6 @@ static void spapr_cpu_init(sPAPRMachineState *spapr, PowerPCCPU *cpu,
/* Enable PAPR mode in TCG or KVM */
cpu_ppc_set_papr(cpu, PPC_VIRTUAL_HYPERVISOR(spapr));
- 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;
- }
- }
-
qemu_register_reset(spapr_cpu_reset, cpu);
spapr_cpu_reset(cpu);
}
--
2.9.4
next prev parent reply other threads:[~2017-06-30 10:46 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 10:46 [Qemu-devel] [PULL 00/21] ppc-for-2.10 queue 20170730 David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 01/21] hw/ppc/prep: Remove superfluous call to soundhw_init() David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 02/21] qapi: add explicit null to string input and output visitors David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 03/21] pseries: Move CPU compatibility property to machine David Gibson
2017-06-30 10:46 ` David Gibson [this message]
2017-06-30 10:46 ` [Qemu-devel] [PULL 05/21] ppc: Rework CPU compatibility testing across migration David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 06/21] spapr: Add a "no HPT" encoding to HTAB migration stream David Gibson
2017-07-17 19:54 ` [Qemu-devel] [Qemu-ppc] " Laurent Vivier
2017-07-18 3:37 ` David Gibson
2017-07-18 7:36 ` Thomas Huth
2017-06-30 10:46 ` [Qemu-devel] [PULL 07/21] spapr: Fix migration of Radix guests David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 08/21] target/ppc/excp_helper: Take BQL before calling cpu_interrupt() David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 09/21] target/ppc: Fix return value in tcg radix mmu fault handler David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 10/21] xics: directly register ICPState objects to vmstate David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 11/21] spapr: fix migration of ICPState objects from/to older QEMU David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 12/21] target/ppc: Proper cleanup when ppc_cpu_realizefn fails David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 13/21] spapr: prevent QEMU crash when CPU realization fails David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 14/21] hw/ppc/spapr.c: consecutive 'spapr->patb_entry = 0' statements David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 15/21] target-ppc: Enable open-pic timers to count and generate interrupts David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 16/21] spapr: Start hotplugged PCI devices in ISOLATED state David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 17/21] spapr: Eliminate DRC 'signalled' state variable David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 18/21] spapr: Split DRC release from DRC detach David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 19/21] spapr: Make DRC reset force DRC into known state David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 20/21] spapr: Clean up DRC set_allocation_state path David Gibson
2017-06-30 10:46 ` [Qemu-devel] [PULL 21/21] spapr: Clean up DRC set_isolation_state() path David Gibson
2017-06-30 11:03 ` [Qemu-devel] [PULL 00/21] ppc-for-2.10 queue 20170730 Greg Kurz
2017-07-01 6:47 ` David Gibson
2017-06-30 12:26 ` Peter Maydell
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=20170630104632.27942-5-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=lvivier@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sbobroff@redhat.com \
--cc=sursingh@redhat.com \
--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 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).