mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 09:43:56 -06:00
physmem: add missing memory barrier
Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: David Hildenbrand <david@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e3a3b6ec81
commit
33828ca11d
1 changed files with 3 additions and 0 deletions
|
@ -2927,6 +2927,8 @@ void cpu_register_map_client(QEMUBH *bh)
|
||||||
qemu_mutex_lock(&map_client_list_lock);
|
qemu_mutex_lock(&map_client_list_lock);
|
||||||
client->bh = bh;
|
client->bh = bh;
|
||||||
QLIST_INSERT_HEAD(&map_client_list, client, link);
|
QLIST_INSERT_HEAD(&map_client_list, client, link);
|
||||||
|
/* Write map_client_list before reading in_use. */
|
||||||
|
smp_mb();
|
||||||
if (!qatomic_read(&bounce.in_use)) {
|
if (!qatomic_read(&bounce.in_use)) {
|
||||||
cpu_notify_map_clients_locked();
|
cpu_notify_map_clients_locked();
|
||||||
}
|
}
|
||||||
|
@ -3116,6 +3118,7 @@ void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
|
||||||
qemu_vfree(bounce.buffer);
|
qemu_vfree(bounce.buffer);
|
||||||
bounce.buffer = NULL;
|
bounce.buffer = NULL;
|
||||||
memory_region_unref(bounce.mr);
|
memory_region_unref(bounce.mr);
|
||||||
|
/* Clear in_use before reading map_client_list. */
|
||||||
qatomic_mb_set(&bounce.in_use, false);
|
qatomic_mb_set(&bounce.in_use, false);
|
||||||
cpu_notify_map_clients();
|
cpu_notify_map_clients();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue