diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2021-03-23 12:43:34 -0600 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2021-05-04 11:41:24 +1000 |
commit | 7da31f260d194d203c83712cfa7b2dfe605375fd (patch) | |
tree | 3b9a4fc5b1c362fb0bdf0595eb99f61d5e9f6dce /target/ppc/helper_regs.c | |
parent | 26c55599b8c79887040c6910054a8c3f3f6f9147 (diff) | |
download | qemu-7da31f260d194d203c83712cfa7b2dfe605375fd.zip qemu-7da31f260d194d203c83712cfa7b2dfe605375fd.tar.gz qemu-7da31f260d194d203c83712cfa7b2dfe605375fd.tar.bz2 |
target/ppc: Put dbcr0 single-step bits into hflags
Because these bits were not in hflags, the code generated
for single-stepping on BookE was essentially random.
Recompute hflags when storing to dbcr0.
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210323184340.619757-5-richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'target/ppc/helper_regs.c')
-rw-r--r-- | target/ppc/helper_regs.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/target/ppc/helper_regs.c b/target/ppc/helper_regs.c index df9673b..e345966 100644 --- a/target/ppc/helper_regs.c +++ b/target/ppc/helper_regs.c @@ -114,13 +114,23 @@ void hreg_compute_hflags(CPUPPCState *env) hflags |= le << MSR_LE; } - if (ppc_flags & POWERPC_FLAG_BE) { - QEMU_BUILD_BUG_ON(MSR_BE != HFLAGS_BE); - msr_mask |= 1 << MSR_BE; - } - if (ppc_flags & POWERPC_FLAG_SE) { - QEMU_BUILD_BUG_ON(MSR_SE != HFLAGS_SE); - msr_mask |= 1 << MSR_SE; + if (ppc_flags & POWERPC_FLAG_DE) { + target_ulong dbcr0 = env->spr[SPR_BOOKE_DBCR0]; + if (dbcr0 & DBCR0_ICMP) { + hflags |= 1 << HFLAGS_SE; + } + if (dbcr0 & DBCR0_BRT) { + hflags |= 1 << HFLAGS_BE; + } + } else { + if (ppc_flags & POWERPC_FLAG_BE) { + QEMU_BUILD_BUG_ON(MSR_BE != HFLAGS_BE); + msr_mask |= 1 << MSR_BE; + } + if (ppc_flags & POWERPC_FLAG_SE) { + QEMU_BUILD_BUG_ON(MSR_SE != HFLAGS_SE); + msr_mask |= 1 << MSR_SE; + } } if (msr_is_64bit(env, msr)) { |