From nobody Tue Feb 10 10:54:51 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.zoho.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 1498820054397717.221712579294; Fri, 30 Jun 2017 03:54:14 -0700 (PDT) Received: from localhost ([::1]:43668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQtYy-0006Ta-Mp for importer@patchew.org; Fri, 30 Jun 2017 06:54:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQtRj-0008SK-UN for qemu-devel@nongnu.org; Fri, 30 Jun 2017 06:46:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQtRi-0007u8-RB for qemu-devel@nongnu.org; Fri, 30 Jun 2017 06:46:43 -0400 Received: from ozlabs.org ([103.22.144.67]:42809) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dQtRi-0007sW-Fk; Fri, 30 Jun 2017 06:46:42 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3wzY9n0lBlz9sNd; Fri, 30 Jun 2017 20:46:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1498819597; bh=gSoio5/asrfTcNsuUPYj2Uk15pMcS+BjxI7ghZNMXRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W9ros3lCskOj9S6b5anbHkulCFg1U64W9KZ3kzCBmgpW6XLOVA+h2EUmyrNqhu9Mg pvMiOfyPHispAHE8iDhwDW5h34LGi2rTtIzbCqJuelLKIK5JZoASaf5D7OTU7QnxBe X5jtAkgXG+sO5hLG8gYEHeLnTSrlCMPBQEMU+ixE= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 30 Jun 2017 20:46:17 +1000 Message-Id: <20170630104632.27942-7-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170630104632.27942-1-david@gibson.dropbear.id.au> References: <20170630104632.27942-1-david@gibson.dropbear.id.au> 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] [PULL 06/21] spapr: Add a "no HPT" encoding to HTAB migration stream 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: lvivier@redhat.com, thuth@redhat.com, qemu-devel@nongnu.org, sursingh@redhat.com, mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org, Bharata B Rao , sbobroff@redhat.com, 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" From: Bharata B Rao Add a "no HPT" encoding (using value -1) to the HTAB migration stream (in the place of HPT size) when the guest doesn't allocate HPT. This will help the target side to match target HPT with the source HPT and thus enable successful migration. Suggested-by: David Gibson Signed-off-by: Bharata B Rao Signed-off-by: David Gibson --- hw/ppc/spapr.c | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 52f4e72..f3e0b9b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1560,13 +1560,19 @@ static int htab_save_setup(QEMUFile *f, void *opaqu= e) sPAPRMachineState *spapr =3D opaque; =20 /* "Iteration" header */ - qemu_put_be32(f, spapr->htab_shift); + if (!spapr->htab_shift) { + qemu_put_be32(f, -1); + } else { + qemu_put_be32(f, spapr->htab_shift); + } =20 if (spapr->htab) { spapr->htab_save_index =3D 0; spapr->htab_first_pass =3D true; } else { - assert(kvm_enabled()); + if (spapr->htab_shift) { + assert(kvm_enabled()); + } } =20 =20 @@ -1712,7 +1718,12 @@ static int htab_save_iterate(QEMUFile *f, void *opaq= ue) int rc =3D 0; =20 /* Iteration header */ - qemu_put_be32(f, 0); + if (!spapr->htab_shift) { + qemu_put_be32(f, -1); + return 0; + } else { + qemu_put_be32(f, 0); + } =20 if (!spapr->htab) { assert(kvm_enabled()); @@ -1746,7 +1757,12 @@ static int htab_save_complete(QEMUFile *f, void *opa= que) int fd; =20 /* Iteration header */ - qemu_put_be32(f, 0); + if (!spapr->htab_shift) { + qemu_put_be32(f, -1); + return 0; + } else { + qemu_put_be32(f, 0); + } =20 if (!spapr->htab) { int rc; @@ -1790,6 +1806,11 @@ static int htab_load(QEMUFile *f, void *opaque, int = version_id) =20 section_hdr =3D qemu_get_be32(f); =20 + if (section_hdr =3D=3D -1) { + spapr_free_hpt(spapr); + return 0; + } + if (section_hdr) { Error *local_err =3D NULL; =20 --=20 2.9.4