<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><br> <BR><div>> Date: Tue, 2 Aug 2016 16:29:52 -0600<br>> From: alex.williamson@redhat.com<br>> To: the_cartographer@hotmail.com<br>> CC: vfio-users@redhat.com<br>> Subject: Re: [vfio-users] Cannot register eventfd with MSI/MSI-X interrupts<br>> <br>> On Tue, 2 Aug 2016 09:54:19 -0600<br>> Alex Williamson <alex.williamson@redhat.com> wrote:<br>> <br>> > On Tue, 2 Aug 2016 10:21:30 +0000<br>> > chris thompson <the_cartographer@hotmail.com> wrote:<br>> > <br>> > > Hi Alex,<br>> > >  <br>> > > 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:<br>> > > IRQx - successful map then unmap<br>> > > MSI - unsuccessful map (and unsuccessful unmap)<br>> > > MSIX - successful map then unmap (despite the device still being in IRQx mode?)<br>> > > Error - successfully map, kernel driver crash on the unmap!  <br>> <br>> I remembered that there is a trick here specific to MSI, your device<br>> probably supports more than one MSI vector.  MSI is a little bit<br>> special, not all platforms support multiple MSI vectors and they were<br>> pretty much outdated by the much more flexible MSI-X capability for<br>> that reason.  To help with this the SET_IRQS ioctl returns negative on<br>> error, 0 on success, and a positive value indicating the available<br>> vectors to retry with if the requested count is not supported/available.<br>> <br>> BTW, this should fix the oops you found:<br>> https://lkml.org/lkml/2016/8/2/1912<br>> <br>> Thanks,<br>> Alex</div><div> </div><div>Hi Alex,</div><div> </div><div>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?)</div><div> </div><div>config IRQ index 1<br>Info:<br>argsz 0x10, flags 0x9, index 0x1, count 0x40,<br>Register:<br>failed to register interrupt set 1 : 0-63, error 8 Invalid argument</div><div> </div><div>config IRQ index 2<br>Info:<br>argsz 0x10, flags 0x9, index 0x2, count 0x8,<br>Register:<br>successfully registered interrupt set 2 : 0-7, ret 0</div><div> </div><div>Thanks,</div><div>Chris<br></div>                                        </div></body>
</html>