mbox series

[RFC,v2,0/1] msi support for platform devices

Message ID 20201124161646.41191-1-vikas.gupta@broadcom.com (mailing list archive)
Headers show
Series msi support for platform devices | expand

Message

Vikas Gupta Nov. 24, 2020, 4:16 p.m. UTC
This RFC adds support for MSI for platform devices.
MSI block is added as an ext irq along with the existing
wired interrupt implementation.

Changes from:
-------------
 v1 to v2:
	1) IRQ allocation has been implemented as below:
	       ----------------------------
	       |IRQ-0|IRQ-1|....|IRQ-n|MSI|
       	       ----------------------------
		MSI block has msi contexts and its implemneted
		as ext irq.

	2) Removed vendor specific module for msi handling so
	   previously patch2 and patch3 are not required.

	3) MSI related data is exported to userspace using 'caps'.
	 Please note VFIO_IRQ_INFO_CAP_TYPE in include/uapi/linux/vfio.h implementation
	is taken from the Eric`s patch
        https://patchwork.kernel.org/project/kvm/patch/20201116110030.32335-8-eric.auger@redhat.com/


 v0 to v1:
   i)  Removed MSI device flag VFIO_DEVICE_FLAGS_MSI.
   ii) Add MSI(s) at the end of the irq list of platform IRQs.
       MSI(s) with first entry of MSI block has count and flag
       information.
       IRQ list: Allocation for IRQs + MSIs are allocated as below
       Example: if there are 'n' IRQs and 'k' MSIs
       -------------------------------------------------------
       |IRQ-0|IRQ-1|....|IRQ-n|MSI-0|MSI-1|MSI-2|......|MSI-k|
       -------------------------------------------------------
       MSI-0 will have count=k set and flags set accordingly.

Vikas Gupta (1):
  vfio/platform: add support for msi

 drivers/vfio/platform/vfio_platform_common.c  |  99 ++++++-
 drivers/vfio/platform/vfio_platform_irq.c     | 260 +++++++++++++++++-
 drivers/vfio/platform/vfio_platform_private.h |  16 ++
 include/uapi/linux/vfio.h                     |  43 +++
 4 files changed, 401 insertions(+), 17 deletions(-)

Comments

Eric Auger Dec. 2, 2020, 2:43 p.m. UTC | #1
Hi Vikas,
On 11/24/20 5:16 PM, Vikas Gupta wrote:
> This RFC adds support for MSI for platform devices.
> MSI block is added as an ext irq along with the existing
> wired interrupt implementation.
> 
> Changes from:
> -------------
>  v1 to v2:
> 	1) IRQ allocation has been implemented as below:
> 	       ----------------------------
> 	       |IRQ-0|IRQ-1|....|IRQ-n|MSI|
>        	       ----------------------------
> 		MSI block has msi contexts and its implemneted
it is implemented
> 		as ext irq.
> 
> 	2) Removed vendor specific module for msi handling so
> 	   previously patch2 and patch3 are not required.
> 
> 	3) MSI related data is exported to userspace using 'caps'.
> 	 Please note VFIO_IRQ_INFO_CAP_TYPE in include/uapi/linux/vfio.h implementation
> 	is taken from the Eric`s patch
>         https://patchwork.kernel.org/project/kvm/patch/20201116110030.32335-8-eric.auger@redhat.com/
So do you mean that by exposing the vectors, now you do not need the msi
module anymore?


Thanks

Eric
> 
> 
>  v0 to v1:
>    i)  Removed MSI device flag VFIO_DEVICE_FLAGS_MSI.
>    ii) Add MSI(s) at the end of the irq list of platform IRQs.
>        MSI(s) with first entry of MSI block has count and flag
>        information.
>        IRQ list: Allocation for IRQs + MSIs are allocated as below
>        Example: if there are 'n' IRQs and 'k' MSIs
>        -------------------------------------------------------
>        |IRQ-0|IRQ-1|....|IRQ-n|MSI-0|MSI-1|MSI-2|......|MSI-k|
>        -------------------------------------------------------
>        MSI-0 will have count=k set and flags set accordingly.
> 
> Vikas Gupta (1):
>   vfio/platform: add support for msi
> 
>  drivers/vfio/platform/vfio_platform_common.c  |  99 ++++++-
>  drivers/vfio/platform/vfio_platform_irq.c     | 260 +++++++++++++++++-
>  drivers/vfio/platform/vfio_platform_private.h |  16 ++
>  include/uapi/linux/vfio.h                     |  43 +++
>  4 files changed, 401 insertions(+), 17 deletions(-)
>
Vikas Gupta Dec. 3, 2020, 2:39 p.m. UTC | #2
HI Eric,

On Wed, Dec 2, 2020 at 8:13 PM Auger Eric <eric.auger@redhat.com> wrote:
>
> Hi Vikas,
> On 11/24/20 5:16 PM, Vikas Gupta wrote:
> > This RFC adds support for MSI for platform devices.
> > MSI block is added as an ext irq along with the existing
> > wired interrupt implementation.
> >
> > Changes from:
> > -------------
> >  v1 to v2:
> >       1) IRQ allocation has been implemented as below:
> >              ----------------------------
> >              |IRQ-0|IRQ-1|....|IRQ-n|MSI|
> >                      ----------------------------
> >               MSI block has msi contexts and its implemneted
> it is implemented
> >               as ext irq.
> >
> >       2) Removed vendor specific module for msi handling so
> >          previously patch2 and patch3 are not required.
> >
> >       3) MSI related data is exported to userspace using 'caps'.
> >        Please note VFIO_IRQ_INFO_CAP_TYPE in include/uapi/linux/vfio.h implementation
> >       is taken from the Eric`s patch
> >         https://patchwork.kernel.org/project/kvm/patch/20201116110030.32335-8-eric.auger@redhat.com/
> So do you mean that by exposing the vectors, now you do not need the msi
> module anymore?
Yes, with the support of caps we can expose the MSI related data to
userspace and userspace can configure the device, which previous
patches were doing in the kernel module.

Thanks,
Vikas
>
>
> Thanks
>
> Eric
> >
> >
> >  v0 to v1:
> >    i)  Removed MSI device flag VFIO_DEVICE_FLAGS_MSI.
> >    ii) Add MSI(s) at the end of the irq list of platform IRQs.
> >        MSI(s) with first entry of MSI block has count and flag
> >        information.
> >        IRQ list: Allocation for IRQs + MSIs are allocated as below
> >        Example: if there are 'n' IRQs and 'k' MSIs
> >        -------------------------------------------------------
> >        |IRQ-0|IRQ-1|....|IRQ-n|MSI-0|MSI-1|MSI-2|......|MSI-k|
> >        -------------------------------------------------------
> >        MSI-0 will have count=k set and flags set accordingly.
> >
> > Vikas Gupta (1):
> >   vfio/platform: add support for msi
> >
> >  drivers/vfio/platform/vfio_platform_common.c  |  99 ++++++-
> >  drivers/vfio/platform/vfio_platform_irq.c     | 260 +++++++++++++++++-
> >  drivers/vfio/platform/vfio_platform_private.h |  16 ++
> >  include/uapi/linux/vfio.h                     |  43 +++
> >  4 files changed, 401 insertions(+), 17 deletions(-)
> >
>