diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2012-05-16 15:41:10 -0300 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-05-16 18:04:44 -0300 |
commit | 04fa27f5ae5f025424bb7b88d3453c46e8900102 (patch) | |
tree | e54552fc9697f4035792118b122d069ef2cbc7cd /kvm.h | |
parent | 14de9bab9e4aa47215c26d87de7385afbcb37afa (diff) |
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>
Diffstat (limited to 'kvm.h')
-rw-r--r-- | kvm.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -132,6 +132,7 @@ int kvm_arch_on_sigbus(int code, void *addr); void kvm_arch_init_irq_routing(KVMState *s); int kvm_irqchip_set_irq(KVMState *s, int irq, int level); +int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg); void kvm_irqchip_add_route(KVMState *s, int gsi, int irqchip, int pin); int kvm_irqchip_commit_routes(KVMState *s); |