From ad7663551b855a50f953f69bc3381453990783d1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 17 Feb 2018 15:01:05 -0500 Subject: [PATCH] memory: call begin, log_start and commit when registering a new listener This ensures that cpu_reload_memory_map() is called as soon as tcg_cpu_address_space_init() is called, and before cpu->memory_dispatch is used. qemu-system-s390x never changes the address spaces after tcg_cpu_address_space_init() is called, and thus tcg_commit() is never called. This causes a SIGSEGV. Because memory_map_init() will now call mem_commit(), we have to initialize io_mem_* before address_space_memory and friends. Backports commit 680a4783dc13f1059c03d11da58193d76c19ead6 from qemu --- qemu/exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu/exec.c b/qemu/exec.c index dc0e0b6c..c090198a 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -1561,10 +1561,10 @@ static void memory_map_init(struct uc_struct *uc) void cpu_exec_init_all(struct uc_struct *uc) { + io_mem_init(uc); #if !defined(CONFIG_USER_ONLY) memory_map_init(uc); #endif - io_mem_init(uc); } MemoryRegion *get_system_memory(struct uc_struct *uc)