Skip to content

Commit

Permalink
x86/amd-iommu: Fix deassignment of a device from the pt_domain
Browse files Browse the repository at this point in the history
Deassigning a device from the passthrough domain does not
work and breaks device assignment to kvm guests. This patch
fixes the issue.

Cc: stable@kernel.org
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
  • Loading branch information
Joerg Roedel committed Jan 22, 2010
1 parent f532509 commit d3ad937
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1511,9 +1511,11 @@ static void __detach_device(struct device *dev)

/*
* If we run in passthrough mode the device must be assigned to the
* passthrough domain if it is detached from any other domain
* passthrough domain if it is detached from any other domain.
* Make sure we can deassign from the pt_domain itself.
*/
if (iommu_pass_through && dev_data->domain == NULL)
if (iommu_pass_through &&
(dev_data->domain == NULL && domain != pt_domain))
__attach_device(dev, pt_domain);
}

Expand Down

0 comments on commit d3ad937

Please sign in to comment.