From nobody Tue Feb 10 04:16:00 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1513318111420235.25488501736993; Thu, 14 Dec 2017 22:08:31 -0800 (PST) Received: from localhost ([::1]:44655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePjAS-0007Ah-SE for importer@patchew.org; Fri, 15 Dec 2017 01:08:20 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePixT-0003kh-CD for qemu-devel@nongnu.org; Fri, 15 Dec 2017 00:54:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePixR-0004pM-79 for qemu-devel@nongnu.org; Fri, 15 Dec 2017 00:54:55 -0500 Received: from ozlabs.org ([103.22.144.67]:60821) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePixQ-0004kY-Mu; Fri, 15 Dec 2017 00:54:53 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 3yyflT1lJ9z9tDG; Fri, 15 Dec 2017 16:54:44 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1513317285; bh=ME8oL7BDXLClnaXGao1nFRee1kcdcXKo65tDsqInZ6E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ts6KYvI6mKNOZRRvVizI2PJgel/0zHC7i21U0w9RT14Bywpf9WuN8nLYZWBpkmfz2 lBdMDJAtyCgywEgzPKyiUwxE3iPWy/igGxl//pDsr9Qoz97whYxgNqBba7qcfE7fzA s9IKcFy95UseuiBjDlgnBG9r9SPsUpajyqKCAqag= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 15 Dec 2017 16:54:35 +1100 Message-Id: <20171215055435.24204-25-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171215055435.24204-1-david@gibson.dropbear.id.au> References: <20171215055435.24204-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 24/24] spapr: don't initialize PATB entry if max-cpu-compat < power9 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, agraf@suse.de, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@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" From: Laurent Vivier if KVM is enabled and KVM capabilities MMU radix is available, the partition table entry (patb_entry) for the radix mode is initialized by default in ppc_spapr_reset(). It's a problem if we want to migrate the guest to a POWER8 host while the kernel is not started to set the value to the one expected for a POWER8 CPU. The "-machine max-cpu-compat=3Dpower8" should allow to migrate a POWER9 KVM host to a POWER8 KVM host, but because patb_entry is set, the destination QEMU tries to enable radix mode on the POWER8 host. This fails and cancels the migration: Process table config unsupported by the host error while loading state for instance 0x0 of device 'spapr' load of migration failed: Invalid argument This patch doesn't set the PATB entry if the user provides a CPU compatibility mode that doesn't support radix mode. Signed-off-by: Laurent Vivier Signed-off-by: David Gibson --- hw/ppc/spapr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4f354a8760..6785a90c60 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1466,7 +1466,10 @@ static void spapr_machine_reset(void) /* Check for unknown sysbus devices */ foreach_dynamic_sysbus_device(find_unknown_sysbus_device, NULL); =20 - if (kvm_enabled() && kvmppc_has_cap_mmu_radix()) { + first_ppc_cpu =3D POWERPC_CPU(first_cpu); + if (kvm_enabled() && kvmppc_has_cap_mmu_radix() && + ppc_check_compat(first_ppc_cpu, CPU_POWERPC_LOGICAL_3_00, 0, + spapr->max_compat_pvr)) { /* If using KVM with radix mode available, VCPUs can be started * without a HPT because KVM will start them in radix mode. * Set the GR bit in PATB so that we know there is no HPT. */ @@ -1525,7 +1528,6 @@ static void spapr_machine_reset(void) g_free(fdt); =20 /* Set up the entry state */ - first_ppc_cpu =3D POWERPC_CPU(first_cpu); first_ppc_cpu->env.gpr[3] =3D fdt_addr; first_ppc_cpu->env.gpr[5] =3D 0; first_cpu->halted =3D 0; --=20 2.14.3