From 3163117e2ceb8dfcc11545dcc385aa3d147614e8 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 17 Nov 2014 17:32:43 -0500 Subject: [PATCH 3/5] DEBUG 2 --- xen/drivers/passthrough/io.c | 42 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 23e5ed1..b786bd2 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -126,17 +126,17 @@ static void dump_record(struct _debug_f *d, unsigned int type) BUG(); now = NOW(); - printk("d%d %s %lumsec ago, state:%x, %ld count, [prev:%p, next:%p] ", + printk("d%d %s %lumsec ago, state:%x, %ld count, [prev:%p, next:%p] %p", d->domid, names[type], (unsigned long)((now - d->last) / MILLISECS(1)), - d->state, d->count, d->list.prev, d->list.next); + d->state, d->count, d->list.prev, d->list.next, d->dpci); if ( d->dpci ) { struct hvm_pirq_dpci *pirq_dpci = d->dpci; for ( i = 0; i <= _HVM_IRQ_DPCI_GUEST_MSI_SHIFT; i++ ) - if ( pirq_dpci->flags & 1 << _HVM_IRQ_DPCI_TRANSLATE_SHIFT ) + if ( pirq_dpci->flags & (1 << i) ) printk("%s ", names_flag[i]); printk(" PIRQ:%d", pirq_dpci->pirq); @@ -545,9 +545,9 @@ int pt_irq_create_bind( if ( iommu_verbose ) dprintk(XENLOG_G_INFO, - "d%d: bind: m_gsi=%u g_gsi=%u dev=%02x.%02x.%u intx=%u\n", + "d%d: bind: m_gsi=%u g_gsi=%u dev=%02x.%02x.%u intx=%u %p\n", d->domain_id, pirq, guest_gsi, bus, - PCI_SLOT(device), PCI_FUNC(device), intx); + PCI_SLOT(device), PCI_FUNC(device), intx, pirq_dpci); break; } @@ -913,26 +913,52 @@ static void dpci_softirq(void) unsigned int reset = 0; LIST_HEAD(our_list); struct __debug *debug; - + struct hvm_pirq_dpci *pirq_dpci; + struct __x { + struct list_head l; + struct hvm_pirq_dpci *dpci; + } l[4]; + unsigned int i = 0; +#if DIFF_LIST + struct hvm_pirq_dpci *n; +#endif debug = &per_cpu(_d, cpu); local_irq_disable(); list_splice_init(&per_cpu(dpci_list, cpu), &our_list); local_irq_enable(); - +#if DIFF_LIST + list_for_each_entry_safe(pirq_dpci, n, &our_list, softirq_list) +#else while ( !list_empty(&our_list) ) +#endif { - struct hvm_pirq_dpci *pirq_dpci; struct domain *d; struct list_head *entry; +#ifndef DIFF_LIST pirq_dpci = list_entry(our_list.next, struct hvm_pirq_dpci, softirq_list); +#endif entry = &pirq_dpci->softirq_list; + if ( i <= 3 ) + { + struct __x *p; + + p = &l[i]; + p->dpci = pirq_dpci; + p->l.prev = entry->prev; + p->l.next = entry->next; + i++; + } if ( entry->next == LIST_POISON1 || entry->next == LIST_POISON2 || entry->prev == LIST_POISON2 || entry->prev == LIST_POISON2 ) { + unsigned int j; + _record(&debug->poison, pirq_dpci); console_start_sync(); + for (j=0; j < i;j++) + printk(" %u: %p [p:%p, n:%p]\n", j, l[j].dpci, l[j].l.prev, l[j].l.next); dump_debug((char)0); console_end_sync(); domain_crash(pirq_dpci->dom); -- 1.9.3