diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2012-03-29 21:14:12 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-04-24 15:59:47 +0300 |
commit | 07975ad3b30579ca27d880491ad992326b930c63 (patch) | |
tree | fea166a02c387949a09a948a51781074bdc9ed68 /virt/kvm/kvm_main.c | |
parent | 1f15d10984c854e077da5aa1a23f901496b49773 (diff) | |
download | kernel_goldelico_gta04-07975ad3b30579ca27d880491ad992326b930c63.zip kernel_goldelico_gta04-07975ad3b30579ca27d880491ad992326b930c63.tar.gz kernel_goldelico_gta04-07975ad3b30579ca27d880491ad992326b930c63.tar.bz2 |
KVM: Introduce direct MSI message injection for in-kernel irqchips
Currently, MSI messages can only be injected to in-kernel irqchips by
defining a corresponding IRQ route for each message. This is not only
unhandy if the MSI messages are generated "on the fly" by user space,
IRQ routes are a limited resource that user space has to manage
carefully.
By providing a direct injection path, we can both avoid using up limited
resources and simplify the necessary steps for user land.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r-- | virt/kvm/kvm_main.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 9eb7936..1847c76 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2060,6 +2060,17 @@ static long kvm_vm_ioctl(struct file *filp, mutex_unlock(&kvm->lock); break; #endif +#ifdef CONFIG_HAVE_KVM_MSI + case KVM_SIGNAL_MSI: { + struct kvm_msi msi; + + r = -EFAULT; + if (copy_from_user(&msi, argp, sizeof msi)) + goto out; + r = kvm_send_userspace_msi(kvm, &msi); + break; + } +#endif default: r = kvm_arch_vm_ioctl(filp, ioctl, arg); if (r == -ENOTTY) @@ -2188,6 +2199,9 @@ static long kvm_dev_ioctl_check_extension_generic(long arg) case KVM_CAP_SET_BOOT_CPU_ID: #endif case KVM_CAP_INTERNAL_ERROR_DATA: +#ifdef CONFIG_HAVE_KVM_MSI + case KVM_CAP_SIGNAL_MSI: +#endif return 1; #ifdef CONFIG_HAVE_KVM_IRQCHIP case KVM_CAP_IRQ_ROUTING: |