Ensure good ordering of memory instruction in cpu_exec
authorOlivier Hainque <hainque@adacore.com>
Tue, 9 Apr 2013 16:06:54 +0000 (18:06 +0200)
committerStefan Weil <sw@weilnetz.de>
Fri, 12 Apr 2013 16:27:16 +0000 (18:27 +0200)
commitec9bd89fa48147e1d16e078217513c1235f9132a
treec67dfa73eba87a51b8dbef752e3881dfd4c05d8f
parented9164a3549f93204d6b096136cda2ce54e9f03a
Ensure good ordering of memory instruction in cpu_exec

The IO thread, when it senses cpu_single_env == 0, expects exit_request
to be checked later on. A compiler scheduling constraint is not strong
enough to ensure this on modern architecture. A memory fence is needed
as well.

Signed-off-by: Olivier Hainque <hainque@adacore.com>
Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
cpu-exec.c