ia64/xen-unstable

changeset 8503:c2e93601eae5

Add IO-APIC interrupt debugging to 'i' debug key.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Jan 04 18:37:24 2006 +0100 (2006-01-04)
parents 572abc9efcf5
children ecc20905cde3
files xen/arch/x86/io_apic.c xen/arch/x86/irq.c
line diff
     1.1 --- a/xen/arch/x86/io_apic.c	Wed Jan 04 14:45:52 2006 +0100
     1.2 +++ b/xen/arch/x86/io_apic.c	Wed Jan 04 18:37:24 2006 +0100
     1.3 @@ -1807,3 +1807,47 @@ int ioapic_guest_write(int apicid, int a
     1.4  
     1.5      return 0;
     1.6  }
     1.7 +
     1.8 +void dump_ioapic_irq_info(void)
     1.9 +{
    1.10 +    struct irq_pin_list *entry;
    1.11 +    struct IO_APIC_route_entry rte;
    1.12 +    unsigned int irq, pin, printed = 0;
    1.13 +    unsigned long flags;
    1.14 +
    1.15 +    for ( irq = 0; irq < NR_IRQS; irq++ )
    1.16 +    {
    1.17 +        entry = &irq_2_pin[irq];
    1.18 +        if ( entry->pin == -1 )
    1.19 +            continue;
    1.20 +
    1.21 +        if ( !printed++ )
    1.22 +            printk("IO-APIC interrupt information:\n");
    1.23 +
    1.24 +        printk("    IRQ%3d Vec%3d:\n", irq, irq_to_vector(irq));
    1.25 +
    1.26 +        for ( ; ; )
    1.27 +        {
    1.28 +            pin = entry->pin;
    1.29 +
    1.30 +            printk("      Apic 0x%02x, Pin %2d: ", entry->apic, pin);
    1.31 +
    1.32 +            spin_lock_irqsave(&ioapic_lock, flags);
    1.33 +            *(((int *)&rte) + 0) = io_apic_read(entry->apic, 0x10 + 2 * pin);
    1.34 +            *(((int *)&rte) + 1) = io_apic_read(entry->apic, 0x11 + 2 * pin);
    1.35 +            spin_unlock_irqrestore(&ioapic_lock, flags);
    1.36 +
    1.37 +            printk("vector=%u, delivery_mode=%u, dest_mode=%s, "
    1.38 +                   "delivery_status=%d, polarity=%d, irr=%d, "
    1.39 +                   "trigger=%s, mask=%d\n",
    1.40 +                   rte.vector, rte.delivery_mode,
    1.41 +                   rte.dest_mode ? "logical" : "physical",
    1.42 +                   rte.delivery_status, rte.polarity, rte.irr,
    1.43 +                   rte.trigger ? "level" : "edge", rte.mask);
    1.44 +
    1.45 +            if ( entry->next == 0 )
    1.46 +                break;
    1.47 +            entry = &irq_2_pin[entry->next];
    1.48 +        }
    1.49 +    }
    1.50 +}
     2.1 --- a/xen/arch/x86/irq.c	Wed Jan 04 14:45:52 2006 +0100
     2.2 +++ b/xen/arch/x86/irq.c	Wed Jan 04 18:37:24 2006 +0100
     2.3 @@ -313,6 +313,8 @@ int pirq_guest_unbind(struct domain *d, 
     2.4      return 0;
     2.5  }
     2.6  
     2.7 +extern void dump_ioapic_irq_info(void);
     2.8 +
     2.9  static void dump_irqs(unsigned char key)
    2.10  {
    2.11      int i, irq, vector;
    2.12 @@ -321,6 +323,8 @@ static void dump_irqs(unsigned char key)
    2.13      struct domain *d;
    2.14      unsigned long flags;
    2.15  
    2.16 +    printk("Guest interrupt information:\n");
    2.17 +
    2.18      for ( irq = 0; irq < NR_IRQS; irq++ )
    2.19      {
    2.20          vector = irq_to_vector(irq);
    2.21 @@ -335,7 +339,7 @@ static void dump_irqs(unsigned char key)
    2.22          {
    2.23              action = (irq_guest_action_t *)desc->action;
    2.24  
    2.25 -            printk("IRQ%3d Vec%3d: type=%-15s status=%08x "
    2.26 +            printk("    IRQ%3d Vec%3d: type=%-15s status=%08x "
    2.27                     "in-flight=%d domain-list=",
    2.28                     irq, vector, desc->handler->typename,
    2.29                     desc->status, action->in_flight);
    2.30 @@ -366,6 +370,8 @@ static void dump_irqs(unsigned char key)
    2.31  
    2.32          spin_unlock_irqrestore(&desc->lock, flags);
    2.33      }
    2.34 +
    2.35 +    dump_ioapic_irq_info();
    2.36  }
    2.37  
    2.38  static int __init setup_dump_irqs(void)