Skip to contentSkip to conversation

xen/arm: dump gic debug info from arch_dump_domain_info

PATCH Superseded Stefano Stabellini 2 participants 2 messages Feb 15, 2013 – Apr 10, 2013

v1 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 e37ec54..817e800 100644
@@ -568,6 +568,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 88f2d3a..9db1f57 100644
@@ -677,6 +677,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 == gic_running )
+    {
+        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 f4b0324..7c9499e 100644
@@ -162,6 +162,9 @@ void register_gic_callback(int irq, gic_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