From: Keir Fraser Date: Mon, 28 Jun 2010 15:45:19 +0000 (+0100) Subject: vtd: Only kill_timer() an init_timer()'ed timer. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11868^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c3efc4ecb7970a25e351770cabd4e92e13befca9;p=xen.git vtd: Only kill_timer() an init_timer()'ed timer. Signed-off-by: Keir Fraser --- diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 8e14af75a2..e7a6eb01de 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -28,7 +28,7 @@ static void hvm_dirq_assist(unsigned long _d); -static int pt_irq_need_timer(uint32_t flags) +bool_t pt_irq_need_timer(uint32_t flags) { return !(flags & (HVM_IRQ_DPCI_GUEST_MSI | HVM_IRQ_DPCI_TRANSLATE)); } diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index bd8da7fe1a..d6d833142b 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -260,7 +260,9 @@ static void pci_clean_dpci_irqs(struct domain *d) i = find_next_bit(hvm_irq_dpci->mapping, d->nr_pirqs, i + 1) ) { pirq_guest_unbind(d, i); - kill_timer(&hvm_irq_dpci->hvm_timer[domain_pirq_to_irq(d, i)]); + + if ( pt_irq_need_timer(hvm_irq_dpci->mirq[i].flags) ) + kill_timer(&hvm_irq_dpci->hvm_timer[domain_pirq_to_irq(d, i)]); list_for_each_safe ( digl_list, tmp, &hvm_irq_dpci->mirq[i].digl_list ) diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 5181ffc5be..49f9a34eda 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -100,6 +100,7 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq); struct hvm_irq_dpci *domain_get_irq_dpci(struct domain *domain); int domain_set_irq_dpci(struct domain *domain, struct hvm_irq_dpci *dpci); void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci); +bool_t pt_irq_need_timer(uint32_t flags); #define PT_IRQ_TIME_OUT MILLISECS(8) #define VTDPREFIX "[VT-D]"