Re: In kernel PIC support: kernel patch

Avi Kivity
2007-07-03T14:52:06Z

Dong, Eddie wrote:
>>> +/* for KVM_SET_IRQ_LEVEL */
>>> +struct kvm_irq_level {
>>> + __u32 irq;
>>> + __u32 level;
>>> +};
>>>
>>>
>> Please add an irqchip index, so this can be used for
>> configurations with
>> multiple irqchips (likely ioapics). You'll also need to add
>> padding so
>> the structure is 64-bit aligned.
>>
>>
> Adding irqchip index is one way, another way is to just use gsi index
> (probably rename irq to gsi). I.e. In X86, gsi 0-15 is for both PIC and
> IOAPIC
> and gsi 16-23 is for IOAPIC0 only, gsi 24---xxx can be for ioapic 1,2,
> .. n.
>
> In IA64, gsi 0-xxx is just for IOAPIC 0,1, .. n.
>
> Since ACPI already defined gsi, so do we really want to use irqchip
> index?
> They are functionally equvalent but gsi is cross architecture neutral,
> while
> irqchip index is very X86 specific.
>
>

GSI is good enough. However, we want not to use the name gsi in the
code, since other archs will not hace it. Just add a comment indicating
that for x86 and ia64 the irqchip number is interpreted according to the
gsi conventions.