Linux Kernel
3.7.1
|
#include <vfio.h>
Data Fields | |
__u32 | argsz |
__u32 | flags |
__u32 | index |
__u32 | start |
__u32 | count |
__u8 | data [] |
VFIO_DEVICE_SET_IRQS - _IOW(VFIO_TYPE, VFIO_BASE + 10, struct vfio_irq_set)
Set signaling, masking, and unmasking of interrupts. Caller provides struct vfio_irq_set with all fields set. 'start' and 'count' indicate the range of subindexes being specified.
The DATA flags specify the type of data provided. If DATA_NONE, the operation performs the specified action immediately on the specified interrupt(s). For example, to unmask AUTOMASKED interrupt [0,0]: flags = (DATA_NONE|ACTION_UNMASK), index = 0, start = 0, count = 1.
DATA_BOOL allows sparse support for the same on arrays of interrupts. For example, to mask interrupts [0,1] and [0,3] (but not [0,2]): flags = (DATA_BOOL|ACTION_MASK), index = 0, start = 1, count = 3, data = {1,0,1}
DATA_EVENTFD binds the specified ACTION to the provided __s32 eventfd. A value of -1 can be used to either de-assign interrupts if already assigned or skip un-assigned interrupts. For example, to set an eventfd to be trigger for interrupts [0,0] and [0,2]: flags = (DATA_EVENTFD|ACTION_TRIGGER), index = 0, start = 0, count = 3, data = {fd1, -1, fd2} If index [0,1] is previously set, two count = 1 ioctls calls would be required to set [0,0] and [0,2] without changing [0,1].
Once a signaling mechanism is set, DATA_BOOL or DATA_NONE can be used with ACTION_TRIGGER to perform kernel level interrupt loopback testing from userspace (ie. simulate hardware triggering).
Setting of an event triggering mechanism to userspace for ACTION_TRIGGER enables the interrupt index for the device. Individual subindex interrupts can be disabled using the -1 value for DATA_EVENTFD or the index can be disabled as a whole with: flags = (DATA_NONE|ACTION_TRIGGER), count = 0.
Note that ACTION_[UN]MASK specify user->kernel signaling (irqfds) while ACTION_TRIGGER specifies kernel->user signaling.