Skip to contentSkip to conversation

xen/arm: dump gic debug info from arch_dump_domain_info

PATCH Superseded Stefano Stabellini 1 participant 1 message Feb 18, 2013

v2 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 3/4 xen/arm: dump gic debug info from arch_dump_domain_info

Print some useful GIC debug information when arch_dump_domain_info is called ('q' debug key).

---
 xen/arch/arm/domain.c     |    6 ++++++
 xen/arch/arm/gic.c        |   27 +++++++++++++++++++++++++++
 xen/include/asm-arm/gic.h |    3 +++
 3 files changed, 36 insertions(+), 0 deletions(-)
xen/arch/arm/domain.c +6 -0
index 40979e2..2506369 100644
@@ -567,6 +567,12 @@ int domain_relinquish_resources(struct domain *d)
 
 void arch_dump_domain_info(struct domain *d)
 {
+	struct vcpu *v;
+
+	for_each_vcpu ( d, v )
+	{
+		gic_dump_info(v);
+	}
 }
 
 long arch_do_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
xen/arch/arm/gic.c +27 -0
index 2d0b052..fd1ed79 100644
@@ -678,6 +678,33 @@ static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *r
     }
 }
 
+void gic_dump_info(struct vcpu *v)
+{
+    int i;
+    struct pending_irq *p;
+
+    printk("GICH_LRs (vcpu %d) mask=%llx\n", v->vcpu_id, v->arch.lr_mask);
+    if ( v == current )
+    {
+        for ( i = 0; i < nr_lrs; i++ )
+            printk("   HW_LR[%d]=%x\n", i, GICH[GICH_LR + i]);
+    } else {
+        for ( i = 0; i < nr_lrs; i++ )
+            printk("   VCPU_LR[%d]=%x\n", i, v->arch.gic_lr[i]);
+    }
+
+    list_for_each_entry ( p, &v->arch.vgic.inflight_irqs, inflight )
+    {
+        printk("Inflight irq=%d\n", p->irq);
+    }
+
+    list_for_each_entry( p, &v->arch.vgic.lr_pending, lr_queue )
+    {
+        printk("Pending irq=%d\n", p->irq);
+    }
+
+}
+ 
 void __cpuinit init_maintenance_interrupt(void)
 {
     request_irq(25, maintenance_interrupt, 0, "irq-maintenance", NULL);
xen/include/asm-arm/gic.h +3 -0
index 764f57e..aab9a05 100644
@@ -163,6 +163,9 @@ int register_eoi_callback(struct vcpu *v, int irq, irq_callback_fn_t fn);
 extern void gic_save_state(struct vcpu *v);
 extern void gic_restore_state(struct vcpu *v);
 
+/* print useful debug info */
+extern void gic_dump_info(struct vcpu *v);
+
 #endif /* __ASSEMBLY__ */
 #endif
 
Signature · 1 line
1.7.2.5