From: Ben-Ami Yassour Subject: Re: [PATCH 2/4] KVM: pci device assignment Date: Mon, 28 Jul 2008 19:41:31 +0300 Message-ID: <1217263291.5110.10.camel@cluwyn.haifa.ibm.com> References: <1216728835-19721-1-git-send-email-benami@il.ibm.com> <1216728835-19721-2-git-send-email-benami@il.ibm.com> <1216728835-19721-3-git-send-email-benami@il.ibm.com> <200807281527.20609.sheng.yang@intel.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, avi@qumranet.com, amit.shah@qumranet.com, Muli Ben-Yehuda , weidong.han@intel.com, anthony@codemonkey.ws To: "Yang, Sheng" Return-path: Received: from mtagate8.uk.ibm.com ([195.212.29.141]:14383 "EHLO mtagate8.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751561AbYG1Qm3 (ORCPT ); Mon, 28 Jul 2008 12:42:29 -0400 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate8.uk.ibm.com (8.13.8/8.13.8) with ESMTP id m6SGfXBO628104 for ; Mon, 28 Jul 2008 16:41:33 GMT Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m6SGfXRF4272242 for ; Mon, 28 Jul 2008 17:41:33 +0100 Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m6SGfWFR013366 for ; Mon, 28 Jul 2008 17:41:33 +0100 In-Reply-To: <200807281527.20609.sheng.yang@intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 2008-07-28 at 15:27 +0800, Yang, Sheng wrote: > On Tuesday 22 July 2008 20:13:53 Ben-Ami Yassour wrote: > > > > -int kvm_pic_read_irq(struct kvm_pic *s) > > +int kvm_pic_read_irq(struct kvm *kvm) > > { > > int irq, irq2, intno; > > + struct kvm_pic *s = pic_irqchip(kvm); > > > > irq = pic_get_irq(&s->pics[0]); > > if (irq >= 0) { > > @@ -186,6 +187,8 @@ int kvm_pic_read_irq(struct kvm_pic *s) > > irq = 7; > > intno = s->pics[0].irq_base + irq; > > } > > + kvm_notify_acked_irq(kvm, irq); > > + > > pic_update_irq(s); > > > > return intno; > > One coding style suggestion, > > struct kvm_pic has *irq_request_opaque which is struct kvm indeed. How > about contain kvm in kvm_pic explicitly? (seems cleaner, though needs > more modification). Your suggestion is applied in the next set of patches that I sent. > > > Another thing is about host share IRQ: Do we want follow the straight > forward way to add it? That's it, return IRQ_HANDLED from irq handler > and wait for EOI of guest? That's what the code in the current patches doing now. It also disables the irq until the EOI of the guest. If we don't do that, then the interrupt handler keeps getting called (which causes many guest exit) until the guest finally interacts with the device to release the interrupt line. Thanks, Ben