Skip to content

Commit 241d5a6

Browse files
mgcaowenlingz
authored andcommitted
HV: fix bug by improving intr delay timer handling
1. it need delete intr delay timer when its ptdev entry is deactivated to avoid the timer still active; 2. if the dequeued entry will be added by delay timer, it need reset current variable "entry" to find next one, or it could be returned and handled (if it is the last one) , then the entry's IRQ can come again, and it'll cause its timer added twice. Tracked-On: #1476 Signed-off-by: Minggui Cao <minggui.cao@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent 4228c81 commit 241d5a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hypervisor/common/ptdev.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ ptdev_dequeue_softirq(struct vm *vm)
6565
} else {
6666
/* add it into timer list; dequeue next one */
6767
(void)add_timer(&entry->intr_delay_timer);
68+
entry = NULL;
6869
}
6970
}
7071

@@ -187,6 +188,7 @@ ptdev_deactivate_entry(struct ptdev_remapping_info *entry)
187188
/* remove from softirq list if added */
188189
spinlock_irqsave_obtain(&entry->vm->softirq_dev_lock, &rflags);
189190
list_del_init(&entry->softirq_node);
191+
del_timer(&entry->intr_delay_timer);
190192
spinlock_irqrestore_release(&entry->vm->softirq_dev_lock, rflags);
191193
}
192194

0 commit comments

Comments
 (0)