diff --git a/qemu/accel/tcg/cpu-exec.c b/qemu/accel/tcg/cpu-exec.c index b9155ddc..ae02e407 100644 --- a/qemu/accel/tcg/cpu-exec.c +++ b/qemu/accel/tcg/cpu-exec.c @@ -69,7 +69,8 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) } else { assert(cc->set_pc); // avoid sync twice when helper_uc_tracecode() already did this. - if (env->uc->emu_counter <= env->uc->emu_count && !env->uc->quit_request) { + if (env->uc->emu_counter <= env->uc->emu_count && + !env->uc->stop_request && !env->uc->quit_request) { cc->set_pc(cpu, last_tb->pc); } } diff --git a/qemu/accel/tcg/translate-all.c b/qemu/accel/tcg/translate-all.c index b44a54a9..858d26b1 100644 --- a/qemu/accel/tcg/translate-all.c +++ b/qemu/accel/tcg/translate-all.c @@ -202,9 +202,9 @@ void tb_cleanup(struct uc_struct *uc) return; } - int x = V_L1_SHIFT / V_L2_BITS; + int x = uc->v_l1_shift / V_L2_BITS; if (x <= 1) { - for (int i = 0; i < V_L1_SIZE; i++) { + for (int i = 0; i < uc->v_l1_size; i++) { void **p = uc->l1_map[i]; if (p) { g_free(p); @@ -212,7 +212,7 @@ void tb_cleanup(struct uc_struct *uc) } } } else { - for (int i = 0; i < V_L1_SIZE; i++) { + for (int i = 0; i < uc->v_l1_size; i++) { void **p = uc->l1_map[i]; if (p) { tb_clean_internal(p, x - 1);