From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v2] report IRQ injection status to userspace. Date: Mon, 02 Feb 2009 16:23:40 +0200 Message-ID: <498701EC.7040703@redhat.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx2.redhat.com ([66.187.237.31]:45501 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbZBBOXo (ORCPT ); Mon, 2 Feb 2009 09:23:44 -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 n12ENi0l010878 for ; Mon, 2 Feb 2009 09:23:44 -0500 In-Reply-To: <20090202140354.GA4674@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. -- error compiling committee.c: too many arguments to function