From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] If interrupt injection is not possible do not scan IRR. Date: Mon, 18 May 2009 12:00:40 +0300 Message-ID: <4A1123B8.10601@redhat.com> References: <1242636246-11547-2-git-send-email-gleb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:35100 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbZERJAl (ORCPT ); Mon, 18 May 2009 05:00:41 -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 n4I90gkx011230 for ; Mon, 18 May 2009 05:00:42 -0400 In-Reply-To: <1242636246-11547-2-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Gleb Natapov wrote: > @@ -3174,10 +3174,11 @@ static void inject_pending_irq(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) > vcpu->arch.nmi_injected = true; > kvm_x86_ops->set_nmi(vcpu); > } > - } else if (kvm_cpu_has_interrupt(vcpu)) { > - if (kvm_x86_ops->interrupt_allowed(vcpu)) { > - kvm_queue_interrupt(vcpu, kvm_cpu_get_interrupt(vcpu), > - false); > + } else if (kvm_x86_ops->interrupt_allowed(vcpu)) { > + int vec = kvm_cpu_get_interrupt(vcpu); > + if (vec != -1) { > + printk(KERN_ERR"inject %d rip=%x\n", vec, kvm_rip_read(vcpu)); > + kvm_queue_interrupt(vcpu, vec, false); > kvm_x86_ops->set_irq(vcpu); > } } > Not sure if this is a win. Usually interrupts are allowed, so we'll have to do both calculations. On vmx ->interrupt_allowed() reads the vmcs, which is slow. -- error compiling committee.c: too many arguments to function