]> www.infradead.org Git - qemu-nvme.git/commitdiff
ppc: Enforce setting MSR:EE,IR and DR when MSR:PR is set
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 27 Jun 2016 06:55:18 +0000 (08:55 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 30 Jun 2016 23:57:01 +0000 (09:57 +1000)
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>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target-ppc/helper_regs.h

index 8fc09344db29b2dace5147329686390b08dd00db..8fdfa5c7e6ab987e5c199743c35c088d72f53716 100644 (file)
@@ -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);