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

[Xen-changelog] Add IO-APIC interrupt debugging to 'i' debug key.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID c2e93601eae576e2f3c7e332c41e6f37cb635b78
# Parent  572abc9efcf5dfcebc4ce3333dbe1ea245e1dd34
Add IO-APIC interrupt debugging to 'i' debug key.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 572abc9efcf5 -r c2e93601eae5 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Wed Jan  4 13:45:52 2006
+++ b/xen/arch/x86/io_apic.c    Wed Jan  4 17:37:24 2006
@@ -1807,3 +1807,47 @@
 
     return 0;
 }
+
+void dump_ioapic_irq_info(void)
+{
+    struct irq_pin_list *entry;
+    struct IO_APIC_route_entry rte;
+    unsigned int irq, pin, printed = 0;
+    unsigned long flags;
+
+    for ( irq = 0; irq < NR_IRQS; irq++ )
+    {
+        entry = &irq_2_pin[irq];
+        if ( entry->pin == -1 )
+            continue;
+
+        if ( !printed++ )
+            printk("IO-APIC interrupt information:\n");
+
+        printk("    IRQ%3d Vec%3d:\n", irq, irq_to_vector(irq));
+
+        for ( ; ; )
+        {
+            pin = entry->pin;
+
+            printk("      Apic 0x%02x, Pin %2d: ", entry->apic, pin);
+
+            spin_lock_irqsave(&ioapic_lock, flags);
+            *(((int *)&rte) + 0) = io_apic_read(entry->apic, 0x10 + 2 * pin);
+            *(((int *)&rte) + 1) = io_apic_read(entry->apic, 0x11 + 2 * pin);
+            spin_unlock_irqrestore(&ioapic_lock, flags);
+
+            printk("vector=%u, delivery_mode=%u, dest_mode=%s, "
+                   "delivery_status=%d, polarity=%d, irr=%d, "
+                   "trigger=%s, mask=%d\n",
+                   rte.vector, rte.delivery_mode,
+                   rte.dest_mode ? "logical" : "physical",
+                   rte.delivery_status, rte.polarity, rte.irr,
+                   rte.trigger ? "level" : "edge", rte.mask);
+
+            if ( entry->next == 0 )
+                break;
+            entry = &irq_2_pin[entry->next];
+        }
+    }
+}
diff -r 572abc9efcf5 -r c2e93601eae5 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Wed Jan  4 13:45:52 2006
+++ b/xen/arch/x86/irq.c        Wed Jan  4 17:37:24 2006
@@ -313,6 +313,8 @@
     return 0;
 }
 
+extern void dump_ioapic_irq_info(void);
+
 static void dump_irqs(unsigned char key)
 {
     int i, irq, vector;
@@ -321,6 +323,8 @@
     struct domain *d;
     unsigned long flags;
 
+    printk("Guest interrupt information:\n");
+
     for ( irq = 0; irq < NR_IRQS; irq++ )
     {
         vector = irq_to_vector(irq);
@@ -335,7 +339,7 @@
         {
             action = (irq_guest_action_t *)desc->action;
 
-            printk("IRQ%3d Vec%3d: type=%-15s status=%08x "
+            printk("    IRQ%3d Vec%3d: type=%-15s status=%08x "
                    "in-flight=%d domain-list=",
                    irq, vector, desc->handler->typename,
                    desc->status, action->in_flight);
@@ -366,6 +370,8 @@
 
         spin_unlock_irqrestore(&desc->lock, flags);
     }
+
+    dump_ioapic_irq_info();
 }
 
 static int __init setup_dump_irqs(void)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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