Signed-off-by: Emilio G. Cota <c...@braap.org> --- include/exec/gen-icount.h | 1 + translate-all.c | 2 ++ 2 files changed, 3 insertions(+)
diff --git a/include/exec/gen-icount.h b/include/exec/gen-icount.h index 05d89d3..f429821 100644 --- a/include/exec/gen-icount.h +++ b/include/exec/gen-icount.h @@ -16,6 +16,7 @@ static inline void gen_tb_start(TranslationBlock *tb) exitreq_label = gen_new_label(); flag = tcg_temp_new_i32(); + tcg_gen_smp_rmb(); tcg_gen_ld_i32(flag, cpu_env, offsetof(CPUState, tcg_exit_req) - ENV_OFFSET); tcg_gen_brcondi_i32(TCG_COND_NE, flag, 0, exitreq_label); diff --git a/translate-all.c b/translate-all.c index 12eaed7..76a0be8 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1614,6 +1614,7 @@ static void tcg_handle_interrupt(CPUState *cpu, int mask) cpu_abort(cpu, "Raised interrupt while not in I/O function"); } } else { + smp_wmb(); cpu->tcg_exit_req = 1; } } @@ -1791,6 +1792,7 @@ void dump_opcount_info(FILE *f, fprintf_function cpu_fprintf) void cpu_interrupt(CPUState *cpu, int mask) { atomic_or(&cpu->interrupt_request, mask); + smp_wmb(); cpu->tcg_exit_req = 1; } -- 1.9.1