aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2023-03-03 14:37:51 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2023-06-06 09:42:14 +0200
commit06831001ac8949b0801e0d20c347d97339769a20 (patch)
tree01c418078a78ff8049bf5eb7bc36cf3e3bddcb14 /softmmu
parent09a49afeae2542993d4cdc5d7af22abdfce7a3ba (diff)
downloadqemu-06831001ac8949b0801e0d20c347d97339769a20.zip
qemu-06831001ac8949b0801e0d20c347d97339769a20.tar.gz
qemu-06831001ac8949b0801e0d20c347d97339769a20.tar.bz2
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>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/cpus.c2
-rw-r--r--softmmu/physmem.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/softmmu/cpus.c b/softmmu/cpus.c
index 9cbc817..fed20ff 100644
--- a/softmmu/cpus.c
+++ b/softmmu/cpus.c
@@ -405,7 +405,7 @@ static void qemu_cpu_stop(CPUState *cpu, bool exit)
void qemu_wait_io_event_common(CPUState *cpu)
{
- qatomic_mb_set(&cpu->thread_kicked, false);
+ qatomic_set_mb(&cpu->thread_kicked, false);
if (cpu->stop) {
qemu_cpu_stop(cpu, false);
}
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 9d7e172..588d0d1 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -3132,7 +3132,7 @@ void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
bounce.buffer = NULL;
memory_region_unref(bounce.mr);
/* Clear in_use before reading map_client_list. */
- qatomic_mb_set(&bounce.in_use, false);
+ qatomic_set_mb(&bounce.in_use, false);
cpu_notify_map_clients();
}