Re: [PATCH v2] report IRQ injection status to userspace.

Marcelo Tosatti
2009-02-11T20:46:08Z

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 ?