From patchwork Tue May 4 02:15:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 96650 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o442GPF5004568 for ; Tue, 4 May 2010 02:16:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756684Ab0EDCQX (ORCPT ); Mon, 3 May 2010 22:16:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5256 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756678Ab0EDCQW (ORCPT ); Mon, 3 May 2010 22:16:22 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o442GKea015036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 May 2010 22:16:20 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o442GJ9u003593; Mon, 3 May 2010 22:16:19 -0400 Received: from amt.cnet (vpn-10-222.rdu.redhat.com [10.11.10.222]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o442GIbJ025918; Mon, 3 May 2010 22:16:18 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 141B6656076; Mon, 3 May 2010 23:15:57 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o442FtEx031275; Mon, 3 May 2010 23:15:55 -0300 Date: Mon, 3 May 2010 23:15:55 -0300 From: Marcelo Tosatti To: kvm Cc: Jan Kiszka Subject: qemu-kvm: event writeback can overwrite interrupts with -no-kvm-irqchip Message-ID: <20100504021555.GA31205@amt.cnet> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 04 May 2010 02:16:25 +0000 (UTC) diff --git a/qemu-kvm.c b/qemu-kvm.c index 91f0222..90ace20 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -885,11 +885,6 @@ int pre_kvm_run(kvm_context_t kvm, CPUState *env) { kvm_arch_pre_run(env, env->kvm_run); - if (env->kvm_vcpu_dirty) { - kvm_arch_load_regs(env, KVM_PUT_RUNTIME_STATE); - env->kvm_vcpu_dirty = 0; - } - pthread_mutex_unlock(&qemu_mutex); return 0; } @@ -907,6 +902,10 @@ int kvm_run(CPUState *env) int fd = env->kvm_fd; again: + if (env->kvm_vcpu_dirty) { + kvm_arch_load_regs(env, KVM_PUT_RUNTIME_STATE); + env->kvm_vcpu_dirty = 0; + } push_nmi(kvm); #if !defined(__s390__) if (!kvm->irqchip_in_kernel)