summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
diff options
context:
space:
mode:
authorDiana Craciun <diana.craciun@oss.nxp.com>2020-10-05 20:36:52 +0300
committerAlex Williamson <alex.williamson@redhat.com>2020-10-12 11:33:15 -0600
commitcc0ee20bd96971c10eba9a83ecf1c0733078a083 (patch)
tree6e0208f57f62939b4ee086574a520fc1b227f6db /drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
parent2e0d29561f593a5ab6d37ea032513d2714a007df (diff)
downloadlinux-stable-cc0ee20bd96971c10eba9a83ecf1c0733078a083.tar.gz
linux-stable-cc0ee20bd96971c10eba9a83ecf1c0733078a083.tar.bz2
linux-stable-cc0ee20bd96971c10eba9a83ecf1c0733078a083.zip
vfio/fsl-mc: trigger an interrupt via eventfd
This patch allows to set an eventfd for fsl-mc device interrupts and also to trigger the interrupt eventfd from userspace for testing. All fsl-mc device interrupts are MSIs. The MSIs are allocated from the MSI domain only once per DPRC and used by all the DPAA2 objects. The interrupts are managed by the DPRC in a pool of interrupts. Each device requests interrupts from this pool. The pool is allocated when the first virtual device is setting the interrupts. The pool of interrupts is protected by a lock. The DPRC has an interrupt of its own which indicates if the DPRC contents have changed. However, currently, the contents of a DPRC assigned to the guest cannot be changed at runtime, so this interrupt is not configured. Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com> Signed-off-by: Diana Craciun <diana.craciun@oss.nxp.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/fsl-mc/vfio_fsl_mc_private.h')
-rw-r--r--drivers/vfio/fsl-mc/vfio_fsl_mc_private.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h b/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
index 2c3f625a3240..7aa49b9ba60d 100644
--- a/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
+++ b/drivers/vfio/fsl-mc/vfio_fsl_mc_private.h
@@ -15,6 +15,13 @@
#define VFIO_FSL_MC_INDEX_TO_OFFSET(index) \
((u64)(index) << VFIO_FSL_MC_OFFSET_SHIFT)
+struct vfio_fsl_mc_irq {
+ u32 flags;
+ u32 count;
+ struct eventfd_ctx *trigger;
+ char *name;
+};
+
struct vfio_fsl_mc_reflck {
struct kref kref;
struct mutex lock;
@@ -34,6 +41,7 @@ struct vfio_fsl_mc_device {
struct vfio_fsl_mc_region *regions;
struct vfio_fsl_mc_reflck *reflck;
struct mutex igate;
+ struct vfio_fsl_mc_irq *mc_irqs;
};
extern int vfio_fsl_mc_set_irqs_ioctl(struct vfio_fsl_mc_device *vdev,
@@ -41,4 +49,6 @@ extern int vfio_fsl_mc_set_irqs_ioctl(struct vfio_fsl_mc_device *vdev,
unsigned int start, unsigned int count,
void *data);
+void vfio_fsl_mc_irqs_cleanup(struct vfio_fsl_mc_device *vdev);
+
#endif /* VFIO_FSL_MC_PRIVATE_H */