qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: qemu-ppc@nongnu.org
Cc: David Gibson <david@gibson.dropbear.id.au>,
	Alexander Graf <agraf@suse.de>,
	qemu-devel@nongnu.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Cedric Le Goater <clg@kaod.org>
Subject: [Qemu-devel] [PATCH 5/8] ppc: Enforce setting MSR:EE, IR and DR when MSR:PR is set
Date: Mon, 27 Jun 2016 08:55:18 +0200	[thread overview]
Message-ID: <1467010521-6106-6-git-send-email-clg@kaod.org> (raw)
In-Reply-To: <1467010521-6106-1-git-send-email-clg@kaod.org>

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

The architecture specifies that any instruction that sets MSR:PR will also
set MSR:EE, IR and DR.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 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, target_ulong value,
         /* Change the exception prefix on PowerPC 601 */
         env->excp_prefix = ((value >> MSR_EP) & 1) * 0xFFF00000;
     }
+    /* If PR=1 then EE, IR and DR must be 1 */
+    if ((value >> MSR_PR) & 1) {
+        value |= (1 << MSR_EE) | (1 << MSR_DR) | (1 << MSR_IR);
+    }
 #endif
     env->msr = value;
     hreg_compute_hflags(env);
-- 
2.1.4

  parent reply	other threads:[~2016-06-27  6:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27  6:55 [Qemu-devel] [PATCH 0/8] pnv: more fixes to the exception model Cédric Le Goater
2016-06-27  6:55 ` [Qemu-devel] [PATCH 1/8] ppc: Add a bunch of hypervisor SPRs to Book3s Cédric Le Goater
2016-06-27  6:55 ` [Qemu-devel] [PATCH 2/8] ppc: Update LPCR definitions Cédric Le Goater
2016-06-27  6:55 ` [Qemu-devel] [PATCH 3/8] ppc: Use a helper to filter writes to LPCR Cédric Le Goater
2016-06-27  6:55 ` [Qemu-devel] [PATCH 4/8] ppc: Fix conditions for delivering external interrupts to a guest Cédric Le Goater
2016-06-27  6:55 ` Cédric Le Goater [this message]
2016-06-27  6:55 ` [Qemu-devel] [PATCH 6/8] ppc: Initial HDEC support Cédric Le Goater
2016-06-27  6:55 ` [Qemu-devel] [PATCH 7/8] ppc: LPCR is a HV resource Cédric Le Goater
2016-06-27  6:55 ` [Qemu-devel] [PATCH 8/8] ppc: Print HSRR0/HSRR1 in "info registers" Cédric Le Goater
2016-06-28  5:39 ` [Qemu-devel] [PATCH 0/8] pnv: more fixes to the exception model David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467010521-6106-6-git-send-email-clg@kaod.org \
    --to=clg@kaod.org \
    --cc=agraf@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).