From nobody Sat Oct 25 21:46:06 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521512688144303.7654278371897; Mon, 19 Mar 2018 19:24:48 -0700 (PDT) Received: from localhost ([::1]:45054 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey6x5-0007JU-BL for importer@patchew.org; Mon, 19 Mar 2018 22:24:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey6w1-0006gY-Di for qemu-devel@nongnu.org; Mon, 19 Mar 2018 22:23:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey6vy-0001uN-Ac for qemu-devel@nongnu.org; Mon, 19 Mar 2018 22:23:33 -0400 Received: from ozlabs.org ([103.22.144.67]:49983) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ey6vx-0001s2-CO; Mon, 19 Mar 2018 22:23:30 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 404xYl5MSLz9sMM; Tue, 20 Mar 2018 13:23:23 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1521512603; bh=pwIdMYJVnunG7mWbp6n8f6NIyvkiNu62k9aioN1/BKk=; h=From:To:Cc:Subject:Date:From; b=B9uAROtUF/+aW+GXHO7Zv0jfPgXU9W/tH9XMiBUmYqCEDJDhL9Qrff5GV4jXZELwK xoPGE9gwKVC0Y5MI8BcIJCn+jZZFNjs1xcuCJO7FtFE/1t37qMXG9XXdJdG66C3js+ X3fKPCg1FYTRQRJZXpmW1VdDj8Kygs23HNZQmKl0= From: David Gibson To: groug@kaod.org, lvivier@redhat.com, wei.guo.simon@gmail.com Date: Tue, 20 Mar 2018 13:23:19 +1100 Message-Id: <20180320022319.17199-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PATCH] target/ppc: Fix backwards migration of msr_mask X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ldoktor@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Greg Kurz Reviewed-by: Laurent Vivier Tested-by: Greg Kurz Tested-by: Luk=C3=A1=C5=A1 Doktor =20 --- 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) =20 /* Hacks for migration compatibility between 2.6, 2.7 & 2.8 */ if (cpu->pre_2_8_migration) { - cpu->mig_msr_mask =3D 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 =3D 0 +#if defined(TARGET_PPC64) + | (1ULL << MSR_TS0) + | (1ULL << MSR_TS1) +#endif + ; + cpu->mig_msr_mask =3D env->msr_mask & ~metamask; cpu->mig_insns_flags =3D env->insns_flags & insns_compat_mask; cpu->mig_insns_flags2 =3D env->insns_flags2 & insns_compat_mask2; cpu->mig_nb_BATs =3D env->nb_BATs; --=20 2.14.3