target/ppc: Let mtmsr set MSR[ME] on 32-bit PowerPC
PATCH 1/2 target/ppc: Let mtmsr set MSR[ME] on 32-bit PowerPC
In reply to a message not in the archiveOn the 32-bit processors (601, 603, 604, 750, 74xx) mtmsr does set ME, and permits machine checks, otherwise machine check ends in a checkstop.
Signed-off-by Eric DeVolder <[email protected]>
--- target/ppc/translate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
target/ppc/translate.c +6 -2
@@ -4282,8 +4282,12 @@ static void gen_mtmsr(DisasContext *ctx) mask &= (1ULL <<MSR_RI ) | (1ULL <<MSR_EE ); }else {if (likely (!(ctx->insns_flags2 &PPC2_PPE42 ))) { -/* mtmsr does not alter S, ME, or LE */ - mask &= ~((1ULL <<MSR_LE ) | (1ULL <<MSR_ME ) | (1ULL <<MSR_S )); +/* mtmsr does not alter S or LE */ + mask &= ~((1ULL <<MSR_LE ) | (1ULL <<MSR_S )); +/* nor ME, on the 64-bit server processors; the 6xx can */ +if (is_book3s_arch2x (ctx)) { + mask &= ~(1ULL <<MSR_ME ); + } }/*
Signature · 1 line
2.53.0
PATCH 2/2 target/ppc: Raise a machine check on a failed bus access on 6xx
For 6XX, enable ppc_cpu_do_transaction_failed() to take the machine check.
Signed-off-by Eric DeVolder <[email protected]>
--- target/ppc/tcg-excp_helper.c | 6 ++++++ 1 file changed, 6 insertions(+)
target/ppc/tcg-excp_helper.c +6 -0
@@ -297,6 +297,12 @@ void ppc_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, }break ;#endif +case POWERPC_EXCP_6xx: +/* +* A bus error (TEA) takes a machine check, if MSR[ME] is set. The +* 603 and 604 have no DAR or DSISR update for it. +*/ +break ;default :/* * TODO: Check behaviour for other CPUs, for now do nothing.
Signature · 1 line
2.53.0