On Wed, Dec 25, 2019 at 01:34:26AM +0000, Renjun Wang wrote: > I have a virtual machine with ubuntu 16.4.03 on KVM platform. There > is a PCIe device(Xilinx PCIe IP) plugged in the host machine. > > On the ubuntu operation system, I am developing the pcie driver. When > I use pci_alloc_irq_vectors() function to allocate 32 msi vectors, but > return 1. > > The command `lspci -vvv` output shows > MSI: Enable+ Count=1/32 Maskable+ 64bit+ > > > there is a similar case https://stackoverflow.com/questions/49821599/multiple-msi-vectors-linux-pci-alloc-irq-vectors-return-one-while-the-devi. > But not working for KVM virtual machine. > > I do not known why the function pci_alloc_irq_vectors() returns one ? Are you setting the "PCI_IRQ_AFFINITY" flag in your alloc call like in your stackoverflow link? If so, how many CPUs does your virtual machine have?