aboutsummaryrefslogtreecommitdiff
path: root/ui/console.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-03-20 10:05:45 +0000
committerPeter Maydell <peter.maydell@linaro.org>2017-03-20 10:05:45 +0000
commitbedf13ecab38bcd479e9db6994ebc3b2c5c7a3ae (patch)
tree02d87a9095c7752bc9059ec0d7d51f7a6b41f903 /ui/console.c
parentebedf0f9cd46b617df331eecc857c379d574ac62 (diff)
parent7bc4f0846f5e15dad5a54490290241243b5a4416 (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/pull-fixes-20170320-1' into staging
fixes for 2.9: vnc, cirrus, tcg display updates. # gpg: Signature made Mon 20 Mar 2017 08:52:34 GMT # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/pull-fixes-20170320-1: vnc: fix a qio-channel leak cirrus: fix off-by-one in cirrus_bitblt_rop_bkwd_transp_*_16 ui/console: ensure graphic updates don't race with TCG vCPUs Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/console.c')
-rw-r--r--ui/console.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/ui/console.c b/ui/console.c
index 4c70d8bfda..937c950840 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1575,13 +1575,32 @@ bool dpy_gfx_check_format(QemuConsole *con,
return true;
}
+/*
+ * Safe DPY refresh for TCG guests. This runs when the TCG vCPUs are
+ * quiescent so we can avoid races between dirty page tracking for
+ * direct frame-buffer access by the guest.
+ *
+ * This is a temporary stopgap until we've fixed the dirty tracking
+ * races in display adapters.
+ */
+static void do_safe_dpy_refresh(CPUState *cpu, run_on_cpu_data opaque)
+{
+ DisplayChangeListener *dcl = opaque.host_ptr;
+ dcl->ops->dpy_refresh(dcl);
+}
+
static void dpy_refresh(DisplayState *s)
{
DisplayChangeListener *dcl;
QLIST_FOREACH(dcl, &s->listeners, next) {
if (dcl->ops->dpy_refresh) {
- dcl->ops->dpy_refresh(dcl);
+ if (tcg_enabled()) {
+ async_safe_run_on_cpu(first_cpu, do_safe_dpy_refresh,
+ RUN_ON_CPU_HOST_PTR(dcl));
+ } else {
+ dcl->ops->dpy_refresh(dcl);
+ }
}
}
}