[vfio-users] Cannot register eventfd with MSI/MSI-X interrupts

Alex Williamson alex.williamson at redhat.com
Sat Aug 6 00:19:01 UTC 2016


On Wed, 3 Aug 2016 12:47:21 +0000
chris thompson <the_cartographer at hotmail.com> wrote:

>  
> > Date: Tue, 2 Aug 2016 16:29:52 -0600
> > From: alex.williamson at redhat.com
> > To: the_cartographer at hotmail.com
> > CC: vfio-users at redhat.com
> > Subject: Re: [vfio-users] Cannot register eventfd with MSI/MSI-X interrupts
> > 
> > On Tue, 2 Aug 2016 09:54:19 -0600
> > Alex Williamson <alex.williamson at redhat.com> wrote:
> >   
> > > On Tue, 2 Aug 2016 10:21:30 +0000
> > > chris thompson <the_cartographer at hotmail.com> wrote:
> > >   
> > > > Hi Alex,
> > > >  
> > > > Thanks for your patience, I noticed the count != 0 issue shortly after, but I get the same EINVAL error anyway when it is zero - but this is because the IRQ does not have a mapping yet. When I change the code to map it then unmap it then I get:
> > > > IRQx - successful map then unmap
> > > > MSI - unsuccessful map (and unsuccessful unmap)
> > > > MSIX - successful map then unmap (despite the device still being in IRQx mode?)
> > > > Error - successfully map, kernel driver crash on the unmap!    
> > 
> > I remembered that there is a trick here specific to MSI, your device
> > probably supports more than one MSI vector.  MSI is a little bit
> > special, not all platforms support multiple MSI vectors and they were
> > pretty much outdated by the much more flexible MSI-X capability for
> > that reason.  To help with this the SET_IRQS ioctl returns negative on
> > error, 0 on success, and a positive value indicating the available
> > vectors to retry with if the requested count is not supported/available.
> > 
> > BTW, this should fix the oops you found:
> > https://lkml.org/lkml/2016/8/2/1912
> > 
> > Thanks,
> > Alex Hi Alex, Indeed I realise now that the MSI registration ioctl returns 8, the number of IRQs I would expect (the same as the MSIX ones). The question is, why doesn't the IRQ_INFO ioctl reply count = 8 like the MSIX one? Instead it returns 64 (I thought MSI only went up to 32 too?) config IRQ index 1  
> Info:
> argsz 0x10, flags 0x9, index 0x1, count 0x40,
> Register:
> failed to register interrupt set 1 : 0-63, error 8 Invalid argument config IRQ index 2
> Info:
> argsz 0x10, flags 0x9, index 0x2, count 0x8,
> Register:
> successfully registered interrupt set 2 : 0-7, ret 0 Thanks,Chris
>  		 	   		  

I believe this was fixed in the v3.16 kernel by:

fd49c81 drivers/vfio/pci: Fix wrong MSI interrupt count

Your previous oops shows you're running an old v3.13 kernel.




More information about the vfio-users mailing list