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: NJan Kiszka <jan.kiszka@siemens.com> Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
Showing
想要评论请 注册 或 登录