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, 11 Feb 2009 18:45:33 -0200 Message-ID: <20090211204533.GA14668@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> <4986FD87.2030404@redhat.com> <20090202140354.GA4674@redhat.com> <498701EC.7040703@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Gleb Natapov , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx2.redhat.com ([66.187.237.31]:43773 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756038AbZBKUqI (ORCPT ); Wed, 11 Feb 2009 15:46:08 -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 n1BKk6JQ005732 for ; Wed, 11 Feb 2009 15:46:06 -0500 Content-Disposition: inline In-Reply-To: <498701EC.7040703@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Feb 02, 2009 at 04:23:40PM +0200, Avi Kivity wrote: > Gleb Natapov wrote: >> On Mon, Feb 02, 2009 at 04:04:55PM +0200, Avi Kivity wrote: >> >>> Gleb Natapov wrote: >>> >>>>> 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? >>>> >>>> >>> Yes, the number ultimately comes from userspace. >>> >>> >> So may be -EINVAL should be returned to userspace? >> > > Mmm, not sure. An out-of-bounds number here could be caused by > userspace generating the wrong irq line number, or by the guest > misconfiguring interrupts. > > We should error out on userspace bugs, but not guest bugs. I don't see this applied yet ?