From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: groug@kaod.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 3/7] target/ppc: Fix backwards migration of msr_mask
Date: Tue, 10 Apr 2018 22:52:29 +1000 [thread overview]
Message-ID: <20180410125233.31618-4-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20180410125233.31618-1-david@gibson.dropbear.id.au>
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>
---
target/ppc/machine.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
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;
--
2.14.3
next prev parent reply other threads:[~2018-04-10 12:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-10 12:52 [Qemu-devel] [PULL 0/7] ppc-for-2.12 queue 20180410 David Gibson
2018-04-10 12:52 ` [Qemu-devel] [PULL 1/7] target/ppc: Initialize lazy_tlb_flush correctly David Gibson
2018-04-10 12:52 ` [Qemu-devel] [PULL 2/7] hw/misc/macio: Fix crash when listing device properties of macio device David Gibson
2018-04-10 12:52 ` David Gibson [this message]
2018-04-10 12:52 ` [Qemu-devel] [PULL 4/7] spapr: Initialize reserved areas list in FDT in H_CAS handler David Gibson
2018-04-10 12:52 ` [Qemu-devel] [PULL 5/7] tests/boot-serial: Test the sam460ex board David Gibson
2018-04-10 12:52 ` [Qemu-devel] [PULL 6/7] sam460ex: Fix timer frequency and clock multipliers David Gibson
2018-04-10 12:52 ` [Qemu-devel] [PULL 7/7] roms/u-boot-sam460ex: Change to qemu git mirror and update David Gibson
2018-04-10 21:16 ` [Qemu-devel] [PULL 0/7] ppc-for-2.12 queue 20180410 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180410125233.31618-4-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).