Received: from eggs.gnu.org ([2001:4830:134:3::10]:50118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHQSp-0007tQ-Pk for qemu-devel@nongnu.org; Mon, 27 Jun 2016 02:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHQSl-0005VM-Ph for qemu-devel@nongnu.org; Mon, 27 Jun 2016 02:56:11 -0400 Received: from 5.mo177.mail-out.ovh.net ([46.105.39.154]:46077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHQSl-0005V9-Je for qemu-devel@nongnu.org; Mon, 27 Jun 2016 02:56:07 -0400 Received: from player699.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo177.mail-out.ovh.net (Postfix) with ESMTP id 03FB9FF9270 for ; Mon, 27 Jun 2016 08:56:07 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Mon, 27 Jun 2016 08:55:18 +0200 Message-Id: <1467010521-6106-6-git-send-email-clg@kaod.org> In-Reply-To: <1467010521-6106-1-git-send-email-clg@kaod.org> References: <1467010521-6106-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 5/8] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org Cc: David Gibson , Alexander Graf , qemu-devel@nongnu.org, Benjamin Herrenschmidt , Cedric Le Goater From: Benjamin Herrenschmidt The architecture specifies that any instruction that sets MSR:PR will als= o set MSR:EE, IR and DR. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: C=C3=A9dric Le Goater --- target-ppc/helper_regs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target-ppc/helper_regs.h b/target-ppc/helper_regs.h index 8fc09344db29..8fdfa5c7e6ab 100644 --- a/target-ppc/helper_regs.h +++ b/target-ppc/helper_regs.h @@ -136,6 +136,10 @@ static inline int hreg_store_msr(CPUPPCState *env, t= arget_ulong value, /* Change the exception prefix on PowerPC 601 */ env->excp_prefix =3D ((value >> MSR_EP) & 1) * 0xFFF00000; } + /* If PR=3D1 then EE, IR and DR must be 1 */ + if ((value >> MSR_PR) & 1) { + value |=3D (1 << MSR_EE) | (1 << MSR_DR) | (1 << MSR_IR); + } #endif env->msr =3D value; hreg_compute_hflags(env); --=20 2.1.4