[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFCv2 11/12] pseries: Reset CPU compatibility mode
From: |
David Gibson |
Subject: |
[Qemu-devel] [RFCv2 11/12] pseries: Reset CPU compatibility mode |
Date: |
Wed, 16 Nov 2016 09:17:54 +1100 |
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 <address@hidden>
Reviewed-by: Alexey Kardashevskiy <address@hidden>
---
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 3878baf..beef542 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1168,6 +1168,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 c5dda80..195a99f 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -97,16 +97,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
- [Qemu-devel] [RFCv2 00/12] Clean up compatibility mode handling, David Gibson, 2016/11/15
- [Qemu-devel] [RFCv2 11/12] pseries: Reset CPU compatibility mode,
David Gibson <=
- [Qemu-devel] [RFCv2 09/12] ppc: Add ppc_set_compat_all(), David Gibson, 2016/11/15
- [Qemu-devel] [RFCv2 04/12] ppc: Rename cpu_version to compat_pvr, David Gibson, 2016/11/15
- [Qemu-devel] [RFCv2 06/12] ppc: Rewrite ppc_get_compat_smt_threads(), David Gibson, 2016/11/15
- [Qemu-devel] [RFCv2 02/12] pseries: Make cpu_update during CAS unconditional, David Gibson, 2016/11/15
- [Qemu-devel] [RFCv2 01/12] pseries: Always use core objects for CPU construction, David Gibson, 2016/11/15
- [Qemu-devel] [RFCv2 03/12] ppc: Clean up and QOMify hypercall emulation, David Gibson, 2016/11/15
- [Qemu-devel] [RFCv2 08/12] pseries: Rewrite CAS PVR compatibility logic, David Gibson, 2016/11/15
- [Qemu-devel] [RFCv2 05/12] ppc: Rewrite ppc_set_compat(), David Gibson, 2016/11/15
- [Qemu-devel] [RFCv2 07/12] ppc: Validate compatibility modes when setting, David Gibson, 2016/11/15