--- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -278,7 +278,7 @@ static struct pci_dev *alloc_pdev(struct INIT_LIST_HEAD(&pdev->msi_list); if ( pci_find_cap_offset(pseg->nr, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), - PCI_CAP_ID_MSIX) ) + PCI_CAP_ID_MSIX | 0x80) ) { struct arch_msix *msix = xzalloc(struct arch_msix); --- a/xen/drivers/pci/pci.c +++ b/xen/drivers/pci/pci.c @@ -14,19 +14,24 @@ int pci_find_cap_offset(u16 seg, u8 bus, int max_cap = 48; u8 pos = PCI_CAPABILITY_LIST; u16 status; +bool_t log = (cap & 0x80) && !seg && bus == 2;//temp +cap &= ~0x80;//temp status = pci_conf_read16(seg, bus, dev, func, PCI_STATUS); +if(log) printk("02:%02x.%u: status=%04x (%ps wants %02x)\n", dev, func, status, __builtin_return_address(0), cap);//temp if ( (status & PCI_STATUS_CAP_LIST) == 0 ) return 0; while ( max_cap-- ) { pos = pci_conf_read8(seg, bus, dev, func, pos); +if(log) printk("02:%02x.%u: pos=%02x\n", dev, func, pos);//temp if ( pos < 0x40 ) break; pos &= ~3; id = pci_conf_read8(seg, bus, dev, func, pos + PCI_CAP_LIST_ID); +if(log) printk("02:%02x.%u: id=%02x\n", dev, func, id);//temp if ( id == 0xff ) break; @@ -35,6 +40,7 @@ int pci_find_cap_offset(u16 seg, u8 bus, pos += PCI_CAP_LIST_NEXT; } +if(log) printk("02:%02x.%u: no cap %02x\n", dev, func, cap);//temp return 0; }