From patchwork Tue Apr 21 14:44:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 19200 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 n3LEjkJu032607 for ; Tue, 21 Apr 2009 14:45:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755106AbZDUOpf (ORCPT ); Tue, 21 Apr 2009 10:45:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755077AbZDUOpe (ORCPT ); Tue, 21 Apr 2009 10:45:34 -0400 Received: from mx2.redhat.com ([66.187.237.31]:40020 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754748AbZDUOpS (ORCPT ); Tue, 21 Apr 2009 10:45:18 -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 n3LEjHJb022966 for ; Tue, 21 Apr 2009 10:45:17 -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 n3LEjFW6010094; Tue, 21 Apr 2009 10:45:16 -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 n3LEjEMD029127; Tue, 21 Apr 2009 10:45:15 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 587) id 652B618D493; Tue, 21 Apr 2009 17:45:11 +0300 (IDT) From: Gleb Natapov To: avi@redhat.com Cc: kvm@vger.kernel.org, Gleb Natapov Subject: [PATCH v2 04/16] Use kvm_arch_interrupt_allowed() instead of checking interrupt_window_open directly Date: Tue, 21 Apr 2009 17:44:59 +0300 Message-Id: <1240325111-3725-5-git-send-email-gleb@redhat.com> In-Reply-To: <1240325111-3725-1-git-send-email-gleb@redhat.com> References: <1240325111-3725-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 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)); }