[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 17/17] spapr: don't advertise radix GTSE if max-compat-
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 17/17] spapr: don't advertise radix GTSE if max-compat-cpu < power9 |
Date: |
Fri, 4 May 2018 15:59:30 +1000 |
From: Greg Kurz <address@hidden>
On a POWER9 host, if a guest runs in pre POWER9 compat mode, it necessarily
uses the hash MMU mode. In this case, we shouldn't advertise radix GTSE in
the ibm,arch-vec-5-platform-support DT property as the current code does.
The first reason is that it doesn't make sense, and the second one is that
causes the CAS-negotiated options subsection to be migrated. This breaks
backward migration to QEMU 2.7 and older versions on POWER8 hosts:
qemu-system-ppc64: error while loading state for instance 0x0 of device
'spapr'
qemu-system-ppc64: load of migration failed: No such file or directory
This patch hence initialize CPUs a bit earlier so that we can check the
requested compat mode, and don't set OV5_MMU_RADIX_GTSE for power8 and
older.
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 19997f66c0..32ab3c43b6 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2512,6 +2512,7 @@ static void spapr_machine_init(MachineState *machine)
long load_limit, fw_size;
char *filename;
Error *resize_hpt_err = NULL;
+ PowerPCCPU *first_ppc_cpu;
msi_nonbroken = true;
@@ -2592,11 +2593,6 @@ static void spapr_machine_init(MachineState *machine)
}
spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY);
- if (!kvm_enabled() || kvmppc_has_cap_mmu_radix()) {
- /* KVM and TCG always allow GTSE with radix... */
- spapr_ovec_set(spapr->ov5, OV5_MMU_RADIX_GTSE);
- }
- /* ... but not with hash (currently). */
/* advertise support for dedicated HP event source to guests */
if (spapr->use_hotplug_event_source) {
@@ -2614,6 +2610,15 @@ static void spapr_machine_init(MachineState *machine)
/* init CPUs */
spapr_init_cpus(spapr);
+ first_ppc_cpu = POWERPC_CPU(first_cpu);
+ if ((!kvm_enabled() || kvmppc_has_cap_mmu_radix()) &&
+ ppc_check_compat(first_ppc_cpu, CPU_POWERPC_LOGICAL_3_00, 0,
+ spapr->max_compat_pvr)) {
+ /* KVM and TCG always allow GTSE with radix... */
+ spapr_ovec_set(spapr->ov5, OV5_MMU_RADIX_GTSE);
+ }
+ /* ... but not with hash (currently). */
+
if (kvm_enabled()) {
/* Enable H_LOGICAL_CI_* so SLOF can talk to in-kernel devices */
kvmppc_enable_logical_ci_hcalls();
--
2.17.0
- [Qemu-ppc] [PULL 00/17] ppc-for-2.13 queue 20180504, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 01/17] target/ppc: return a nil HPT base address on sPAPR machines, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 02/17] target/ppc: add basic support for PTCR on POWER9, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 03/17] spapr: Remove support for explicitly allocated RMAs, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 05/17] spapr: Clean up rtas_start_cpu() & rtas_stop_self(), David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 07/17] spapr: Make a helper to set up cpu entry point state, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 11/17] spapr: Clean up handling of LPCR power-saving exit bits, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 15/17] target/ppc: always set PPC_MEM_TLBIE in pre 2.8 migration hack, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 16/17] spapr: don't migrate "spapr_option_vector_ov5_cas" to pre 2.8 machines, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 04/17] target/ppc: Add ppc_store_lpcr() helper, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 17/17] spapr: don't advertise radix GTSE if max-compat-cpu < power9,
David Gibson <=
- [Qemu-ppc] [PULL 14/17] mac_newworld: move wiring of macio IRQs to macio_newworld_realize(), David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 10/17] spapr: Move PAPR mode cpu setup fully to spapr code, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 12/17] uninorth: create new uninorth device, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 09/17] target/ppc: Delay initialization of LPCR_UPRT for secondary cpus, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 06/17] spapr: Remove unhelpful helpers from rtas_start_cpu(), David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 13/17] mac_newworld: remove pics IRQ array and wire up macio to OpenPIC directly, David Gibson, 2018/05/04
- [Qemu-ppc] [PULL 08/17] spapr: Clean up LPCR updates from hypercalls, David Gibson, 2018/05/04
- Re: [Qemu-ppc] [PULL 00/17] ppc-for-2.13 queue 20180504, Peter Maydell, 2018/05/04