|
@@ -21,7 +21,6 @@ static inline void gen_tb_start(const TranslationBlock *tb)
|
|
|
{
|
|
|
TCGv_i32 count;
|
|
|
|
|
|
- tcg_ctx->exitreq_label = gen_new_label();
|
|
|
if (tb_cflags(tb) & CF_USE_ICOUNT) {
|
|
|
count = tcg_temp_local_new_i32();
|
|
|
} else {
|
|
@@ -42,7 +41,19 @@ static inline void gen_tb_start(const TranslationBlock *tb)
|
|
|
icount_start_insn = tcg_last_op();
|
|
|
}
|
|
|
|
|
|
- tcg_gen_brcondi_i32(TCG_COND_LT, count, 0, tcg_ctx->exitreq_label);
|
|
|
+ /*
|
|
|
+ * Emit the check against icount_decr.u32 to see if we should exit
|
|
|
+ * unless we suppress the check with CF_NOIRQ. If we are using
|
|
|
+ * icount and have suppressed interruption the higher level code
|
|
|
+ * should have ensured we don't run more instructions than the
|
|
|
+ * budget.
|
|
|
+ */
|
|
|
+ if (tb_cflags(tb) & CF_NOIRQ) {
|
|
|
+ tcg_ctx->exitreq_label = NULL;
|
|
|
+ } else {
|
|
|
+ tcg_ctx->exitreq_label = gen_new_label();
|
|
|
+ tcg_gen_brcondi_i32(TCG_COND_LT, count, 0, tcg_ctx->exitreq_label);
|
|
|
+ }
|
|
|
|
|
|
if (tb_cflags(tb) & CF_USE_ICOUNT) {
|
|
|
tcg_gen_st16_i32(count, cpu_env,
|
|
@@ -74,8 +85,10 @@ static inline void gen_tb_end(const TranslationBlock *tb, int num_insns)
|
|
|
tcgv_i32_arg(tcg_constant_i32(num_insns)));
|
|
|
}
|
|
|
|
|
|
- gen_set_label(tcg_ctx->exitreq_label);
|
|
|
- tcg_gen_exit_tb(tb, TB_EXIT_REQUESTED);
|
|
|
+ if (tcg_ctx->exitreq_label) {
|
|
|
+ gen_set_label(tcg_ctx->exitreq_label);
|
|
|
+ tcg_gen_exit_tb(tb, TB_EXIT_REQUESTED);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#endif
|