diff options
Diffstat (limited to 'softmmu')
-rw-r--r-- | softmmu/physmem.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 085b3ca..fb412a5 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -2933,6 +2933,8 @@ void cpu_register_map_client(QEMUBH *bh) qemu_mutex_lock(&map_client_list_lock); client->bh = bh; QLIST_INSERT_HEAD(&map_client_list, client, link); + /* Write map_client_list before reading in_use. */ + smp_mb(); if (!qatomic_read(&bounce.in_use)) { cpu_notify_map_clients_locked(); } @@ -3122,6 +3124,7 @@ void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len, qemu_vfree(bounce.buffer); bounce.buffer = NULL; memory_region_unref(bounce.mr); + /* Clear in_use before reading map_client_list. */ qatomic_mb_set(&bounce.in_use, false); cpu_notify_map_clients(); } |