ui/console: ensure graphic updates don't race with TCG vCPUs
commit8bb93c6f99a42c2e0943bc904b283cd622d302c5
authorAlex Bennée <alex.bennee@linaro.org>
Wed, 15 Mar 2017 14:48:25 +0000 (15 14:48 +0000)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 17 Mar 2017 09:17:21 +0000 (17 10:17 +0100)
treed362ea24ea051fe4264f72180fcd18ebc8c2d567
parent272d7dee5951f926fad1911f2f072e5915cdcba0
ui/console: ensure graphic updates don't race with TCG vCPUs

Commit 8d04fb55..

  tcg: drop global lock during TCG code execution

..broke the assumption that updates to the GUI couldn't happen at the
same time as TCG vCPUs where running. As a result the TCG vCPU could
still be updating a directly mapped frame-buffer while the display
side was updating. This would cause artefacts to appear when the
update code assumed that memory block hadn't changed.

The simplest solution is to ensure the two things can't happen at the
same time like the old BQL locking scheme. Here we use the solution
introduced for MTTCG and schedule the update as async_safe_work when
we know no vCPUs can be running.

Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20170315144825.3108-1-alex.bennee@linaro.org
Cc: BALATON Zoltan <balaton@eik.bme.hu>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
[ kraxel: updated comment clarifying the display adapters are buggy
          and this is a temporary workaround ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/console.c