aboutsummaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
authorSheng Yang <sheng@linux.intel.com>2010-01-26 19:21:16 +0800
committerMarcelo Tosatti <mtosatti@redhat.com>2010-02-03 19:47:33 -0200
commit62a2744ca09a0b44b8406ea0c430c4c67a2c3231 (patch)
treecbad6cf204007c5a239a7a9c2781d3b94b711f2b /vl.c
parent117f8eb81dfdf51a0418fbf6d260cbb72bcd4a9d (diff)
kvm: Flush coalesced MMIO buffer periodly
The default action of coalesced MMIO is, cache the writing in buffer, until: 1. The buffer is full. 2. Or the exit to QEmu due to other reasons. But this would result in a very late writing in some condition. 1. The each time write to MMIO content is small. 2. The writing interval is big. 3. No need for input or accessing other devices frequently. This issue was observed in a experimental embbed system. The test image simply print "test" every 1 seconds. The output in QEmu meets expectation, but the output in KVM is delayed for seconds. Per Avi's suggestion, I hooked flushing coalesced MMIO buffer in VGA update handler. By this way, We don't need vcpu explicit exit to QEmu to handle this issue. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vl.c b/vl.c
index 39833fc3b..50f133d49 100644
--- a/vl.c
+++ b/vl.c
@@ -2996,6 +2996,7 @@ static void gui_update(void *opaque)
DisplayState *ds = opaque;
DisplayChangeListener *dcl = ds->listeners;
+ qemu_flush_coalesced_mmio_buffer();
dpy_refresh(ds);
while (dcl != NULL) {
@@ -3011,6 +3012,7 @@ static void nographic_update(void *opaque)
{
uint64_t interval = GUI_REFRESH_INTERVAL;
+ qemu_flush_coalesced_mmio_buffer();
qemu_mod_timer(nographic_timer, interval + qemu_get_clock(rt_clock));
}