Skip to content

Commit 965f8d1

Browse files
Wei LiuNanlinXie
authored andcommitted
hv: fix irq leak for MSI IRQ
Current free_irq sequence will release vector first, then use the released vector to free irq number.It will cause irq leak for MSI IRQ. At present, there is no one to free the irqs which in irq_static_mappings, So this patch will only make sure free non-gsi irqs. Tracked-On: #1359 Signed-off-by: Wei Liu <weix.w.liu@intel.com> Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 67ff326 commit 965f8d1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

hypervisor/arch/x86/irq.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,18 @@ uint32_t alloc_irq_num(uint32_t req_irq)
5454
}
5555

5656
/*
57+
* @pre: irq is not in irq_static_mappings
5758
* free irq num allocated via alloc_irq_num()
5859
*/
5960
void free_irq_num(uint32_t irq)
6061
{
61-
struct irq_desc *desc;
6262
uint64_t rflags;
6363

6464
if (irq >= NR_IRQS) {
6565
return;
6666
}
6767

68-
desc = &irq_desc_array[irq];
69-
if ((irq_is_gsi(irq) == false)
70-
&& (desc->vector <= VECTOR_DYNAMIC_END)) {
68+
if (irq_is_gsi(irq) == false) {
7169
spinlock_irqsave_obtain(&irq_alloc_spinlock, &rflags);
7270
bitmap_test_and_clear_nolock((uint16_t)(irq & 0x3FU),
7371
irq_alloc_bitmap + (irq >> 6U));

0 commit comments

Comments
 (0)