diff options
author | Feng Wu <feng.wu@intel.com> | 2015-09-18 10:29:53 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-10-01 09:06:47 -0400 |
commit | f70c20aaf141adb715a2d750c55154073b02a9c3 (patch) | |
tree | 47bca098ae2da44022af8b04f58d44089cd7ef80 /virt | |
parent | 9016cfb577a15abd6a7990890ccf6bf1edf04d31 (diff) |
KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'
This patch adds an arch specific hooks 'arch_update' in
'struct kvm_kernel_irqfd'. On Intel side, it is used to
update the IRTE when VT-d posted-interrupts is used.
Signed-off-by: Feng Wu <feng.wu@intel.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r-- | virt/kvm/eventfd.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 7df356d8f1fd..b637965746bb 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c | |||
@@ -266,6 +266,13 @@ void __attribute__((weak)) kvm_arch_irq_bypass_start( | |||
266 | struct irq_bypass_consumer *cons) | 266 | struct irq_bypass_consumer *cons) |
267 | { | 267 | { |
268 | } | 268 | } |
269 | |||
270 | int __attribute__((weak)) kvm_arch_update_irqfd_routing( | ||
271 | struct kvm *kvm, unsigned int host_irq, | ||
272 | uint32_t guest_irq, bool set) | ||
273 | { | ||
274 | return 0; | ||
275 | } | ||
269 | #endif | 276 | #endif |
270 | 277 | ||
271 | static int | 278 | static int |
@@ -586,9 +593,19 @@ void kvm_irq_routing_update(struct kvm *kvm) | |||
586 | 593 | ||
587 | spin_lock_irq(&kvm->irqfds.lock); | 594 | spin_lock_irq(&kvm->irqfds.lock); |
588 | 595 | ||
589 | list_for_each_entry(irqfd, &kvm->irqfds.items, list) | 596 | list_for_each_entry(irqfd, &kvm->irqfds.items, list) { |
590 | irqfd_update(kvm, irqfd); | 597 | irqfd_update(kvm, irqfd); |
591 | 598 | ||
599 | #ifdef CONFIG_HAVE_KVM_IRQ_BYPASS | ||
600 | if (irqfd->producer) { | ||
601 | int ret = kvm_arch_update_irqfd_routing( | ||
602 | irqfd->kvm, irqfd->producer->irq, | ||
603 | irqfd->gsi, 1); | ||
604 | WARN_ON(ret); | ||
605 | } | ||
606 | #endif | ||
607 | } | ||
608 | |||
592 | spin_unlock_irq(&kvm->irqfds.lock); | 609 | spin_unlock_irq(&kvm->irqfds.lock); |
593 | } | 610 | } |
594 | 611 | ||