Re: [PATCH] kvm: fix irq route entries exceed gsi count 1024

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 16/06/2016 03:45, Wei Tang wrote:
> Create a new msi route entry needs 3 steps:
> 1) find out an unused gsi number from the gsi bitmap, and flush the msi route entries if the counter of used irq route entries equals global gsi count 1024 in function kvm_irqchip_get_virq.
> 2) add the new msi route entry and increase the counter of used irq route entries in function kvm_add_routing_entry.
> 3) commit the new msi route entry to kvm module in function kvm_irqchip_commit_routes. Especially, the kvm module will check the counter of used irq route entries again here. If the counter exceeds KVM_MAX_IRQ_ROUTES, which is same as the global gsi count 1024, will trigger assertion failure.
> 
> This procedure has some problem in one corner case.
> For example, if the current counter of used irq route entries is 1023, and want to create a new msi route entry, will succeed finding an unused gsi number without flushing the msi route entries in step 1). However, an assertion failure will pop up in step 3), because the counter of used irq route entries is increased in step 2) and now is 1024.

Isn't this the same bug as the kernel patch that Xiubo sent yesterday?

Thanks,

Paolo

> This patch fix this BUG by flushing the msi route entries when try to get the last irq route entry.
> 
> Signed-off-by: Wei Tang <tangwei@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Xiubo Li <lixiubo@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Zhuoyu Zhang <zhangzhuoyu@xxxxxxxxxxxxxxxxxxxx>
> ---
>  kvm-all.c | 2 +-
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux