diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-02-04 10:28:14 -0500 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-03-24 05:03:11 -0400 |
commit | 4925663a079c77d95d8685228ad6675fc5639c8e (patch) | |
tree | 52e93df78b23a44ed21d015f835688f673dd351a /arch/ia64/kvm | |
parent | 452425dbaa1974e9fc489e64a8de46a47b4c2754 (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 'arch/ia64/kvm')
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 9c77e3939e97..076b00d1dbff 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -182,7 +182,7 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
182 | switch (ext) { | 182 | switch (ext) { |
183 | case KVM_CAP_IRQCHIP: | 183 | case KVM_CAP_IRQCHIP: |
184 | case KVM_CAP_MP_STATE: | 184 | case KVM_CAP_MP_STATE: |
185 | 185 | case KVM_CAP_IRQ_INJECT_STATUS: | |
186 | r = 1; | 186 | r = 1; |
187 | break; | 187 | break; |
188 | case KVM_CAP_COALESCED_MMIO: | 188 | case KVM_CAP_COALESCED_MMIO: |
@@ -927,6 +927,7 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
927 | goto out; | 927 | goto out; |
928 | } | 928 | } |
929 | break; | 929 | break; |
930 | case KVM_IRQ_LINE_STATUS: | ||
930 | case KVM_IRQ_LINE: { | 931 | case KVM_IRQ_LINE: { |
931 | struct kvm_irq_level irq_event; | 932 | struct kvm_irq_level irq_event; |
932 | 933 | ||
@@ -934,10 +935,17 @@ long kvm_arch_vm_ioctl(struct file *filp, | |||
934 | if (copy_from_user(&irq_event, argp, sizeof irq_event)) | 935 | if (copy_from_user(&irq_event, argp, sizeof irq_event)) |
935 | goto out; | 936 | goto out; |
936 | if (irqchip_in_kernel(kvm)) { | 937 | if (irqchip_in_kernel(kvm)) { |
938 | __s32 status; | ||
937 | mutex_lock(&kvm->lock); | 939 | mutex_lock(&kvm->lock); |
938 | kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, | 940 | status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, |
939 | irq_event.irq, irq_event.level); | 941 | irq_event.irq, irq_event.level); |
940 | mutex_unlock(&kvm->lock); | 942 | mutex_unlock(&kvm->lock); |
943 | if (ioctl == KVM_IRQ_LINE_STATUS) { | ||
944 | irq_event.status = status; | ||
945 | if (copy_to_user(argp, &irq_event, | ||
946 | sizeof irq_event)) | ||
947 | goto out; | ||
948 | } | ||
941 | r = 0; | 949 | r = 0; |
942 | } | 950 | } |
943 | break; | 951 | break; |