]> git.proxmox.com Git - mirror_qemu.git/commit - cpus.c
qom: convert the CPU list to RCU
authorEmilio G. Cota <cota@braap.org>
Sun, 19 Aug 2018 09:13:35 +0000 (05:13 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 23 Aug 2018 16:46:25 +0000 (18:46 +0200)
commit068a5ea02f62853116788a2c42d8851a94bb7567
tree0e7c635241a440b1aeee6dd853077fad928a40d4
parent04d595b300041bec645c862baccbea1c8befb6d4
qom: convert the CPU list to RCU

Iterating over the list without using atomics is undefined behaviour,
since the list can be modified concurrently by other threads (e.g.
every time a new thread is created in user-mode).

Fix it by implementing the CPU list as an RCU QTAILQ. This requires
a little bit of extra work to traverse list in reverse order (see
previous patch), but other than that the conversion is trivial.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <20180819091335.22863-12-cota@braap.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cpus-common.c
cpus.c
include/qom/cpu.h
linux-user/main.c
linux-user/syscall.c
target/s390x/cpu_models.c