From patchwork Thu Jan 6 17:56:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 77753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D8B3DB7088 for ; Fri, 7 Jan 2011 05:07:26 +1100 (EST) Received: from localhost ([127.0.0.1]:53695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PauF9-0005kc-8Q for incoming@patchwork.ozlabs.org; Thu, 06 Jan 2011 13:07:23 -0500 Received: from [140.186.70.92] (port=32855 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PauBE-0003ud-Ug for qemu-devel@nongnu.org; Thu, 06 Jan 2011 13:03:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PauBA-0006av-P2 for qemu-devel@nongnu.org; Thu, 06 Jan 2011 13:03:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PauBA-0006aJ-Df for qemu-devel@nongnu.org; Thu, 06 Jan 2011 13:03:16 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p06I3FQ2021180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Jan 2011 13:03:15 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p06I3FF2019672; Thu, 6 Jan 2011 13:03:15 -0500 Received: from amt.cnet (vpn1-4-164.ams2.redhat.com [10.36.4.164]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p06I3DJO019118; Thu, 6 Jan 2011 13:03:14 -0500 Received: from amt.cnet (localhost.localdomain [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 72EB768A277; Thu, 6 Jan 2011 15:59:42 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p06Hxc0x011409; Thu, 6 Jan 2011 15:59:38 -0200 From: Marcelo Tosatti To: Anthony Liguori Date: Thu, 6 Jan 2011 15:56:38 -0200 Message-Id: <0f049079ea2cd55544d3255da4a9c26a70432e14.1294336601.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 32/35] kvm: Flush coalesced mmio buffer on IO window exits X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka 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 Signed-off-by: Marcelo Tosatti --- 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: