On Mon, Jun 6, 2022 at 12:29 PM Jag Raman <jag.ra...@oracle.com> wrote: > > > > > On Jun 6, 2022, at 2:32 PM, Alexander Duyck <alexander.du...@gmail.com> > > wrote: > > > > On Tue, May 24, 2022 at 9:11 AM Jagannathan Raman <jag.ra...@oracle.com> > > wrote: > >> > >> Forward remote device's interrupts to the guest > >> > >> Signed-off-by: Elena Ufimtseva <elena.ufimts...@oracle.com> > >> Signed-off-by: John G Johnson <john.g.john...@oracle.com> > >> Signed-off-by: Jagannathan Raman <jag.ra...@oracle.com> > >> --- > >> include/hw/pci/pci.h | 13 ++++ > >> include/hw/remote/vfio-user-obj.h | 6 ++ > >> hw/pci/msi.c | 16 ++-- > >> hw/pci/msix.c | 10 ++- > >> hw/pci/pci.c | 13 ++++ > >> hw/remote/machine.c | 14 +++- > >> hw/remote/vfio-user-obj.c | 123 ++++++++++++++++++++++++++++++ > >> stubs/vfio-user-obj.c | 6 ++ > >> MAINTAINERS | 1 + > >> hw/remote/trace-events | 1 + > >> stubs/meson.build | 1 + > >> 11 files changed, 193 insertions(+), 11 deletions(-) > >> create mode 100644 include/hw/remote/vfio-user-obj.h > >> create mode 100644 stubs/vfio-user-obj.c > >> > > > > So I had a question about a few bits below. Specifically I ran into > > issues when I had setup two devices to be assigned to the same VM via > > two vfio-user-pci/x-vfio-user-server interfaces. > > Thanks for the heads up, Alexander! > > > > > What I am hitting is an assert(irq_num < bus->nirq) in > > pci_bus_change_irq_level in the server. > > That is issue is because we are only initializing only one > IRQ for the PCI bus - but it should be more. We will update > it and when the bus initializes interrupts and get back to you. > > We only tested MSI/x devices for the multi-device config. We > should also test INTx - could you please confirm which device > you’re using so we could verify that it works before posting > the next revision. > > Thank you! > -- > Jag
I was testing an MSI-X capable NIC, so you can reproduce with e1000e. During the device enumeration before the driver was even loaded it threw the error: qemu-system-x86_64: ../hw/pci/pci.c:276: pci_bus_change_irq_level: Assertion `irq_num < bus->nirq' failed. All it really takes is attaching to the second device, that is enough to trigger the error since the irq_num will be non-zero. If I recall, all the kernel is doing is unmasking the interrupt via the config space and it is triggering the error which then shuts down the server.