summaryrefslogtreecommitdiff
path: root/target/ppc
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2018-03-20 13:01:18 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2018-04-10 10:05:38 +1000
commitefb7db250adad82c4bb302f0a80e4ae0c641f0d6 (patch)
tree1cc846e98c364cf46366a749b00ca621bdd88ade /target/ppc
parentddd835f32a18c087d3161213f47e89566ce05cc8 (diff)
downloadqemu-efb7db250adad82c4bb302f0a80e4ae0c641f0d6.tar.gz
target/ppc: Fix backwards migration of msr_mask
21b786f "PowerPC: Add TS bits into msr_mask" added the transaction states to msr_mask for recent POWER CPUs to allow correct migration of machines that are in certain interim transactional memory states. This was correct, but unfortunately breaks backwards of pseries-2.7 and earlier machine types which (stupidly) transferred the msr_mask in the migration stream and failed if it wasn't equal on each end. This works around the problem by masking out the new MSR bits in the compatibility code to send the msr_mask on old machine types. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Greg Kurz <groug@kaod.org> Tested-by: Greg Kurz <groug@kaod.org> Tested-by: Lukáš Doktor <ldoktor@redhat.com>
Diffstat (limited to 'target/ppc')
-rw-r--r--target/ppc/machine.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/target/ppc/machine.c b/target/ppc/machine.c
index e475206c6a..0634cdb295 100644
--- a/target/ppc/machine.c
+++ b/target/ppc/machine.c
@@ -190,7 +190,15 @@ static int cpu_pre_save(void *opaque)
/* Hacks for migration compatibility between 2.6, 2.7 & 2.8 */
if (cpu->pre_2_8_migration) {
- cpu->mig_msr_mask = env->msr_mask;
+ /* Mask out bits that got added to msr_mask since the versions
+ * which stupidly included it in the migration stream. */
+ target_ulong metamask = 0
+#if defined(TARGET_PPC64)
+ | (1ULL << MSR_TS0)
+ | (1ULL << MSR_TS1)
+#endif
+ ;
+ cpu->mig_msr_mask = env->msr_mask & ~metamask;
cpu->mig_insns_flags = env->insns_flags & insns_compat_mask;
cpu->mig_insns_flags2 = env->insns_flags2 & insns_compat_mask2;
cpu->mig_nb_BATs = env->nb_BATs;