OSDN Git Service

atomics: eliminate mb_read/mb_set
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 3 Mar 2023 13:37:51 +0000 (14:37 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 6 Jun 2023 07:42:14 +0000 (09:42 +0200)
commit06831001ac8949b0801e0d20c347d97339769a20
tree01c418078a78ff8049bf5eb7bc36cf3e3bddcb14
parent09a49afeae2542993d4cdc5d7af22abdfce7a3ba
atomics: eliminate mb_read/mb_set

qatomic_mb_read and qatomic_mb_set were the very first atomic primitives
introduced for QEMU; their semantics are unclear and they provide a false
sense of safety.

The last use of qatomic_mb_read() has been removed, so delete it.
qatomic_mb_set() instead can survive as an optimized
qatomic_set()+smp_mb(), similar to Linux's smp_store_mb(), but
rename it to qatomic_set_mb() to match the order of the two
operations.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
accel/tcg/cpu-exec.c
accel/tcg/tcg-accel-ops-mttcg.c
accel/tcg/tcg-accel-ops-rr.c
docs/devel/atomics.rst
include/qemu/atomic.h
monitor/qmp.c
softmmu/cpus.c
softmmu/physmem.c
target/arm/hvf/hvf.c
tests/unit/test-aio-multithread.c
util/qemu-coroutine-lock.c