Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125574
b: refs/heads/master
c: 8e60409
h: refs/heads/master
v: v3
  • Loading branch information
Weidong Han authored and Joerg Roedel committed Jan 3, 2009
1 parent e7788fd commit 2305d47
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b5736839ae13dadc5947940144f95dd0f4a4a8c
refs/heads/master: 8e604097ddc483eb1e6e99564953e4e937fe439a
24 changes: 24 additions & 0 deletions trunk/drivers/pci/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ struct dmar_domain {
int agaw;

int flags; /* flags to find out type of domain */

int iommu_coherency;/* indicate coherency of iommu access */
};

/* PCI domain-device relationship */
Expand Down Expand Up @@ -396,6 +398,23 @@ static struct intel_iommu *domain_get_iommu(struct dmar_domain *domain)
return g_iommus[iommu_id];
}

/* "Coherency" capability may be different across iommus */
static void domain_update_iommu_coherency(struct dmar_domain *domain)
{
int i;

domain->iommu_coherency = 1;

i = find_first_bit(&domain->iommu_bmp, g_num_of_iommus);
for (; i < g_num_of_iommus; ) {
if (!ecap_coherent(g_iommus[i]->ecap)) {
domain->iommu_coherency = 0;
break;
}
i = find_next_bit(&domain->iommu_bmp, g_num_of_iommus, i+1);
}
}

/* Gets context entry for a given bus and devfn */
static struct context_entry * device_to_context_entry(struct intel_iommu *iommu,
u8 bus, u8 devfn)
Expand Down Expand Up @@ -1346,6 +1365,11 @@ static int domain_init(struct dmar_domain *domain, int guest_width)
domain->agaw = agaw;
INIT_LIST_HEAD(&domain->devices);

if (ecap_coherent(iommu->ecap))
domain->iommu_coherency = 1;
else
domain->iommu_coherency = 0;

/* always allocate the top pgd */
domain->pgd = (struct dma_pte *)alloc_pgtable_page();
if (!domain->pgd)
Expand Down

0 comments on commit 2305d47

Please sign in to comment.