]>
Commit | Line | Data |
---|---|---|
c7880ca6 GKH |
1 | From joerg.roedel@amd.com Fri Feb 12 15:12:57 2010 |
2 | From: Joerg Roedel <joerg.roedel@amd.com> | |
3 | Date: Wed, 3 Feb 2010 16:13:41 +0100 | |
4 | Subject: x86/amd-iommu: Fix deassignment of a device from the pt_domain | |
5 | To: Greg KH <greg@kroah.com> | |
6 | Cc: stable@kernel.org | |
7 | Message-ID: <20100203151341.GP16236@amd.com> | |
8 | ||
9 | ||
10 | From: Joerg Roedel <joerg.roedel@amd.com> | |
11 | ||
12 | commit d3ad9373b7c29b63d5e8460a69453718d200cc3b upstream. | |
13 | ||
14 | Deassigning a device from the passthrough domain does not | |
15 | work and breaks device assignment to kvm guests. This patch | |
16 | fixes the issue. | |
17 | ||
18 | Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> | |
19 | Signed-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 | } |