Skip to content

Commit

Permalink
x86/amd-iommu: Make sure a device is assigned in passthrough mode
Browse files Browse the repository at this point in the history
When the IOMMU driver runs in passthrough mode it has to
make sure that every device not assigned to an IOMMU-API
domain must be put into the passthrough domain instead of
keeping it unassigned.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
  • Loading branch information
Joerg Roedel committed Sep 3, 2009
1 parent eba6ac6 commit 21129f7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions arch/x86/kernel/amd_iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1141,6 +1141,15 @@ static void __detach_device(struct protection_domain *domain, u16 devid)

/* ready */
spin_unlock(&domain->lock);

/*
* If we run in passthrough mode the device must be assigned to the
* passthrough domain if it is detached from any other domain
*/
if (iommu_pass_through) {
struct amd_iommu *iommu = amd_iommu_rlookup_table[devid];
__attach_device(iommu, pt_domain, devid);
}
}

/*
Expand Down

0 comments on commit 21129f7

Please sign in to comment.