summaryrefslogtreecommitdiff
path: root/exec.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
commit2e8bb7b24b53154c553fa27f85b8e74559abd748 (patch)
treecbad6cf204007c5a239a7a9c2781d3b94b711f2b /exec.c
parent08183b0aed21c60f41d65db0271a32f4e4450586 (diff)
downloadqemu-2e8bb7b24b53154c553fa27f85b8e74559abd748.tar.gz
qemu-2e8bb7b24b53154c553fa27f85b8e74559abd748.tar.bz2
qemu-2e8bb7b24b53154c553fa27f85b8e74559abd748.zip
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 'exec.c')
-rw-r--r--exec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 76831a194f..67fabaef04 100644
--- a/exec.c
+++ b/exec.c
@@ -2406,6 +2406,12 @@ void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size)
kvm_uncoalesce_mmio_region(addr, size);
}
+void qemu_flush_coalesced_mmio_buffer(void)
+{
+ if (kvm_enabled())
+ kvm_flush_coalesced_mmio_buffer();
+}
+
ram_addr_t qemu_ram_alloc(ram_addr_t size)
{
RAMBlock *new_block;