diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2012-09-21 11:58:03 -0600 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-09-23 13:50:15 +0200 |
commit | 7a84428af7ca6a847f058c9ff244a18a2664fd1b (patch) | |
tree | e6c573c701736a75d618b670d66e98398b62769f /include/linux/kvm_host.h | |
parent | 1e08ec4a130e2745d96df169e67c58df98a07311 (diff) | |
download | blackbird-op-linux-7a84428af7ca6a847f058c9ff244a18a2664fd1b.tar.gz blackbird-op-linux-7a84428af7ca6a847f058c9ff244a18a2664fd1b.zip |
KVM: Add resampling irqfds for level triggered interrupts
To emulate level triggered interrupts, add a resample option to
KVM_IRQFD. When specified, a new resamplefd is provided that notifies
the user when the irqchip has been resampled by the VM. This may, for
instance, indicate an EOI. Also in this mode, posting of an interrupt
through an irqfd only asserts the interrupt. On resampling, the
interrupt is automatically de-asserted prior to user notification.
This enables level triggered interrupts to be posted and re-enabled
from vfio with no userspace intervention.
All resampling irqfds can make use of a single irq source ID, so we
reserve a new one for this interface.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r-- | include/linux/kvm_host.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 80bfc880921e..2850656e2e96 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -119,7 +119,8 @@ static inline bool is_error_page(struct page *page) #define KVM_REQ_PMU 16 #define KVM_REQ_PMI 17 -#define KVM_USERSPACE_IRQ_SOURCE_ID 0 +#define KVM_USERSPACE_IRQ_SOURCE_ID 0 +#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 struct kvm; struct kvm_vcpu; @@ -343,6 +344,8 @@ struct kvm { struct { spinlock_t lock; struct list_head items; + struct list_head resampler_list; + struct mutex resampler_lock; } irqfds; struct list_head ioeventfds; #endif |