From: Gleb Natapov Subject: [PATCH 04/15] Use kvm_arch_interrupt_allowed() instead of checking interrupt_window_open directly Date: Mon, 13 Apr 2009 12:55:34 +0300 Message-ID: <1239616545-25199-5-git-send-email-gleb@redhat.com> References: <1239616545-25199-1-git-send-email-gleb@redhat.com> Cc: kvm@vger.kernel.org, joerg.roedel@amd.com, sheng@linux.intel.com, Gleb Natapov To: avi@redhat.com Return-path: Received: from mx2.redhat.com ([66.187.237.31]:57723 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754259AbZDMJzt (ORCPT ); Mon, 13 Apr 2009 05:55:49 -0400 In-Reply-To: <1239616545-25199-1-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: kvm_arch_interrupt_allowed() also checks IF so drop the check. Signed-off-by: Gleb Natapov --- arch/x86/kvm/x86.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index dfcf358..f6aaa15 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3061,8 +3061,7 @@ static int dm_request_for_irq_injection(struct kvm_vcpu *vcpu, { return (!irqchip_in_kernel(vcpu->kvm) && !kvm_cpu_has_interrupt(vcpu) && kvm_run->request_interrupt_window && - vcpu->arch.interrupt_window_open && - (kvm_x86_ops->get_rflags(vcpu) & X86_EFLAGS_IF)); + kvm_arch_interrupt_allowed(vcpu)); } static void post_kvm_run_save(struct kvm_vcpu *vcpu, @@ -3075,7 +3074,7 @@ static void post_kvm_run_save(struct kvm_vcpu *vcpu, kvm_run->ready_for_interrupt_injection = 1; else kvm_run->ready_for_interrupt_injection = - (vcpu->arch.interrupt_window_open && + (kvm_arch_interrupt_allowed(vcpu) && !kvm_cpu_has_interrupt(vcpu)); } -- 1.5.6.5