From: Tim Deegan Date: Tue, 16 Aug 2011 14:27:06 +0000 (+0100) Subject: VT-d: always clean up dpci timers. X-Git-Tag: 4.0.3-rc1~1 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bdccfa0e13f4f9abdb6db639e25aedd4b1f1f37e;p=xen.git VT-d: always clean up dpci timers. If a VM has all its PCI devices deassigned, need_iommu(d) becomes false but it might still have DPCI EOI timers that were init_timer()d but not yet kill_timer()d. That causes xen to crash later because the linked list of inactive timers gets corrupted, e.g.: (XEN) Xen call trace: (XEN) [] set_timer+0x1c2/0x24f (XEN) [] schedule+0x129/0x5dd (XEN) [] __do_softirq+0x7e/0x89 (XEN) [] do_softirq+0x26/0x28 (XEN) [] idle_loop+0x5a/0x5c (XEN) (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Assertion 'entry->next->prev == entry' failed at /local/scratch/tdeegan/xen-unstable.hg/xen/include:172 (XEN) **************************************** The following patch makes sure that the domain destruction path always clears up the DPCI state even if !needs_iommu(d). Signed-off-by: Tim Deegan xen-unstable changeset: 23746:aa54b8175954 xen-unstable date: Mon Jul 25 16:41:33 2011 +0100 --- diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 86f680d6a1..280309427b 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -249,9 +249,6 @@ static void pci_clean_dpci_irqs(struct domain *d) if ( !iommu_enabled ) return; - if ( !need_iommu(d) ) - return; - spin_lock(&d->event_lock); hvm_irq_dpci = domain_get_irq_dpci(d); if ( hvm_irq_dpci != NULL )