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

Commit d3ad9373 authored by Joerg Roedel's avatar Joerg Roedel
Browse files

x86/amd-iommu: Fix deassignment of a device from the pt_domain



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