From patchwork Mon May 11 10:35:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 22921 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4BAa2Ek021117 for ; Mon, 11 May 2009 10:36:02 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752097AbZEKKgA (ORCPT ); Mon, 11 May 2009 06:36:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751454AbZEKKf7 (ORCPT ); Mon, 11 May 2009 06:35:59 -0400 Received: from mx2.redhat.com ([66.187.237.31]:53774 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751181AbZEKKf5 (ORCPT ); Mon, 11 May 2009 06:35:57 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4BAZwjq019220 for ; Mon, 11 May 2009 06:35:58 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4BAZvx7030285; Mon, 11 May 2009 06:35:57 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4BAZump018170; Mon, 11 May 2009 06:35:56 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id EE2C718D41F; Mon, 11 May 2009 13:35:55 +0300 (IDT) From: Gleb Natapov To: avi@redhat.com Cc: kvm@vger.kernel.org, Gleb Natapov Subject: [PATCH 02/10] Do not allow interrupt injection from userspace if there is a pending event. Date: Mon, 11 May 2009 13:35:47 +0300 Message-Id: <1242038155-8759-2-git-send-email-gleb@redhat.com> In-Reply-To: <1242038155-8759-1-git-send-email-gleb@redhat.com> References: <1242038155-8759-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Gleb Natapov --- arch/x86/kvm/x86.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index c6d3ff3..fe447e7 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3093,8 +3093,9 @@ static void post_kvm_run_save(struct kvm_vcpu *vcpu, kvm_run->ready_for_interrupt_injection = 1; else kvm_run->ready_for_interrupt_injection = - (kvm_arch_interrupt_allowed(vcpu) && - !kvm_cpu_has_interrupt(vcpu)); + kvm_arch_interrupt_allowed(vcpu) && + !kvm_cpu_has_interrupt(vcpu) && + !kvm_event_needs_reinjection(vcpu); } static void vapic_enter(struct kvm_vcpu *vcpu)