Skip to content

Commit

Permalink
ppc: Enforce setting MSR:EE,IR and DR when MSR:PR is set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ozbenh authored and dgibson committed Jun 30, 2016
1 parent d1dbe37 commit b378bb0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions target-ppc/helper_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b378bb0

Please sign in to comment.