From nobody Sun Feb 8 12:37:56 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 1532377273378578.0139816731645; Mon, 23 Jul 2018 13:21:13 -0700 (PDT) Received: from localhost ([::1]:36333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhKI-0002sK-W5 for importer@patchew.org; Mon, 23 Jul 2018 16:21:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40500) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhI1-0001HX-Sq for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:18:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhHz-00024g-NJ for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:18:41 -0400 Received: from mail-oi0-x243.google.com ([2607:f8b0:4003:c06::243]:34577) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhHz-00023r-IX; Mon, 23 Jul 2018 16:18:39 -0400 Received: by mail-oi0-x243.google.com with SMTP id 13-v6so3495952ois.1; Mon, 23 Jul 2018 13:18:39 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id m3-v6sm7176380oif.26.2018.07.23.13.18.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=ExvIWzSONOdIBZmzBeL/6fry0hzqjLnSz60uSmmUi4U=; b=DnA+PW+lnnxk7uUy5LzDNHze6ckVDuFNlT6ULvfJcNcfCBh9xKCQtVLOkCH6thXSX7 aBGeh0oBwBunS9FQnacm/UbCawrJykzwqHXpDa9eXE0lGs5bG/JBwx79QqaL6yKN/k9o 8vHD//o2VOUqM6/eeLJEK69l+eepZaj2k4FzRng8fm/r5+LAOePHXXw91B95Dkno0bB/ MR2v4s8pLR1IKhGTN/F9gFfNQaHQafQc2X0WJkjxMNi1XyHyo3q/pX7X/TGsOVMo1TGX bUic0LmU5jAErmcqBIuZdPyNpM8xML3mpikOBEYT/oTjLGW5XDGCq+giw6jwSdK3gPhq 3/eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=ExvIWzSONOdIBZmzBeL/6fry0hzqjLnSz60uSmmUi4U=; b=aOLSeHIHJxrNGtxpysbEMw9STvE3Qyd0ou3FCmLhHYyaS0hHxkhDB7bLC/g1C611if fye/9pAcFpm+/6N2rkxfWYUvgXv96JuUT3QFR5Lku/1O63NEIT9/X4yXlrHUPR+DD/fH UYN0/euJ4VphyF8YtiRA8tX+OJZlH+eKcISU5mEPYSPyWlcIRv0lx3ojo3EJicL4nG1l PE/iPyHH8+SuSaOTFAqQLRCRfWy4GPtkJcloYVEnfSma5xdwVY1WKdwek/FCf4ei+9zp ljbvNn3zv7S3OI62zhpTpaaILS72zVz8uFdtV9+orGbn0qmNImIi0SSQqg1uxSKzFuQo Kdcg== X-Gm-Message-State: AOUpUlGBKuJseo3nDn3fR/fVEejMFj86z4VW7Th+eOcauybyxemZ6xiS 78tfkEi6nbzEeP1aOQMOC82sS5g0MSE= X-Google-Smtp-Source: AAOMgpew6ELUyY7QJskX+qaJLtZuDFZdiBxPBPP9xo/0BrU5bh+MWSemJpI0ptyVS5UGQBYtQo/m5Q== X-Received: by 2002:aca:6141:: with SMTP id v62-v6mr321949oib.240.1532377118370; Mon, 23 Jul 2018 13:18:38 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:16:18 -0500 Message-Id: <20180723201748.25573-10-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::243 Subject: [Qemu-devel] [PATCH 09/99] spapr: don't advertise radix GTSE if max-compat-cpu < 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: David Gibson , qemu-stable@nongnu.org, Greg Kurz 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: Greg Kurz On a POWER9 host, if a guest runs in pre POWER9 compat mode, it necessarily uses the hash MMU mode. In this case, we shouldn't advertise radix GTSE in the ibm,arch-vec-5-platform-support DT property as the current code does. The first reason is that it doesn't make sense, and the second one is that causes the CAS-negotiated options subsection to be migrated. This breaks backward migration to QEMU 2.7 and older versions on POWER8 hosts: qemu-system-ppc64: error while loading state for instance 0x0 of device 'spapr' qemu-system-ppc64: load of migration failed: No such file or directory This patch hence initialize CPUs a bit earlier so that we can check the requested compat mode, and don't set OV5_MMU_RADIX_GTSE for power8 and older. Signed-off-by: Greg Kurz Signed-off-by: David Gibson (cherry picked from commit 0550b1206a91d66051a21441a02c4ff126b531fe) Signed-off-by: Michael Roth --- hw/ppc/spapr.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index a81570e7c8..092ec2498c 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2392,6 +2392,7 @@ static void spapr_machine_init(MachineState *machine) long load_limit, fw_size; char *filename; Error *resize_hpt_err =3D NULL; + PowerPCCPU *first_ppc_cpu; =20 msi_nonbroken =3D true; =20 @@ -2484,11 +2485,6 @@ static void spapr_machine_init(MachineState *machine) } =20 spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY); - if (!kvm_enabled() || kvmppc_has_cap_mmu_radix()) { - /* KVM and TCG always allow GTSE with radix... */ - spapr_ovec_set(spapr->ov5, OV5_MMU_RADIX_GTSE); - } - /* ... but not with hash (currently). */ =20 /* advertise support for dedicated HP event source to guests */ if (spapr->use_hotplug_event_source) { @@ -2503,6 +2499,15 @@ static void spapr_machine_init(MachineState *machine) /* init CPUs */ spapr_init_cpus(spapr); =20 + 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)) { + /* KVM and TCG always allow GTSE with radix... */ + spapr_ovec_set(spapr->ov5, OV5_MMU_RADIX_GTSE); + } + /* ... but not with hash (currently). */ + if (kvm_enabled()) { /* Enable H_LOGICAL_CI_* so SLOF can talk to in-kernel devices */ kvmppc_enable_logical_ci_hcalls(); --=20 2.17.1