]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.9/x86-amd-iommu-fix-deassignment-of-a-device-from-the-pt_domain.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.9 / x86-amd-iommu-fix-deassignment-of-a-device-from-the-pt_domain.patch
CommitLineData
c7880ca6
GKH
1From joerg.roedel@amd.com Fri Feb 12 15:12:57 2010
2From: Joerg Roedel <joerg.roedel@amd.com>
3Date: Wed, 3 Feb 2010 16:13:41 +0100
4Subject: x86/amd-iommu: Fix deassignment of a device from the pt_domain
5To: Greg KH <greg@kroah.com>
6Cc: stable@kernel.org
7Message-ID: <20100203151341.GP16236@amd.com>
8
9
10From: Joerg Roedel <joerg.roedel@amd.com>
11
12commit d3ad9373b7c29b63d5e8460a69453718d200cc3b upstream.
13
14Deassigning a device from the passthrough domain does not
15work and breaks device assignment to kvm guests. This patch
16fixes the issue.
17
18Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
19Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20
21---
22 arch/x86/kernel/amd_iommu.c | 5 +++--
23 1 file changed, 3 insertions(+), 2 deletions(-)
24
25--- a/arch/x86/kernel/amd_iommu.c
26+++ b/arch/x86/kernel/amd_iommu.c
27@@ -1230,9 +1230,10 @@ static void __detach_device(struct prote
28
29 /*
30 * If we run in passthrough mode the device must be assigned to the
31- * passthrough domain if it is detached from any other domain
32+ * passthrough domain if it is detached from any other domain.
33+ * Make sure we can deassign from the pt_domain itself.
34 */
35- if (iommu_pass_through) {
36+ if (iommu_pass_through && domain != pt_domain) {
37 struct amd_iommu *iommu = amd_iommu_rlookup_table[devid];
38 __attach_device(iommu, pt_domain, devid);
39 }