* [Qemu-devel] [PATCH] memory: call begin, log_start and commit when registering a new listener
@ 2015-11-02 8:24 Paolo Bonzini
2015-11-02 12:30 ` Peter Maydell
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2015-11-02 8:24 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, pkern
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.
Reported-by: Philipp Kern <pkern@debian.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Fixes: 0a1c71cec63e95f9b8d0dc96d049d2daa00c5210
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
memory.c | 9 +++++++++
1 file changed, 9 insertions(+)
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);
}
--
2.5.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] memory: call begin, log_start and commit when registering a new listener
2015-11-02 8:24 [Qemu-devel] [PATCH] memory: call begin, log_start and commit when registering a new listener Paolo Bonzini
@ 2015-11-02 12:30 ` Peter Maydell
0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2015-11-02 12:30 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Developers, pkern
On 2 November 2015 at 08:24, Paolo Bonzini <pbonzini@redhat.com> wrote:
> 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.
>
> Reported-by: Philipp Kern <pkern@debian.org>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Fixes: 0a1c71cec63e95f9b8d0dc96d049d2daa00c5210
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
This is how I expected the memory listener API to work when I wrote
the exec.c change, anyway :-)
thanks
-- PMM
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-02 12:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-02 8:24 [Qemu-devel] [PATCH] memory: call begin, log_start and commit when registering a new listener Paolo Bonzini
2015-11-02 12:30 ` Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).