linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: MSI/MSIX for VFIO platform
       [not found] <c94c36305980f80674aa699e27b9895b@mail.gmail.com>
@ 2020-09-10 16:57 ` Alex Williamson
  2020-09-11 13:52   ` Auger Eric
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Williamson @ 2020-09-10 16:57 UTC (permalink / raw)
  To: Vikas Gupta
  Cc: Cornelia Huck, kvm, linux-kernel, Vikram Prakash, Srinath Mannam,
	Auger Eric

On Thu, 10 Sep 2020 16:15:27 +0530
Vikas Gupta <vikas.gupta@broadcom.com> wrote:

> Hi Alex/Cornelia,
> 
> We are looking for MSI interrupts for platform devices in user-space
> applications via event/poll mechanism using VFIO.
> 
> Since there is no support for MSI/MSIX handling in VFIO-platform in kernel,
> it may not possible to get this feature in user-space.
> 
> Is there any other way we can get this feature in user-space OR can you
> please suggest if any patch or feature is in progress for same in VFIO
> platform?
> 
> Any suggestions would be helpful.

Eric (Cc'd) is the maintainer of vfio-platform.

vfio-platform devices don't have IRQ indexes dedicated to MSI and MSI-X
like vfio-pci devices do (technically these are PCI concepts, but I
assume we're referring generically to message signaled interrupts), but
that's simply due to the lack of standardization in platform devices.
Logically these are simply collections of edge triggered interrupts,
which the vfio device API supports generically, it's simply a matter
that the vfio bus driver exposing a vfio-platform device create an IRQ
index exposing these vectors.  Thanks,

Alex


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MSI/MSIX for VFIO platform
  2020-09-10 16:57 ` MSI/MSIX for VFIO platform Alex Williamson
@ 2020-09-11 13:52   ` Auger Eric
  2020-09-14  7:06     ` Vikas Gupta
  0 siblings, 1 reply; 3+ messages in thread
From: Auger Eric @ 2020-09-11 13:52 UTC (permalink / raw)
  To: Alex Williamson, Vikas Gupta
  Cc: Cornelia Huck, kvm, linux-kernel, Vikram Prakash, Srinath Mannam

Hi Vikas,

On 9/10/20 6:57 PM, Alex Williamson wrote:
> On Thu, 10 Sep 2020 16:15:27 +0530
> Vikas Gupta <vikas.gupta@broadcom.com> wrote:
> 
>> Hi Alex/Cornelia,
>>
>> We are looking for MSI interrupts for platform devices in user-space
>> applications via event/poll mechanism using VFIO.
>>
>> Since there is no support for MSI/MSIX handling in VFIO-platform in kernel,
>> it may not possible to get this feature in user-space.
>>
>> Is there any other way we can get this feature in user-space OR can you
>> please suggest if any patch or feature is in progress for same in VFIO
>> platform?
>>
>> Any suggestions would be helpful.
> 
> Eric (Cc'd) is the maintainer of vfio-platform.
> 
> vfio-platform devices don't have IRQ indexes dedicated to MSI and MSI-X
> like vfio-pci devices do (technically these are PCI concepts, but I
> assume we're referring generically to message signaled interrupts), but
> that's simply due to the lack of standardization in platform devices.
> Logically these are simply collections of edge triggered interrupts,
> which the vfio device API supports generically, it's simply a matter
> that the vfio bus driver exposing a vfio-platform device create an IRQ
> index exposing these vectors.  Thanks,

I have not worked on MSI support and I am not aware of any work
happening in this area.

First I would recommend to look at IRQ related uapis exposed by VFIO:
VFIO_DEVICE_GET_IRQ_INFO
VFIO_DEVICE_SET_IRQS

and try to understand if they can be implemented for MSIs in a generic
way in the vfio_platform driver using platform-msi helpers.

For instance VFIO_DEVICE_GET_IRQ_INFO would need to return the number of
requested vectors. On init I guess we should allocate vectors using
platform_msi_domain_alloc_irqs/ devm_request_irq and in the handler
trigger the eventfd provided through VFIO_DEVICE_SET_IRQS.

On userspace where you have to trap the MSI setup to call the above
functions and setup irqfd injection. This would be device specific as
opposed to PCI. That's just rough ideas at the moment.

Thanks

Eric

> 
> Alex
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MSI/MSIX for VFIO platform
  2020-09-11 13:52   ` Auger Eric
@ 2020-09-14  7:06     ` Vikas Gupta
  0 siblings, 0 replies; 3+ messages in thread
From: Vikas Gupta @ 2020-09-14  7:06 UTC (permalink / raw)
  To: Auger Eric
  Cc: Alex Williamson, Cornelia Huck, kvm, linux-kernel,
	Vikram Prakash, Srinath Mannam

Hi Eric/Alex,
Thanks for your valuable suggestions and get back to you if anything
is required.

Thanks,
Vikas

On Fri, Sep 11, 2020 at 7:23 PM Auger Eric <eric.auger@redhat.com> wrote:
>
> Hi Vikas,
>
> On 9/10/20 6:57 PM, Alex Williamson wrote:
> > On Thu, 10 Sep 2020 16:15:27 +0530
> > Vikas Gupta <vikas.gupta@broadcom.com> wrote:
> >
> >> Hi Alex/Cornelia,
> >>
> >> We are looking for MSI interrupts for platform devices in user-space
> >> applications via event/poll mechanism using VFIO.
> >>
> >> Since there is no support for MSI/MSIX handling in VFIO-platform in kernel,
> >> it may not possible to get this feature in user-space.
> >>
> >> Is there any other way we can get this feature in user-space OR can you
> >> please suggest if any patch or feature is in progress for same in VFIO
> >> platform?
> >>
> >> Any suggestions would be helpful.
> >
> > Eric (Cc'd) is the maintainer of vfio-platform.
> >
> > vfio-platform devices don't have IRQ indexes dedicated to MSI and MSI-X
> > like vfio-pci devices do (technically these are PCI concepts, but I
> > assume we're referring generically to message signaled interrupts), but
> > that's simply due to the lack of standardization in platform devices.
> > Logically these are simply collections of edge triggered interrupts,
> > which the vfio device API supports generically, it's simply a matter
> > that the vfio bus driver exposing a vfio-platform device create an IRQ
> > index exposing these vectors.  Thanks,
>
> I have not worked on MSI support and I am not aware of any work
> happening in this area.
>
> First I would recommend to look at IRQ related uapis exposed by VFIO:
> VFIO_DEVICE_GET_IRQ_INFO
> VFIO_DEVICE_SET_IRQS
>
> and try to understand if they can be implemented for MSIs in a generic
> way in the vfio_platform driver using platform-msi helpers.
>
> For instance VFIO_DEVICE_GET_IRQ_INFO would need to return the number of
> requested vectors. On init I guess we should allocate vectors using
> platform_msi_domain_alloc_irqs/ devm_request_irq and in the handler
> trigger the eventfd provided through VFIO_DEVICE_SET_IRQS.
>
> On userspace where you have to trap the MSI setup to call the above
> functions and setup irqfd injection. This would be device specific as
> opposed to PCI. That's just rough ideas at the moment.
>
> Thanks
>
> Eric
>
> >
> > Alex
> >
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-14  7:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <c94c36305980f80674aa699e27b9895b@mail.gmail.com>
2020-09-10 16:57 ` MSI/MSIX for VFIO platform Alex Williamson
2020-09-11 13:52   ` Auger Eric
2020-09-14  7:06     ` Vikas Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).