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
This commit is contained in:
Lioncash 2018-02-17 15:01:05 -05:00
parent c2c3a800ad
commit ad7663551b
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -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)