qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3 19/21] kvm: Flush coalesced mmio buffer on IO win


From: Jan Kiszka
Subject: [Qemu-devel] [PATCH v3 19/21] kvm: Flush coalesced mmio buffer on IO window exits
Date: Tue, 4 Jan 2011 09:32:31 +0100

From: Jan Kiszka <address@hidden>

We must flush pending mmio writes if we leave kvm_cpu_exec for an IO
window. Otherwise we risk to loose those requests when migrating to a
different host during that window.

Signed-off-by: Jan Kiszka <address@hidden>
---
 kvm-all.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 7a5b299..a5e9246 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -851,6 +851,8 @@ void kvm_cpu_exec(CPUState *env)
         cpu_single_env = env;
         kvm_arch_post_run(env, run);
 
+        kvm_flush_coalesced_mmio_buffer();
+
         if (ret == -EINTR || ret == -EAGAIN) {
             cpu_exit(env);
             DPRINTF("io window exit\n");
@@ -863,8 +865,6 @@ void kvm_cpu_exec(CPUState *env)
             abort();
         }
 
-        kvm_flush_coalesced_mmio_buffer();
-
         ret = 0; /* exit loop */
         switch (run->exit_reason) {
         case KVM_EXIT_IO:
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]