Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21129f78 authored by Joerg Roedel's avatar Joerg Roedel
Browse files

x86/amd-iommu: Make sure a device is assigned in passthrough mode



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: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent eba6ac60
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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);
	}
}

/*