[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 067/113] spapr: don't advertise radix GTSE if max-co
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 067/113] spapr: don't advertise radix GTSE if max-compat-cpu < power9 |
Date: |
Mon, 18 Jun 2018 20:42:33 -0500 |
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>
(cherry picked from commit 0550b1206a91d66051a21441a02c4ff126b531fe)
Signed-off-by: Michael Roth <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 6499a86752..a74eb2dc68 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2356,6 +2356,7 @@ static void ppc_spapr_init(MachineState *machine)
long load_limit, fw_size;
char *filename;
Error *resize_hpt_err = NULL;
+ PowerPCCPU *first_ppc_cpu;
msi_nonbroken = true;
@@ -2448,11 +2449,6 @@ static void ppc_spapr_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) {
@@ -2469,6 +2465,15 @@ static void ppc_spapr_init(MachineState *machine)
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.11.0
- [Qemu-devel] [PATCH 055/113] vfio-ccw: fix memory leaks in vfio_ccw_realize(), (continued)
- [Qemu-devel] [PATCH 055/113] vfio-ccw: fix memory leaks in vfio_ccw_realize(), Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 060/113] ccid: Fix dwProtocols advertisement of T=0, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 005/113] sdl: workaround bug in sdl 2.0.8 headers, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 061/113] nbd/client: Fix error messages during NBD_INFO_BLOCK_SIZE, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 063/113] s390-ccw: force diag 308 subcode to unsigned long, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 062/113] s390: Do not pass inofficial IPL type to the guest, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 064/113] tcg/arm: Fix memory barrier encoding, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 065/113] target/arm: Implement v8M VLLDM and VLSTM, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 066/113] target/ppc: always set PPC_MEM_TLBIE in pre 2.8 migration hack, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 068/113] qxl: fix local renderer crash, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 067/113] spapr: don't advertise radix GTSE if max-compat-cpu < power9,
Michael Roth <=
- [Qemu-devel] [PATCH 069/113] configure: recognize more rpmbuild macros, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 070/113] qemu-img: Resolve relative backing paths in rebase, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 073/113] qemu-img: Use only string options in img_open_opts, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 074/113] iotests: Add test for -U/force-share conflicts, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 071/113] iotests: Add test for rebasing with relative paths, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 006/113] spapr: Allow some cases where we can't set VSMT mode in the kernel, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 072/113] qemu-io: Use purely string blockdev options, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 075/113] lm32: take BQL before writing IP/IM register, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 078/113] pc-bios/s390-ccw: struct tpi_info must be declared as aligned(4), Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 079/113] qdev: rename typedef qdev_resetfn() -> DeviceReset(), Michael Roth, 2018/06/18