From patchwork Tue Apr 17 07:17:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 899105 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b="EHVd0xJb"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40QGz3627bz9s1P for ; Tue, 17 Apr 2018 17:26:55 +1000 (AEST) Received: from localhost ([::1]:48100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8L0v-0002Hu-TQ for incoming@patchwork.ozlabs.org; Tue, 17 Apr 2018 03:26:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8Kru-0003So-M9 for qemu-devel@nongnu.org; Tue, 17 Apr 2018 03:17:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8Krt-0008V4-DT for qemu-devel@nongnu.org; Tue, 17 Apr 2018 03:17:34 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:44899) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f8Krt-0008TW-0w; Tue, 17 Apr 2018 03:17:33 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 40QGm74mpsz9s27; Tue, 17 Apr 2018 17:17:27 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1523949447; bh=RXhP+9AgHqKp2nGS+NAuehPIZHYfOH6M80F7SRISD18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EHVd0xJbYczgQNCiJDa0xXaQjfUqnjnk+jxPvwhJP2ez4SUwFQY+8Ml8hVs5iZp2Q uS7sfERPGS2k2sdto++eSwoVMXi2o/JkGnVXap1EfhP6RPRgGrybOmaw4pXb93tUql GuahRO+cjf0+U4+4pynVPLaysNoNs0x2e9ipaNm8= From: David Gibson To: groug@kaod.org Date: Tue, 17 Apr 2018 17:17:21 +1000 Message-Id: <20180417071722.9399-10-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180417071722.9399-1-david@gibson.dropbear.id.au> References: <20180417071722.9399-1-david@gibson.dropbear.id.au> 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] [PATCH for-2.13 09/10] 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: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 5e89901149..bb5559d799 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -8870,12 +8870,11 @@ void cpu_ppc_set_papr(PowerPCCPU *cpu, PPCVirtualHypervisor *vhyp) cpu->vhyp = vhyp; - /* 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 &= ~((1ull << MSR_EP) | MSR_HVB); + env->msr_mask &= ~MSR_HVB; /* Tell KVM that we're in PAPR mode */ if (kvm_enabled()) {