From 052d709d0cfd77c36f5b31402c3cc1c3d868d618 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 10 Mar 2021 10:37:59 +0000 Subject: fix IRQ disable path (#386) Properly fix IRQ disabling: Allow count == 0 to mean "disable all IRQS of the given type". On our side, disabling an IRQ means forgetting about the eventfd that was previously passed over the socket. Allow individual IRQs to be disabled, by means of a VFIO_IRQ_SET_DATA_EVENTFD message with no file descriptors passed. In vfio, this is done via setting "-1" in the fd slots; which isn't possible via auxiliary data. Thus, only one IRQ can be disabled a a time in vfio-user. Clean up "->type": this is never set, so wasn't having any effect. Follow up changes will likely re-introduce this in some form. Signed-off-by: John Levon Reviewed-by: Thanos Makatos --- docs/vfio-user.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/vfio-user.rst b/docs/vfio-user.rst index f4562ef..93d61cd 100644 --- a/docs/vfio-user.rst +++ b/docs/vfio-user.rst @@ -1276,6 +1276,8 @@ VFIO IRQ set format was sent in the message meta-data. These descriptors will be signalled when the action defined by the action flags occurs. In AF_UNIX sockets, the descriptors are sent as SCM_RIGHTS type ancillary data. + If no file descriptors are provided, this de-assigns the specified + previously configured interrupts. * *VFIO_IRQ_SET_ACTION_MASK* indicates a masking event. It can be used with VFIO_IRQ_SET_DATA_BOOL or VFIO_IRQ_SET_DATA_NONE to mask an interrupt, or with VFIO_IRQ_SET_DATA_EVENTFD to generate an event when the guest masks @@ -1292,8 +1294,8 @@ VFIO IRQ set format * *index* is the index of IRQ type being setup. * *start* is the start of the sub-index being set. * *count* describes the number of sub-indexes being set. As a special case, a - count of 0 with data flags of VFIO_IRQ_SET_DATA_NONE disables all interrupts - of the index. + count (and start) of 0, with data flags of VFIO_IRQ_SET_DATA_NONE disables + all interrupts of the index. * *data* is an optional field included when the VFIO_IRQ_SET_DATA_BOOL flag is present. It contains an array of booleans that specify whether the action is to be performed on the corresponding -- cgit v1.1