Skip to content

RFC uq/master: irqfd-based interrupt injection for virtio/vhost

Jan Kiszka kvm qemu-devel 1 version Applied

Status from this message: Thanks, applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 RFC Latest11 patches 5 repliesApplied

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/11msix: Factor out msix_get_messagehw/msix.c+13 -60 replies
2/11msix: Invoke msix_handle_mask_update on msix_mask_allhw/msix.c+4 -00 replies
3/11msix: Introduce vector notifiershw/msix.c hw/msix.h hw/pci.h+105 -00 replies
4/11kvm: Rename kvm_irqchip_add_route to kvm_irqchip_add_irq_routehw/pc_piix.c kvm-all.c kvm.h+6 -60 replies
5/11kvm: Introduce kvm_irqchip_add_msi_routekvm-all.c kvm-stub.c kvm.h+45 -40 replies
6/11kvm: Publicize kvm_irqchip_release_virqkvm-all.c kvm-stub.c kvm.h+6 -10 replies
7/11kvm: Make kvm_irqchip_commit_routes an internal servicehw/pc_piix.c kvm-all.c kvm.h+15 -180 replies
8/11kvm: Introduce kvm_irqchip_add/remove_irqfdkvm-all.c kvm-stub.c kvm.h+43 -00 replies
9/11kvm: Enable use of kvm_irqchip_in_kernel in hwlib codekvm-stub.c+1 -00 replies
10/11msix: Add msix_nr_vectors_allocatedhw/msix.c hw/msix.h+7 -00 replies
11/11virtio/vhost: Add support for KVM in-kernel MSI injectionhw/virtio-pci.c hw/virtio-pci.h+132 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC][PATCH v2 00/11] uq/master: irqfd-based interrupt injection for virtio/vhost

[ changes in v2: rebase over uq/master ]

This series is another major milestone of merging qemu-kvm into upstream. It implements the required interfaces and logic to directly inject MSI-X interrupts generated by the vhost-net kernel module into the KVM in-kernel irqchip. This involves
- establishing MSI vector notifiers, so far triggered on relevant MSI-X configuration changes of subscribed PCI devices
- support for static vIRQ-to-MSI routes
- an API for linking an IRQFD with such a vIRQ
- the usage of these services in virtio-pci to enable direct injection

The series also contains some smaller refactorings of the KVM IRQ routing API such as automatic committing of route changes. It applies on top of the KVM MSI support series [1] posted recently. The complete stack is available at

git://git.kiszka.org/qemu-kvm.git queues/kvm-msi-irqfd

If the proposes API is acceptable, I will also provide some morphing patches for qemu-kvm to make the merge of both trees smoother.

After this series, to only reasons to still use qemu-kvm for production purposes will be PCI device assignment and potential dependencies on legacy command line switches as well as vmstate formats (when requiring backward migration support). However, the majority of users should be able to switch to upstream QEMU seamlessly and finally receive the same level of performance on x86.

[1] http://thread.gmane.org/gmane.comp.emulators.kvm.devel/90651

Jan Kiszka (11):
msix: Factor out msix_get_message
msix: Invoke msix_handle_mask_update on msix_mask_all
msix: Introduce vector notifiers
kvm: Rename kvm_irqchip_add_route to kvm_irqchip_add_irq_route
kvm: Introduce kvm_irqchip_add_msi_route
kvm: Publicize kvm_irqchip_release_virq
kvm: Make kvm_irqchip_commit_routes an internal service
kvm: Introduce kvm_irqchip_add/remove_irqfd
kvm: Enable use of kvm_irqchip_in_kernel in hwlib code
msix: Add msix_nr_vectors_allocated
virtio/vhost: Add support for KVM in-kernel MSI injection

 hw/msix.c       |  121 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 hw/msix.h       |    6 +++
 hw/pc_piix.c    |   14 ++----
 hw/pci.h        |    8 ++++
 hw/virtio-pci.c |  126 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/virtio-pci.h |    6 +++
 kvm-all.c       |   91 +++++++++++++++++++++++++++++++++------
 kvm-stub.c      |   23 ++++++++++
 kvm.h           |   17 +++++---
 9 files changed, 377 insertions(+), 35 deletions(-)
Signature · 1 line
1.7.3.4