[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 066/113] target/ppc: always set PPC_MEM_TLBIE in pre
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 066/113] target/ppc: always set PPC_MEM_TLBIE in pre 2.8 migration hack |
Date: |
Mon, 18 Jun 2018 20:42:32 -0500 |
From: Greg Kurz <address@hidden>
The pseries-2.7 and older machine types require CPUPPCState::insns_flags
to be strictly equal between source and destination. This checking is
abusive and breaks migration of KVM guests when the host CPU models
are different, even if they are compatible enough to allow the guest
to run transparently. This buggy behaviour was fixed for pseries-2.8
and we added some hacks to allow backward migration of older machine
types. These hacks assume that the CPU belongs to the POWER8 family,
which was true for most KVM based setup we cared about at the time.
But now POWER9 systems are coming, and backward migration of pre 2.8
guests running in POWER8 architected mode from a POWER9 host to a
POWER8 host is broken:
qemu-system-ppc64: error while loading state for instance 0x0 of device
'cpu'
qemu-system-ppc64: load of migration failed: Invalid argument
This happens because POWER9 doesn't set PPC_MEM_TLBIE in insns_flags,
while POWER8 does. Let's force PPC_MEM_TLBIE in the migration hack to
fix the issue. This is an acceptable hack because these old machine
types only support CPU models that do set PPC_MEM_TLBIE.
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
(cherry picked from commit bce009645b9f1d59195518e35747c8ea30f985f7)
Signed-off-by: Michael Roth <address@hidden>
---
target/ppc/machine.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target/ppc/machine.c b/target/ppc/machine.c
index e475206c6a..feeb449e4d 100644
--- a/target/ppc/machine.c
+++ b/target/ppc/machine.c
@@ -192,6 +192,11 @@ static int cpu_pre_save(void *opaque)
if (cpu->pre_2_8_migration) {
cpu->mig_msr_mask = env->msr_mask;
cpu->mig_insns_flags = env->insns_flags & insns_compat_mask;
+ /* CPU models supported by old machines all have PPC_MEM_TLBIE,
+ * so we set it unconditionally to allow backward migration from
+ * a POWER9 host to a POWER8 host.
+ */
+ cpu->mig_insns_flags |= PPC_MEM_TLBIE;
cpu->mig_insns_flags2 = env->insns_flags2 & insns_compat_mask2;
cpu->mig_nb_BATs = env->nb_BATs;
}
--
2.11.0
- [Qemu-devel] [PATCH 059/113] device_tree: Increase FDT_MAX_SIZE to 1 MiB, (continued)
- [Qemu-devel] [PATCH 059/113] device_tree: Increase FDT_MAX_SIZE to 1 MiB, Michael Roth, 2018/06/18
- [Qemu-devel] [PATCH 058/113] hw/char/cmsdk-apb-uart.c: Correctly clear INTSTATUS bits on writes, Michael Roth, 2018/06/18
- [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 <=
- [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, 2018/06/18
- [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