summaryrefslogtreecommitdiffstats
path: root/ui/console.c
diff options
context:
space:
mode:
authorAlex Bennée2017-03-22 17:11:13 +0100
committerAlex Bennée2017-03-28 11:52:24 +0200
commit85390939190e4b7eeba57765e344947c328cd166 (patch)
treeff95e20e02aefd04fb884ca32925caed89a05ff1 /ui/console.c
parentbsd-user: align use of mmap_lock to that of linux-user (diff)
downloadqemu-85390939190e4b7eeba57765e344947c328cd166.tar.gz
qemu-85390939190e4b7eeba57765e344947c328cd166.tar.xz
qemu-85390939190e4b7eeba57765e344947c328cd166.zip
ui/console: ensure do_safe_dpy_refresh holds BQL
I missed the fact that when an exclusive work item runs it drops the BQL to ensure all no vCPUs are stuck waiting for it, hence causing a deadlock. However the actual helper needs to take the BQL especially as we'll be messing with device emulation bits during the update which all assume BQL is held. We make a minor cpu_reloading_memory_map which must try and unlock the RCU if we are actually outside the running context. Reported-by: Laurent Desnogues <laurent.desnogues@gmail.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/console.c')
-rw-r--r--ui/console.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/console.c b/ui/console.c
index 937c950840..dd27c9501b 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1586,7 +1586,9 @@ bool dpy_gfx_check_format(QemuConsole *con,
static void do_safe_dpy_refresh(CPUState *cpu, run_on_cpu_data opaque)
{
DisplayChangeListener *dcl = opaque.host_ptr;
+ qemu_mutex_lock_iothread();
dcl->ops->dpy_refresh(dcl);
+ qemu_mutex_unlock_iothread();
}
static void dpy_refresh(DisplayState *s)