I can't recall a real device that worked with MSI but not with msi-x, so I'm ok with chucking it in.
On Tue, 18 Apr 2023, 21:15 Patrick Wildt, <patr...@blueri.se> wrote: > Hi, > > I noticed that on Qemu with arm64 we're falling back to legacy > interrupts with xhci(4) on PCI. Turns out that the virtual xHCI > does not support MSI, but it does support MSI-X. By having xhci(4) > map MSI-X as well I can use that on Qemu. > > My x395, which so far used MSI, is still working fine with this: > > -xhci0 at pci6 dev 0 function 3 "AMD 17h/1xh xHCI" rev 0x00: msi, xHCI 1.10 > +xhci0 at pci6 dev 0 function 3 "AMD 17h/1xh xHCI" rev 0x00: msix, xHCI > 1.10 > -xhci1 at pci6 dev 0 function 4 "AMD 17h/1xh xHCI" rev 0x00: msi, xHCI 1.10 > +xhci1 at pci6 dev 0 function 4 "AMD 17h/1xh xHCI" rev 0x00: msix, xHCI > 1.10 > > ok? > > Patrick > > diff --git a/sys/dev/pci/xhci_pci.c b/sys/dev/pci/xhci_pci.c > index 88bdf66dbd74..52d0bc1b6761 100644 > --- a/sys/dev/pci/xhci_pci.c > +++ b/sys/dev/pci/xhci_pci.c > @@ -158,7 +158,8 @@ xhci_pci_attach(struct device *parent, struct device > *self, void *aux) > } > > /* Map and establish the interrupt. */ > - if (pci_intr_map_msi(pa, &ih) != 0 && pci_intr_map(pa, &ih) != 0) { > + if (pci_intr_map_msix(pa, 0, &ih) != 0 && > + pci_intr_map_msi(pa, &ih) != 0 && pci_intr_map(pa, &ih) != 0) { > printf(": couldn't map interrupt\n"); > goto unmap_ret; > } > >