[RFC, v3 0/2] msi support for platform devices

From: Vikas Gupta
Date: Mon Dec 14 2020 - 12:46:38 EST


This RFC adds support for MSI for platform devices.
MSI block is added as an ext irq along with the existing
wired interrupt implementation. The patchset exports two
caps for MSI and related data to configure MSI source device.

Changes from:
-------------
v2 to v3:
1) Restored the vendor specific module to get max number
of MSIs supported and .count value initialized.
2) Comments from Eric addressed.

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@xxxxxxxxxx/


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 (2):
vfio/platform: add support for msi
vfio/platform: msi: add Broadcom platform devices

drivers/vfio/platform/Kconfig | 1 +
drivers/vfio/platform/Makefile | 1 +
drivers/vfio/platform/msi/Kconfig | 9 +
drivers/vfio/platform/msi/Makefile | 2 +
.../vfio/platform/msi/vfio_platform_bcmplt.c | 49 ++++
drivers/vfio/platform/vfio_platform_common.c | 179 +++++++++++-
drivers/vfio/platform/vfio_platform_irq.c | 260 +++++++++++++++++-
drivers/vfio/platform/vfio_platform_private.h | 32 +++
include/uapi/linux/vfio.h | 44 +++
9 files changed, 558 insertions(+), 19 deletions(-)
create mode 100644 drivers/vfio/platform/msi/Kconfig
create mode 100644 drivers/vfio/platform/msi/Makefile
create mode 100644 drivers/vfio/platform/msi/vfio_platform_bcmplt.c

--
2.17.1


--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature