From nobody Wed Feb 11 02:33:21 2026 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1523365225528210.65332911404744; Tue, 10 Apr 2018 06:00:25 -0700 (PDT) Received: from localhost ([::1]:43085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5ssn-0005Fl-8w for importer@patchew.org; Tue, 10 Apr 2018 09:00:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f5slW-00078s-AF for qemu-devel@nongnu.org; Tue, 10 Apr 2018 08:52:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f5slV-0002fX-5D for qemu-devel@nongnu.org; Tue, 10 Apr 2018 08:52:50 -0400 Received: from ozlabs.org ([203.11.71.1]:55477) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f5slU-0002du-Q8; Tue, 10 Apr 2018 08:52:49 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 40L6XB5HYMz9s4t; Tue, 10 Apr 2018 22:52:40 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1523364762; bh=LlQINsFwv71dNTp8wG2cXp8fLbQabLztO5jwxAHHyiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NRLYE9YTOkdxgt3LBRJl/BhqktZnnS3qBzcvXV+orJPac2LEir6dxi4Op1IUyRBv+ y/VmKLyx14KuWAuYzSBF7KccIh6o4Gx+XkBlmRonYiCXpXZHfUCz457ZyM/AHoOt/I VLnJnLZxvRLAkVnyex/yOlA94de+tzQunNn9jiAk= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 10 Apr 2018 22:52:29 +1000 Message-Id: <20180410125233.31618-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180410125233.31618-1-david@gibson.dropbear.id.au> References: <20180410125233.31618-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 3/7] 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: David Gibson , qemu-ppc@nongnu.org, groug@kaod.org, qemu-devel@nongnu.org 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-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 Tested-by: Greg Kurz Tested-by: Luk=C3=A1=C5=A1 Doktor --- 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