From fb4cf64dcced21b1f98b1e60fbb9dfa70f61fc3c Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Tue, 4 Feb 2014 17:01:42 -0500 Subject: [PATCH 3/6] DEBUG: Include upstream bridge information. Signed-off-by: Konrad Rzeszutek Wilk --- xen/drivers/passthrough/pci.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 1ad4f17..2a6eaa4 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -950,6 +950,9 @@ static int _dump_pci_devices(struct pci_seg *pseg, void *arg) { int id = pci_conf_read32(pseg->nr, pdev->bus, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), 0); + int rc = 0; + u8 bus, devfn, secbus; + printk("%04x:%02x:%02x.%u (%04x:%04x)- dom %-3d - MSIs < ", pseg->nr, pdev->bus, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), @@ -957,7 +960,14 @@ static int _dump_pci_devices(struct pci_seg *pseg, void *arg) pdev->domain ? pdev->domain->domain_id : -1); list_for_each_entry ( msi, &pdev->msi_list, list ) printk("%d ", msi->irq); - printk(">\n"); + bus = pdev->bus; + devfn = pdev->devfn; + + rc = find_upstream_bridge( pseg->nr, &bus, &devfn, &secbus ); + if ( rc < 0) + printk(">\n"); + else + printk(">[%02x:%02x.%u]\n", bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); } printk("==== Bus2Bridge %04x ====\n", pseg->nr); spin_lock(&pseg->bus2bridge_lock); -- 1.8.3.1