From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v2] report IRQ injection status to userspace. Date: Wed, 28 Jan 2009 17:09:26 -0200 Message-ID: <20090128190926.GA4669@amt.cnet> References: <20090121113227.GH27675@redhat.com> <20090121123428.GI27675@redhat.com> <20090126161038.GB3894@amt.cnet> <20090127132739.GG15778@redhat.com> <20090127154107.GC5806@amt.cnet> <20090128163735.GI15778@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:41793 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751334AbZA1TKE (ORCPT ); Wed, 28 Jan 2009 14:10:04 -0500 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 n0SJA3lE021284 for ; Wed, 28 Jan 2009 14:10:03 -0500 Content-Disposition: inline In-Reply-To: <20090128163735.GI15778@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jan 28, 2009 at 06:37:36PM +0200, Gleb Natapov wrote: > On Tue, Jan 27, 2009 at 01:41:07PM -0200, Marcelo Tosatti wrote: > > On Tue, Jan 27, 2009 at 03:27:39PM +0200, Gleb Natapov wrote: > > > > -1 here ? > > > > > > > I think 1 is better here. For level=0 we always want to report that interrupt > > > was injected and for the case of edge triggered interrupt and level=1 > > > ioapic_service() will always be called. BTW it seems that expression > > > old_irr != ioapic->irr in: > > > if ((!entry.fields.trig_mode && old_irr != ioapic->irr) > > > || !entry.fields.remote_irr) > > > ret = ioapic_service(ioapic, irq); > > > Will always be true since for edge triggered interrupt irr is always > > > cleared by ioapic_service(). Am I right? > > > > Right, I was thinking about > > > > if (irq >= 0 && irq < IOAPIC_NUM_PINS) { > > > > Should return MASKED if irq is outside the acceptable range? > > > Is this ever can be false? Should we BUG() if irq is out of range? If qemu-kvm passes it ouf range IRQ yes. Its just a nitpicking, ignore it. > > That assumes guests won't mask the interrupt temporarily in the irqchip, > > hope that is OK (as Avi noted earlier guests use CPU to mask irqs > > temporarily, most of the time). > And if a guest masks interrupts it can't complain that some are lost. I > haven't seen Windows masking RTC irq. Makes sense.