intel-iommu: Only unlink device domains from iommu
commit26265892ce15ab6637959631b03d25528f817e76
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 24 May 2011 16:19:04 +0000 (24 12:19 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Jun 2011 22:05:31 +0000 (23 15:05 -0700)
tree4a472347d1973dce4c025db57e787dad85bc7d10
parenta58f19eeb2ed09582f482e9ecdc6438ee6a28f0a
intel-iommu: Only unlink device domains from iommu

commit 9b4554b21ed07e8556405510638171f0c787742a upstream.

Commit a97590e5 added unlinking domains from iommus to reciprocate the
iommu from domains unlinking that was already done.  We actually want
to only do this for device domains and never for the static
identity map domain or VM domains.  The SI domain is special and
never freed, while VM domain->id lives in their own special address
space, separate from iommu->domain_ids.

In the current code, a VM can get domain->id zero, then mark that
domain unused when unbound from pci-stub.  This leads to DMAR
write faults when the device is re-bound to the host driver.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/intel-iommu.c