From 241d5a684ea9affa15e60848c6557a45d9fb49ba Mon Sep 17 00:00:00 2001 From: Minggui Cao Date: Thu, 18 Oct 2018 15:15:43 +0800 Subject: [PATCH] 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 Acked-by: Anthony Xu --- hypervisor/common/ptdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hypervisor/common/ptdev.c b/hypervisor/common/ptdev.c index c0e33c4c2..4c58c622c 100644 --- a/hypervisor/common/ptdev.c +++ b/hypervisor/common/ptdev.c @@ -65,6 +65,7 @@ ptdev_dequeue_softirq(struct vm *vm) } else { /* add it into timer list; dequeue next one */ (void)add_timer(&entry->intr_delay_timer); + entry = NULL; } } @@ -187,6 +188,7 @@ ptdev_deactivate_entry(struct ptdev_remapping_info *entry) /* remove from softirq list if added */ spinlock_irqsave_obtain(&entry->vm->softirq_dev_lock, &rflags); list_del_init(&entry->softirq_node); + del_timer(&entry->intr_delay_timer); spinlock_irqrestore_release(&entry->vm->softirq_dev_lock, rflags); }