From nobody Sun Nov 9 16:05:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1551158543612100.7029359639688; Mon, 25 Feb 2019 21:22:23 -0800 (PST) Received: from localhost ([127.0.0.1]:49275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyVC7-0001gI-Jn for importer@patchew.org; Tue, 26 Feb 2019 00:22:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyUkn-0004wC-3B for qemu-devel@nongnu.org; Mon, 25 Feb 2019 23:54:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyUkm-0002Ln-13 for qemu-devel@nongnu.org; Mon, 25 Feb 2019 23:54:05 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:39519) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyUkl-0002Cu-HP; Mon, 25 Feb 2019 23:54:03 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 447mfK5jYrz9sNJ; Tue, 26 Feb 2019 15:53:12 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1551156793; bh=VVU6ddmEYEZzO+/PdshJ4o7m72E6u5jPGfoUrGRXBao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=psq+TQLquxaXd7w+Bje3+MNVPlxHWnHK/b/UtSeVVaNhWt+wKM+xcLzfsjXXql4XT 9oc0qM4iJfwfXrQDtmCymGEjoxyj9Bz+Q1M9V8rsb5EHapYP5jhAtpp76OkEJpON73 4aRZyctSRbOpD1+MXyDdZVsPqFLJwAvREtQ4DtC4= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 26 Feb 2019 15:52:34 +1100 Message-Id: <20190226045304.25618-21-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190226045304.25618-1-david@gibson.dropbear.id.au> References: <20190226045304.25618-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 20/50] target/ppc: Re-enable RMLS on POWER9 for virtual hypervisors 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, gkurz@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.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) Content-Type: text/plain; charset="utf-8" From: Benjamin Herrenschmidt Historically the 64-bit server MMU supports two way of configuring the guest "real mode" mapping: - The "RMA" with is a single chunk of physically contiguous memory remapped as guest real, and controlled by the RMLS field in the LPCR register and the RMOR register. - The "VRMA" which uses special PTEs inserted in the partition hash table by the hypervisor. POWER9 deprecates the former, which is reflected by the filtering done in ppc_store_lpcr() which effectively prevents setting of the RMLS field. However, when using fully emulated SPAPR machines, our qemu code currently only knows how to define the guest real mode memory using RMLS. Thus you cannot run a SPAPR machine anymore with a POWER9 CPU model today. This works around it with a quirk in ppc_store_lpcr() to continue allowing the RMLS field to be set when using a virtual hypervisor. Ultimately we will want to implement configuring a VRMA instead which will also be necessary if we want to migrate a SPAPR guest between TCG and KVM but this is a lot more work. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: C=C3=A9dric Le Goater Message-Id: <20190215170029.15641-4-clg@kaod.org> Signed-off-by: David Gibson --- target/ppc/mmu-hash64.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c index f1c7729332..1175b991d9 100644 --- a/target/ppc/mmu-hash64.c +++ b/target/ppc/mmu-hash64.c @@ -1088,6 +1088,14 @@ void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong va= l) (LPCR_PECE_L_MASK & (LPCR_PDEE | LPCR_HDEE | LPCR_EE= E | LPCR_DEE | LPCR_OEE)) | LPCR_MER | LPCR_GTSE | LPCR_= TC | LPCR_HEIC | LPCR_LPES0 | LPCR_HVICE | LPCR_HDICE); + /* + * If we have a virtual hypervisor, we need to bring back RMLS. It + * doesn't exist on an actual P9 but that's all we know how to + * configure with softmmu at the moment + */ + if (cpu->vhyp) { + lpcr |=3D (val & LPCR_RMLS); + } break; default: ; --=20 2.20.1