On 3/3/23 09:19, Paolo Bonzini wrote:
mutex->from_push and mutex->handoff in qemu-coroutine-lock implement
the familiar pattern:

    write a                                  write b
    smp_mb()                                 smp_mb()
    read b                                   read a

The memory barrier is required by the C memory model even after a
SEQ_CST read-modify-write operation such as QSLIST_INSERT_HEAD_ATOMIC.
Add it and avoid the unclear qatomic_mb_read() operation.

Signed-off-by: Paolo Bonzini<pbonz...@redhat.com>
---
  util/qemu-coroutine-lock.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to