]> git.proxmox.com Git - qemu.git/commit - kvm-all.c
kvm: Introduce basic MSI support for in-kernel irqchips
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 16 May 2012 18:41:10 +0000 (15:41 -0300)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 16 May 2012 21:04:44 +0000 (18:04 -0300)
commit04fa27f5ae5f025424bb7b88d3453c46e8900102
treee54552fc9697f4035792118b122d069ef2cbc7cd
parent14de9bab9e4aa47215c26d87de7385afbcb37afa
kvm: Introduce basic MSI support for in-kernel irqchips

This patch basically adds kvm_irqchip_send_msi, a service for sending
arbitrary MSI messages to KVM's in-kernel irqchip models.

As the original KVM API requires us to establish a static route from a
pseudo GSI to the target MSI message and inject the MSI via toggling
that virtual IRQ, we need to play some tricks to make this interface
transparent. We create those routes on demand and keep them in a hash
table. Succeeding messages can then search for an existing route in the
table first and reuse it whenever possible. If we should run out of
limited GSIs, we simply flush the table and rebuild it as messages are
sent.

This approach is rather simple and could be optimized further. However,
latest kernels contains a more efficient MSI injection interface that
will obsolete the GSI-based dynamic injection.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
kvm-all.c
kvm.h