From nobody Mon Feb 9 18:45:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1578374131; cv=none; d=zohomail.com; s=zohoarc; b=X0xQdMfBkOTSzvc8zsfj6lb8eHoyeyaSZ4D/vBCAODeBCQDmAklQxzbuwb8Ns81jmgsSX4SUslJoE3k0p24v0hB2REsE6NVA4HC9hFjg/2h3bOsKGsb8N77/KmZ61xQ8+qera4RTpIsZH3ALvqDOngf9tZ17YS2hsR7R2NH7MV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578374131; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ktT+vtKRXTLFu2Clru22e1KzrCIUTOdOh0ZUG4D113M=; b=YqUgKBOIQzM5sOTtfzhrf6HrIWO6sTvM+Mv67asfiCVIP/GQ3q/DTp7Gya5pM7HQpZsvadicElMf/AWJFfqWgtqje2Xg7CMcO/VHACXgOfu5WpKtS9H45VKvME4CAG53KRRvt4iFhFw+CdKnEtHBPLMbFrXUo2a/QxxEjijUt08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1578374131836710.1545165134535; Mon, 6 Jan 2020 21:15:31 -0800 (PST) Received: from localhost ([::1]:42310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iohDA-0006jg-V6 for importer@patchew.org; Tue, 07 Jan 2020 00:15:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44238) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iognO-0005P5-Fb for qemu-devel@nongnu.org; Mon, 06 Jan 2020 23:48:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iognM-0004hg-R0 for qemu-devel@nongnu.org; Mon, 06 Jan 2020 23:48:46 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:46393) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iognM-0004cX-GD; Mon, 06 Jan 2020 23:48:44 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 47sKdX4cptz9sRh; Tue, 7 Jan 2020 15:48:32 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1578372512; bh=pOhF9Y4Db6T7gymFJzNkWvkw/xq6Ps53OMhtnsGSzic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KxTiFHSImnyNIq+cIMIL38Cenv3EGiD9e4IEREgxj8BtN15GcG8pKefI6vQTnnsiX 0FrPEU0YZ40Xc0gO502NvQULN9dFzskwv1VlOfV63Obe7PUT3ic878Q3K3/vY2/BU9 Gqim69ipfz/BaykTclnhQGUSPG2sTl+MV7xzvYc4= From: David Gibson To: qemu-devel@nongnu.org, groug@kaod.org, philmd@redhat.com, clg@kaod.org Subject: [PATCH v2 05/10] spapr, ppc: Remove VPM0/RMLS hacks for POWER9 Date: Tue, 7 Jan 2020 15:48:22 +1100 Message-Id: <20200107044827.471355-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107044827.471355-1-david@gibson.dropbear.id.au> References: <20200107044827.471355-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 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, aik@ozlabs.ru, Mark Cave-Ayland , qemu-ppc@nongnu.org, paulus@samba.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" For the "pseries" machine, we use "virtual hypervisor" mode where we only model the CPU in non-hypervisor privileged mode. This means that we need guest physical addresses within the modelled within the cpu to be treated as absolute physical addresses. We used to do that by clearing LPCR[VPM0] and setting LPCR[RMLS] to a high limit so that the old offset based translation for guest mode applied, which does what we need. However, POWER9 has removed support for that translation mode, which meant we had some ugly hacks to keep it working. We now explicitly handle this sort of translation for virtual hypervisor mode, so the hacks aren't necessary. We don't need to set VPM0 and RMLS from the machine type code - they're now ignored in vhyp mode. On the cpu side we don't need to allow LPCR[RMLS] to be set on POWER9 in vhyp mode - that was only there to allow the hack on the machine side. Signed-off-by: David Gibson Reviewed-by: C=C3=A9dric Le Goater --- hw/ppc/spapr_cpu_core.c | 6 +----- target/ppc/mmu-hash64.c | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 8339c4c0f8..daebcd9f38 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -58,14 +58,10 @@ static void spapr_reset_vcpu(PowerPCCPU *cpu) * we don't get spurious wakups before an RTAS start-cpu call. * For the same reason, set PSSCR_EC. */ - lpcr &=3D ~(LPCR_VPM0 | LPCR_VPM1 | LPCR_ISL | LPCR_KBV | pcc->lpcr_pm= ); + lpcr &=3D ~(LPCR_VPM1 | LPCR_ISL | LPCR_KBV | pcc->lpcr_pm); lpcr |=3D LPCR_LPES0 | LPCR_LPES1; env->spr[SPR_PSSCR] |=3D PSSCR_EC; =20 - /* Set RMLS to the max (ie, 16G) */ - lpcr &=3D ~LPCR_RMLS; - lpcr |=3D 1ull << LPCR_RMLS_SHIFT; - ppc_store_lpcr(cpu, lpcr); =20 /* Set a full AMOR so guest can use the AMR as it sees fit */ diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c index d878180df5..d7f9933e6d 100644 --- a/target/ppc/mmu-hash64.c +++ b/target/ppc/mmu-hash64.c @@ -1124,14 +1124,6 @@ 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: g_assert_not_reached(); --=20 2.24.1