]> git.proxmox.com Git - mirror_qemu.git/commit - cpus-common.c
cpus-common: simplify locking for start_exclusive/end_exclusive
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 2 Sep 2016 21:33:38 +0000 (23:33 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 27 Sep 2016 09:57:30 +0000 (11:57 +0200)
commit758e1b2b622d7c177dc2d95e887a11aa069b7e68
tree4b8fc6e2fa1fac81eeb8d038ee1f213dbab71a3a
parentcf07da65f335b9a74e62f5413078f67280572f36
cpus-common: simplify locking for start_exclusive/end_exclusive

It is not necessary to hold qemu_cpu_list_mutex throughout the
exclusive section, because no other exclusive section can run
while pending_cpus != 0.

exclusive_idle() is called in cpu_exec_start(), and that prevents
any CPUs created after start_exclusive() from entering cpu_exec()
during an exclusive section.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cpus-common.c
docs/tcg-exclusive.promela
include/qom/cpu.h