vfio/fsl-mc: trigger an interrupt via eventfd
authorDiana Craciun <diana.craciun@oss.nxp.com>
Mon, 5 Oct 2020 17:36:52 +0000 (20:36 +0300)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 12 Oct 2020 17:33:15 +0000 (11:33 -0600)
commitcc0ee20bd96971c10eba9a83ecf1c0733078a083
tree6e0208f57f62939b4ee086574a520fc1b227f6db
parent2e0d29561f593a5ab6d37ea032513d2714a007df
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>
drivers/vfio/fsl-mc/vfio_fsl_mc.c
drivers/vfio/fsl-mc/vfio_fsl_mc_intr.c
drivers/vfio/fsl-mc/vfio_fsl_mc_private.h