ui/console: ensure do_safe_dpy_refresh holds BQL
commit85390939190e4b7eeba57765e344947c328cd166
authorAlex Bennée <alex.bennee@linaro.org>
Wed, 22 Mar 2017 16:11:13 +0000 (22 16:11 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Tue, 28 Mar 2017 09:52:24 +0000 (28 10:52 +0100)
treeff95e20e02aefd04fb884ca32925caed89a05ff1
parent95992b674c43339d0b313dd79fa8cc45ba22eab8
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>
cpu-exec-common.c
ui/console.c