public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] intel-iommu: Fix domain_ids exhaustion
@ 2011-02-16 20:39 Alex Williamson
  2011-02-16 20:39 ` [PATCH v2 1/2] intel-iommu: Unlink domain from iommu Alex Williamson
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Alex Williamson @ 2011-02-16 20:39 UTC (permalink / raw)
  To: dwmw2, iommu; +Cc: alex.williamson, linux-kernel, linux-pci, ddutile, chrisw

When we unbind a device from a driver, we don't properly unlink
the domain from the iommu, so we never free the domain id it
was using.  We're typically limited to something like 256 domain
ids, so a loop of unbinding and rebinding a device can exhaust
this pretty quickly.  If we're assigning the device to a KVM
guest, libvirt does exactly this each time the device is removed
from the host driver or added back.  When we do run out, we oops
the kernel.  Fix these.

v2:

We only want to call domain_exit() for domains automatically created
via the dma ops path.  VM and SI domains have their own life cycle
and should not be destroyed here.  With v1, if a device was unbound
from pci-stub while assigned to a VM, the kernel would oops on the
next call into iommu ops.

BTW, should we even be removing the device from the domain in the
VM domain case?  Drivers and VM domains are (unfortunately) orthogonal
concepts here with the way KVM is currently wired.  Thanks,

Alex

---

Alex Williamson (2):
      intel-iommu: Fix get_domain_for_dev() error path
      intel-iommu: Unlink domain from iommu


 drivers/pci/intel-iommu.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-02-23 19:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-16 20:39 [PATCH v2 0/2] intel-iommu: Fix domain_ids exhaustion Alex Williamson
2011-02-16 20:39 ` [PATCH v2 1/2] intel-iommu: Unlink domain from iommu Alex Williamson
2011-02-16 20:40 ` [PATCH v2 2/2] intel-iommu: Fix get_domain_for_dev() error path Alex Williamson
2011-02-17 20:13 ` [PATCH v2 0/2] intel-iommu: Fix domain_ids exhaustion Don Dutile
2011-02-18  0:38 ` Henrique de Moraes Holschuh
2011-02-23 19:32   ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox