memory: call begin, log_start and commit when registering a new listener
commit680a4783dc13f1059c03d11da58193d76c19ead6
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Nov 2015 08:23:52 +0000 (2 09:23 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 4 Nov 2015 14:56:01 +0000 (4 15:56 +0100)
treeddbfec60589bed926980497687d80063c5d562e5
parent69fbd0ea25d1f45ab2c8b0d3f431e83063f977f2
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.

Reported-by: Philipp Kern <pkern@debian.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: 0a1c71cec63e95f9b8d0dc96d049d2daa00c5210
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c
memory.c