[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/14] memory: call begin, log_start and commit when
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 09/14] memory: call begin, log_start and commit when registering a new listener |
Date: |
Wed, 4 Nov 2015 17:18:27 +0100 |
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 <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Fixes: 0a1c71cec63e95f9b8d0dc96d049d2daa00c5210
Signed-off-by: Paolo Bonzini <address@hidden>
---
exec.c | 2 +-
memory.c | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/exec.c b/exec.c
index 7431f2f..819ecc3 100644
--- a/exec.c
+++ b/exec.c
@@ -2694,8 +2694,8 @@ void cpu_register_map_client(QEMUBH *bh)
void cpu_exec_init_all(void)
{
qemu_mutex_init(&ram_list.mutex);
- memory_map_init();
io_mem_init();
+ memory_map_init();
qemu_mutex_init(&map_client_list_lock);
}
diff --git a/memory.c b/memory.c
index 2eb1597..c435c88 100644
--- a/memory.c
+++ b/memory.c
@@ -2036,6 +2036,9 @@ static void listener_add_address_space(MemoryListener
*listener,
return;
}
+ if (listener->begin) {
+ listener->begin(listener);
+ }
if (global_dirty_log) {
if (listener->log_global_start) {
listener->log_global_start(listener);
@@ -2052,10 +2055,16 @@ static void listener_add_address_space(MemoryListener
*listener,
.offset_within_address_space = int128_get64(fr->addr.start),
.readonly = fr->readonly,
};
+ if (fr->dirty_log_mask && listener->log_start) {
+ listener->log_start(listener, §ion, 0, fr->dirty_log_mask);
+ }
if (listener->region_add) {
listener->region_add(listener, §ion);
}
}
+ if (listener->commit) {
+ listener->commit(listener);
+ }
flatview_unref(view);
}
--
1.8.3.1
- [Qemu-devel] [PULL 00/14] Misc changes for QEMU 2.4-rc1, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 02/14] scripts/text2pod.pl: Escape left brace, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 05/14] qemu-log: remove -d ioport, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 01/14] file_ram_alloc: propagate error to caller instead of terminating QEMU, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 04/14] ioport: do not use CPU_LOG_IOPORT, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 03/14] target-i386: fix pcmpxstrx equal-ordered (strstr) mode, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 10/14] cpu-exec: Fix compiler warning (-Werror=clobbered), Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 06/14] pc: Set hw_version on all machine classes, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 09/14] memory: call begin, log_start and commit when registering a new listener,
Paolo Bonzini <=
- [Qemu-devel] [PULL 11/14] configure: disallow ccache during compile tests, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 14/14] configure: disable FORTIFY_SOURCE under clang, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 07/14] osdep: Rename qemu_{get, set}_version() to qemu_{, set_}hw_version(), Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 12/14] backends/hostmem-file: Allow to specify full pathname for backing file, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 13/14] iscsi: Translate scsi sense into error code, Paolo Bonzini, 2015/11/04
- [Qemu-devel] [PULL 08/14] megasas: Use qemu_hw_version() instead of QEMU_VERSION, Paolo Bonzini, 2015/11/04
- Re: [Qemu-devel] [PULL 00/14] Misc changes for QEMU 2.4-rc1, Peter Maydell, 2015/11/04