summaryrefslogtreecommitdiff
path: root/cpu-exec.c
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 /cpu-exec.c
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 'cpu-exec.c')
-rw-r--r--cpu-exec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 567ae8bda1..e24c640013 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -507,8 +507,12 @@ int cpu_exec(CPUState *cpu)
* loop. Whatever requested the exit will also
* have set something else (eg exit_request or
* interrupt_request) which we will handle
- * next time around the loop.
+ * next time around the loop. But we need to
+ * ensure the tcg_exit_req read in generated code
+ * comes before the next read of cpu->exit_request
+ * or cpu->interrupt_request.
*/
+ smp_rmb();
next_tb = 0;
break;
case TB_EXIT_ICOUNT_EXPIRED: