aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-02-04 10:28:14 -0500
committerAvi Kivity <avi@redhat.com>2009-03-24 05:03:11 -0400
commit4925663a079c77d95d8685228ad6675fc5639c8e (patch)
tree52e93df78b23a44ed21d015f835688f673dd351a /include/linux
parent452425dbaa1974e9fc489e64a8de46a47b4c2754 (diff)
KVM: Report IRQ injection status to userspace.
IRQ injection status is either -1 (if there was no CPU found that should except the interrupt because IRQ was masked or ioapic was misconfigured or ...) or >= 0 in that case the number indicates to how many CPUs interrupt was injected. If the value is 0 it means that the interrupt was coalesced and probably should be reinjected. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kvm.h7
-rw-r--r--include/linux/kvm_host.h4
2 files changed, 8 insertions, 3 deletions
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 2163b3dd36e7..dd48225d1824 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -48,7 +48,10 @@ struct kvm_irq_level {
48 * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47.. 48 * For IA-64 (APIC model) IOAPIC0: irq 0-23; IOAPIC1: irq 24-47..
49 * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23.. 49 * For X86 (standard AT mode) PIC0/1: irq 0-15. IOAPIC0: 0-23..
50 */ 50 */
51 __u32 irq; 51 union {
52 __u32 irq;
53 __s32 status;
54 };
52 __u32 level; 55 __u32 level;
53}; 56};
54 57
@@ -402,6 +405,7 @@ struct kvm_trace_rec {
402#ifdef __KVM_HAVE_IOAPIC 405#ifdef __KVM_HAVE_IOAPIC
403#define KVM_CAP_IRQ_ROUTING 25 406#define KVM_CAP_IRQ_ROUTING 25
404#endif 407#endif
408#define KVM_CAP_IRQ_INJECT_STATUS 26
405 409
406#ifdef KVM_CAP_IRQ_ROUTING 410#ifdef KVM_CAP_IRQ_ROUTING
407 411
@@ -465,6 +469,7 @@ struct kvm_irq_routing {
465#define KVM_CREATE_PIT _IO(KVMIO, 0x64) 469#define KVM_CREATE_PIT _IO(KVMIO, 0x64)
466#define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) 470#define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state)
467#define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) 471#define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state)
472#define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level)
468#define KVM_REGISTER_COALESCED_MMIO \ 473#define KVM_REGISTER_COALESCED_MMIO \
469 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) 474 _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone)
470#define KVM_UNREGISTER_COALESCED_MMIO \ 475#define KVM_UNREGISTER_COALESCED_MMIO \
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 18b4df8264cf..894a56e365e8 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -110,7 +110,7 @@ struct kvm_memory_slot {
110 110
111struct kvm_kernel_irq_routing_entry { 111struct kvm_kernel_irq_routing_entry {
112 u32 gsi; 112 u32 gsi;
113 void (*set)(struct kvm_kernel_irq_routing_entry *e, 113 int (*set)(struct kvm_kernel_irq_routing_entry *e,
114 struct kvm *kvm, int level); 114 struct kvm *kvm, int level);
115 union { 115 union {
116 struct { 116 struct {
@@ -352,7 +352,7 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
352 struct kvm_irq_mask_notifier *kimn); 352 struct kvm_irq_mask_notifier *kimn);
353void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); 353void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask);
354 354
355void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); 355int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level);
356void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); 356void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
357void kvm_register_irq_ack_notifier(struct kvm *kvm, 357void kvm_register_irq_ack_notifier(struct kvm *kvm,
358 struct kvm_irq_ack_notifier *kian); 358 struct kvm_irq_ack_notifier *kian);