From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIs7i-0003aw-KY for qemu-devel@nongnu.org; Fri, 01 Jul 2016 02:40:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIs7g-0003GX-Hg for qemu-devel@nongnu.org; Fri, 01 Jul 2016 02:40:21 -0400 From: David Gibson Date: Fri, 1 Jul 2016 16:41:41 +1000 Message-Id: <1467355319-28406-6-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1467355319-28406-1-git-send-email-david@gibson.dropbear.id.au> References: <1467355319-28406-1-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 05/23] 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: peter.maydell@linaro.org Cc: agraf@suse.de, benh@kernel.crashing.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson 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 Signed-off-by: David Gibson --- 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 8fc0934..8fdfa5c 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.7.4