[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] About GSI and IRQ?



Thank  you very much.
Xen get mp_irqs[] from MADT,   the mp_irqs[]  struct is as below

struct mpc_config_intsrc
{
        unsigned char mpc_type;
        unsigned char mpc_irqtype;
        unsigned short mpc_irqflag;
        unsigned char mpc_srcbus;  #SOURCE BUS ID
        unsigned char mpc_srcbusirq;   # SOURCE BUS IRQ
        unsigned char mpc_dstapic;
        unsigned char mpc_dstirq;    #destination IOAPIC INTN
};

 
Can I get the conclusion as blow:
   the mp_irqs[]  acts as a map between IRQ and IOAPIC PIN, and we can get  GSI 
from mpc_config_intsrc.mpc_dstirq  (GSI=GSI base + pin). 
   For PCI IRQs, the IRQ equal to the GSI.
   But for ISA IRQs, the two maybe not match, because of the ISO(interrupt 
source overrides).
   And the map between IRQ and GSI  is decided by hardware, not by xen.Because 
the map info was get from MADT.

ps :  another question, can I rename "apic_pin_2_gsi_irq"  with  
"apic_pin_2_gsi" for they are the same semantics.


在2014-03-21 19:07:33,hanyandong<hanyandong@xxxxxxxxx>写道:
> >>> On 21.03.14 at 11:28, hanyandong <hanyandong@xxxxxxxxx> wrote:
> > static int apic_pin_2_gsi_irq(int apic, int pin)
> > {
> >     int idx;
> > 
> >     if (apic < 0)
> >        return -EINVAL;
> > 
> >     idx = find_irq_entry(apic, pin, mp_INT);
> > 
> >     return idx >= 0 ? pin_2_irq(idx, apic, pin)
> >                     : apic_gsi_base(apic) + pin;
> > }
> > 
> > what make me most confued is the function name of "apic_pin_2_gsi_irq", is 
> > the returned value  a GSI or a IRQ?
> > when to use GSI? when to use IRQ?
> 
> With you having quoted the function above already, I don't think
> there's much to say here: If it can (valid index into mp_irqs[]), it
> returns an IRQ, else it returns a GSI. For PCI IRQs the two would
> always match (i.e. the distinction is only relevant for the other
> MP_BUS_* types).
> 
> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel






_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.