mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-25 20:16:53 +00:00
target/arm: use DISAS_EXIT for eret handling
Previously DISAS_JUMP did ensure this but with the optimisation of 8a6b28c7 (optimize indirect branches) we might not leave the loop. This means if any pending interrupts are cleared by changing IRQ flags we might never get around to servicing them. You usually notice this by seeing the lookup_tb_ptr() helper gainfully chaining TBs together while cpu->interrupt_request remains high and the exit_request has not been set. This breaks amongst other things the OPTEE test suite which executes an eret from the secure world after a non-secure world IRQ has gone pending which then never gets serviced. Instead of using the previously implied semantics of DISAS_JUMP we use DISAS_EXIT which will always exit the run-loop. Backports commit b29fd33db578decacd14f34933b29aece3e7c25e from qemu
This commit is contained in:
parent
65356210a8
commit
0bd8dc4e0a
|
@ -1831,7 +1831,8 @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gen_helper_exception_return(tcg_ctx, tcg_ctx->cpu_env);
|
gen_helper_exception_return(tcg_ctx, tcg_ctx->cpu_env);
|
||||||
s->is_jmp = DISAS_JUMP;
|
/* Must exit loop to check un-masked IRQs */
|
||||||
|
s->is_jmp = DISAS_EXIT;
|
||||||
return;
|
return;
|
||||||
case 5: /* DRPS */
|
case 5: /* DRPS */
|
||||||
if (rn != 0x1f) {
|
if (rn != 0x1f) {
|
||||||
|
|
|
@ -4618,7 +4618,8 @@ static void gen_rfe(DisasContext *s, TCGv_i32 pc, TCGv_i32 cpsr)
|
||||||
*/
|
*/
|
||||||
gen_helper_cpsr_write_eret(tcg_ctx, tcg_ctx->cpu_env, cpsr);
|
gen_helper_cpsr_write_eret(tcg_ctx, tcg_ctx->cpu_env, cpsr);
|
||||||
tcg_temp_free_i32(tcg_ctx, cpsr);
|
tcg_temp_free_i32(tcg_ctx, cpsr);
|
||||||
s->is_jmp = DISAS_JUMP;
|
/* Must exit loop to check un-masked IRQs */
|
||||||
|
s->is_jmp = DISAS_EXIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate an old-style exception return. Marks pc as dead. */
|
/* Generate an old-style exception return. Marks pc as dead. */
|
||||||
|
@ -9690,7 +9691,8 @@ static void disas_arm_insn(DisasContext *s, unsigned int insn) // qq
|
||||||
tmp = load_cpu_field(s->uc, spsr);
|
tmp = load_cpu_field(s->uc, spsr);
|
||||||
gen_helper_cpsr_write_eret(tcg_ctx, tcg_ctx->cpu_env, tmp);
|
gen_helper_cpsr_write_eret(tcg_ctx, tcg_ctx->cpu_env, tmp);
|
||||||
tcg_temp_free_i32(tcg_ctx, tmp);
|
tcg_temp_free_i32(tcg_ctx, tmp);
|
||||||
s->is_jmp = DISAS_JUMP;
|
/* Must exit loop to check un-masked IRQs */
|
||||||
|
s->is_jmp = DISAS_EXIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue