From nobody Wed Oct 29 09:27:44 2025 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1524823201318789.2609056084665; Fri, 27 Apr 2018 03:00:01 -0700 (PDT) Received: from localhost ([::1]:46904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fC0Aa-0003HU-Fo for importer@patchew.org; Fri, 27 Apr 2018 06:00:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBzac-0002ES-6Y for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:22:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBzab-0002LH-1c for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:22:50 -0400 Received: from ozlabs.org ([203.11.71.1]:34833) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBzaa-0002KL-MM; Fri, 27 Apr 2018 05:22:48 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 40XT2w0bf3z9sXr; Fri, 27 Apr 2018 19:21:42 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1524820904; bh=A2hdNm2LHzKVN2TnFhOHanOVJSDvzcLhzEIJzUrgzB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JfJSoDuSI1sbUMMNFMxIsKATOT02+y607VLGwe1bt98plxWfpODBwuoBpEm75Qulm 7ZOf5SCh2oDRPZ0UIBH1kSVvupuQcau1bMFckq1w5unIzOSKnRWgeqTHACC8auknWn 0U06Svyf4DJioeSZR+t2kctDLxNgdRNsAbpin/R4= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 27 Apr 2018 19:21:24 +1000 Message-Id: <20180427092126.24812-48-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180427092126.24812-1-david@gibson.dropbear.id.au> References: <20180427092126.24812-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: 203.11.71.1 Subject: [Qemu-devel] [PULL 47/49] target/ppc: Don't bother with MSR_EP in cpu_ppc_set_papr() 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-ppc@nongnu.org, groug@kaod.org, qemu-devel@nongnu.org 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" cpu_ppc_set_papr() removes the EP and HV bits from the MSR mask. While removing the HV bit makes sense (a cpu in PAPR mode should never be emulated in hypervisor mode), the EP bit is just bizarre. Although it's true that a papr mode guest shouldn't be able to change the exception prefix, the MSR[EP] bit doesn't even exist on the cpus supported for PAPR mode, so it's pointless to do anything with it here. Signed-off-by: David Gibson Reviewed-by: Thomas Huth --- target/ppc/translate_init.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index bb79d23b50..808f6c1a08 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -8874,12 +8874,11 @@ void cpu_ppc_set_papr(PowerPCCPU *cpu, PPCVirtualHy= pervisor *vhyp) =20 cpu->vhyp =3D vhyp; =20 - /* PAPR always has exception vectors in RAM not ROM. To ensure this, - * MSR[IP] should never be set. - * - * We also disallow setting of MSR_HV + /* + * With a virtual hypervisor mode we never allow the CPU to go + * hypervisor mode itself */ - env->msr_mask &=3D ~((1ull << MSR_EP) | MSR_HVB); + env->msr_mask &=3D ~MSR_HVB; =20 /* Set emulated LPCR to not send interrupts to hypervisor. Note that * under KVM, the actual HW LPCR will be set differently by KVM itself, --=20 2.14.3