From 6e48e8f9e0f5b6b15c41f6f8a68c9bf330147d45 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 10 Feb 2015 10:25:44 -0700 Subject: memory: unregister AddressSpace MemoryListener within BQL address_space_destroy_dispatch is called from an RCU callback and hence outside the iothread mutex (BQL). However, after address_space_destroy no new accesses can hit the destroyed AddressSpace so it is not necessary to observe changes to the memory map. Move the memory_listener_unregister call earlier, to make it thread-safe again. Reported-by: Alex Williamson Fixes: 374f2981d1f10bc4307f250f24b2a7ddb9b14be0 Signed-off-by: Paolo Bonzini Signed-off-by: Alex Williamson --- include/exec/memory-internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 25c43c0..fb467ac 100644 --- a/include/exec/memory-internal.h +++ b/include/exec/memory-internal.h @@ -23,6 +23,7 @@ typedef struct AddressSpaceDispatch AddressSpaceDispatch; void address_space_init_dispatch(AddressSpace *as); +void address_space_unregister(AddressSpace *as); void address_space_destroy_dispatch(AddressSpace *as); extern const MemoryRegionOps unassigned_mem_ops; -- cgit v1.1