diff options
author | Sheng Yang <sheng@linux.intel.com> | 2009-08-06 01:31:56 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-08-06 06:35:50 -0400 |
commit | c5b1525533c484238015c48c78f86d49a1bfb86b (patch) | |
tree | 631d4b89cc8c42de84230c09a997eef2e734203b /drivers/pci/intel-iommu.c | |
parent | 33041ec049d39a6e0463c7edc7b6f631d24559e3 (diff) |
intel-iommu: Fix enabling snooping feature by mistake
Two defects work together result in KVM device passthrough randomly can't
work:
1. iommu_snooping is not initialized to zero when vm_iommu_init() called.
So it is possible to get a random value.
2. One line added by commit 2c2e2c38("IOMMU Identity Mapping Support")
change the code path, let it bypass domain_update_iommu_cap(), as well as
missing the increment of domain iommu reference count.
The latter is also likely to cause a leak of domains on repeated VMM
assignment and deassignment.
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/intel-iommu.c')
-rw-r--r-- | drivers/pci/intel-iommu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index af7ff9b5aed8..2314ad7ee5fe 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -1505,7 +1505,6 @@ static int domain_context_mapping_one(struct dmar_domain *domain, int segment, | |||
1505 | } | 1505 | } |
1506 | 1506 | ||
1507 | set_bit(num, iommu->domain_ids); | 1507 | set_bit(num, iommu->domain_ids); |
1508 | set_bit(iommu->seq_id, &domain->iommu_bmp); | ||
1509 | iommu->domains[num] = domain; | 1508 | iommu->domains[num] = domain; |
1510 | id = num; | 1509 | id = num; |
1511 | } | 1510 | } |
@@ -3409,6 +3408,7 @@ static int md_domain_init(struct dmar_domain *domain, int guest_width) | |||
3409 | 3408 | ||
3410 | domain->iommu_count = 0; | 3409 | domain->iommu_count = 0; |
3411 | domain->iommu_coherency = 0; | 3410 | domain->iommu_coherency = 0; |
3411 | domain->iommu_snooping = 0; | ||
3412 | domain->max_addr = 0; | 3412 | domain->max_addr = 0; |
3413 | 3413 | ||
3414 | /* always allocate the top pgd */ | 3414 | /* always allocate the top pgd */ |