From: Gleb Natapov Subject: [PATCH 2/9] Do not allow interrupt injection from userspace if there is a pending event. Date: Tue, 5 May 2009 11:14:28 +0300 Message-ID: <1241511275-2261-2-git-send-email-gleb@redhat.com> References: <1241511275-2261-1-git-send-email-gleb@redhat.com> Cc: kvm@vger.kernel.org, Gleb Natapov To: avi@redhat.com Return-path: Received: from mx2.redhat.com ([66.187.237.31]:39535 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751245AbZEEIOi (ORCPT ); Tue, 5 May 2009 04:14:38 -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 n458EciC029565 for ; Tue, 5 May 2009 04:14:38 -0400 In-Reply-To: <1241511275-2261-1-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 2d7082c..12ab1cc 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3080,8 +3080,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) -- 1.6.2.1