diff options
author | Gregory Haskins <ghaskins@novell.com> | 2009-05-20 10:30:49 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-09-10 01:32:41 -0400 |
commit | 721eecbf4fe995ca94a9edec0c9843b1cc0eaaf3 (patch) | |
tree | c759fe98a4ea5e2e2a7694e4b44a558407077290 /include/linux/kvm.h | |
parent | 0ba12d10817a8db1fd7d96d3283ec6c0b294aeab (diff) |
KVM: irqfd
KVM provides a complete virtual system environment for guests, including
support for injecting interrupts modeled after the real exception/interrupt
facilities present on the native platform (such as the IDT on x86).
Virtual interrupts can come from a variety of sources (emulated devices,
pass-through devices, etc) but all must be injected to the guest via
the KVM infrastructure. This patch adds a new mechanism to inject a specific
interrupt to a guest using a decoupled eventfd mechnanism: Any legal signal
on the irqfd (using eventfd semantics from either userspace or kernel) will
translate into an injected interrupt in the guest at the next available
interrupt window.
Signed-off-by: Gregory Haskins <ghaskins@novell.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux/kvm.h')
-rw-r--r-- | include/linux/kvm.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 7b17141c47c..8f53f24e527 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -418,6 +418,7 @@ struct kvm_trace_rec { | |||
418 | #ifdef __KVM_HAVE_MCE | 418 | #ifdef __KVM_HAVE_MCE |
419 | #define KVM_CAP_MCE 31 | 419 | #define KVM_CAP_MCE 31 |
420 | #endif | 420 | #endif |
421 | #define KVM_CAP_IRQFD 32 | ||
421 | 422 | ||
422 | #ifdef KVM_CAP_IRQ_ROUTING | 423 | #ifdef KVM_CAP_IRQ_ROUTING |
423 | 424 | ||
@@ -470,6 +471,15 @@ struct kvm_x86_mce { | |||
470 | }; | 471 | }; |
471 | #endif | 472 | #endif |
472 | 473 | ||
474 | #define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) | ||
475 | |||
476 | struct kvm_irqfd { | ||
477 | __u32 fd; | ||
478 | __u32 gsi; | ||
479 | __u32 flags; | ||
480 | __u8 pad[20]; | ||
481 | }; | ||
482 | |||
473 | /* | 483 | /* |
474 | * ioctls for VM fds | 484 | * ioctls for VM fds |
475 | */ | 485 | */ |
@@ -514,6 +524,7 @@ struct kvm_x86_mce { | |||
514 | #define KVM_ASSIGN_SET_MSIX_ENTRY \ | 524 | #define KVM_ASSIGN_SET_MSIX_ENTRY \ |
515 | _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) | 525 | _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) |
516 | #define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) | 526 | #define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) |
527 | #define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd) | ||
517 | 528 | ||
518 | /* | 529 | /* |
519 | * ioctls for vcpu fds | 530 | * ioctls for vcpu fds |