> > int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level);
> >+int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm,
> >+ int irq_source_id, int level);
>
> No point in the level argument for an msi specific function.
This is an existing function I made non-static.
We have per-gsi callbacks so level is required there to match.
I could add a wrapper I guess:
int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm,
int irq_source_id, int level)
{
if (!level)
return -1;
return kvm_send_msi(irq_entry, kvm, irq_source_id);
}
This results in less code for irqfd but more code for ioctl injection
... is it worth it?
>
> Apart from these minor issues, looks good.
Something we should consider improving is the loop over all VCPUs that
kvm_irq_delivery_to_apic invokes. I think that (for non-broadcast
interrupts) it should be possible to precompute an store the CPU
in question as part of the routing entry.
Something for a separate patch ... comments?