From: Tim Deegan <Tim.Deegan@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Allen Kay <allen.m.kay@intel.com>, keir@xen.org
Subject: [PATCH] [RFC] VT-d: always clean up dpci timers.
Date: Mon, 18 Jul 2011 17:38:48 +0100 [thread overview]
Message-ID: <20110718163848.GD18276@whitby.uk.xensource.com> (raw)
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) [<ffff82c480126256>] set_timer+0x1c2/0x24f
(XEN) [<ffff82c48011fbf8>] schedule+0x129/0x5dd
(XEN) [<ffff82c480122c1e>] __do_softirq+0x7e/0x89
(XEN) [<ffff82c480122c9d>] do_softirq+0x26/0x28
(XEN) [<ffff82c480153c85>] 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).
Although it fixes the crash for me, I'm sufficiently confused by this
code that I don't know whether it's enough. If the dpci timer state
gets freed earlier than pci_clean_dpci_irqs() then there's still a race,
and some other function (reassign_device_ownership() ?) needs to sort
out the timers when the PCI card is deassigned.
Allen, can you comment?
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
diff -r ab6551e30841 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c Mon Jul 18 10:59:44 2011 +0100
+++ b/xen/drivers/passthrough/pci.c Mon Jul 18 17:22:48 2011 +0100
@@ -269,7 +269,7 @@ static void pci_clean_dpci_irqs(struct d
if ( !iommu_enabled )
return;
- if ( !is_hvm_domain(d) || !need_iommu(d) )
+ if ( !is_hvm_domain(d) )
return;
spin_lock(&d->event_lock);
next reply other threads:[~2011-07-18 16:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 16:38 Tim Deegan [this message]
2011-07-21 1:08 ` [PATCH] [RFC] VT-d: always clean up dpci timers Kay, Allen M
2011-07-21 8:50 ` Tim Deegan
2011-07-21 9:01 ` Keir Fraser
2011-07-25 14:21 ` Tim Deegan
2011-07-25 14:47 ` Keir Fraser
2011-07-25 15:04 ` Tim Deegan
2011-07-22 7:33 ` Kay, Allen M
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110718163848.GD18276@whitby.uk.xensource.com \
--to=tim.deegan@citrix.com \
--cc=allen.m.kay@intel.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.