On 09/22/2017 10:59 AM, Peter Maydell wrote:
> + if ((env->regs[15] & 1) && !arm_feature(env, ARM_FEATURE_V8)) {
> qemu_log_mask(LOG_GUEST_ERROR,
> "M profile return from interrupt with misaligned "
> - "PC is UNPREDICTABLE\n");
> - /* Actual hardware seems to ignore the lsbit, and there are
> several
> - * RTOSes out there which incorrectly assume the r15 in the stack
> - * frame should be a Thumb-style "lsbit indicates ARM/Thumb"
> value.
> - */
> - env->regs[15] &= ~1U;
> + "PC is UNPREDICTABLE on v7M\n");
> }
> + env->regs[15] &= ~1U;
If you're going to always test regs[15] & 1, you might as well use that and
avoid an unlikely(?) writeback.
if (env->regs[15] & 1) {
if (!arm_feature(env, ARM_FEATURE_V8)) {
qemu_log_mask(...);
}
env->regs[15] &= ~1U;
}
Otherwise,
Reviewed-by: Richard Henderson <[email protected]>
r~