Stefano Stabellini
2013-Feb-18 16:02 UTC
[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). Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> --- 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(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 40979e2..2506369 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -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) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 2d0b052..fd1ed79 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -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); diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h index 764f57e..aab9a05 100644 --- a/xen/include/asm-arm/gic.h +++ b/xen/include/asm-arm/gic.h @@ -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 -- 1.7.2.5