summaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-08-18 06:34:19 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2015-09-09 15:34:53 +0200
commitab096a75cd626dcd4ad34b2a11652df0269bee0d (patch)
treec4fe850ffe472f0bee61c7c2a792a1d6e026f4a1 /qom
parentb0a46fa796504c7334202877a68c857e49f7c96c (diff)
downloadqemu-ab096a75cd626dcd4ad34b2a11652df0269bee0d.tar.gz
qemu-ab096a75cd626dcd4ad34b2a11652df0269bee0d.tar.bz2
qemu-ab096a75cd626dcd4ad34b2a11652df0269bee0d.zip
tcg: synchronize cpu->exit_request and cpu->tcg_exit_req accesses
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qom')
-rw-r--r--qom/cpu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/qom/cpu.c b/qom/cpu.c
index 62f4b5de44..02b56f7076 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -114,6 +114,8 @@ void cpu_reset_interrupt(CPUState *cpu, int mask)
void cpu_exit(CPUState *cpu)
{
cpu->exit_request = 1;
+ /* Ensure cpu_exec will see the exit request after TCG has exited. */
+ smp_wmb();
cpu->tcg_exit_req = 1;
}