diff --git a/qemu/cpu-exec.c b/qemu/cpu-exec.c index 2143433e..b9123115 100644 --- a/qemu/cpu-exec.c +++ b/qemu/cpu-exec.c @@ -78,7 +78,7 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb) /* We were asked to stop executing TBs (probably a pending * interrupt. We've now stopped, so clear the flag. */ - cpu->tcg_exit_req = 0; + atomic_set(&cpu->tcg_exit_req, 0); } return ret; } diff --git a/qemu/qom/cpu.c b/qemu/qom/cpu.c index 3ac22786..98c09587 100644 --- a/qemu/qom/cpu.c +++ b/qemu/qom/cpu.c @@ -108,10 +108,10 @@ void cpu_reset_interrupt(CPUState *cpu, int mask) void cpu_exit(CPUState *cpu) { - cpu->exit_request = 1; + atomic_set(&cpu->exit_request, 1); /* Ensure cpu_exec will see the exit request after TCG has exited. */ smp_wmb(); - cpu->tcg_exit_req = 1; + atomic_set(&cpu->tcg_exit_req, 1); } static void cpu_common_noop(CPUState *cpu)