From 95bfc52b89b69568c38d7cac8dc85db7b8fa3501 Mon Sep 17 00:00:00 2001 From: Weidong Han Date: Mon, 8 Dec 2008 16:35:39 +0800 Subject: [PATCH] --- yaml --- r: 125575 b: refs/heads/master c: 1ce28feb22833645a0f3843cd873a0b56ed19ef0 h: refs/heads/master i: 125573: e7788fd90e78522757ea10930271031e22e819b2 125571: 98286a95ac5b60d10d45260c1afcb085e33b3318 125567: 01a407c11eefd5f691d84cdce6780a96a959736e v: v3 --- [refs] | 2 +- trunk/drivers/pci/intel-iommu.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ed5612dc38c9..aec0e9b2c9cb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8e604097ddc483eb1e6e99564953e4e937fe439a +refs/heads/master: 1ce28feb22833645a0f3843cd873a0b56ed19ef0 diff --git a/trunk/drivers/pci/intel-iommu.c b/trunk/drivers/pci/intel-iommu.c index 104e99df2ade..ffbe4c573729 100644 --- a/trunk/drivers/pci/intel-iommu.c +++ b/trunk/drivers/pci/intel-iommu.c @@ -206,6 +206,11 @@ static inline bool dma_pte_present(struct dma_pte *pte) /* devices under the same p2p bridge are owned in one domain */ #define DOMAIN_FLAG_P2P_MULTIPLE_DEVICES (1 < 0) +/* domain represents a virtual machine, more than one devices + * across iommus may be owned in one domain, e.g. kvm guest. + */ +#define DOMAIN_FLAG_VIRTUAL_MACHINE (1 << 1) + struct dmar_domain { int id; /* domain id */ unsigned long iommu_bmp; /* bitmap of iommus this domain uses*/ @@ -391,6 +396,8 @@ static struct intel_iommu *domain_get_iommu(struct dmar_domain *domain) { int iommu_id; + BUG_ON(domain->flags & DOMAIN_FLAG_VIRTUAL_MACHINE); + iommu_id = find_first_bit(&domain->iommu_bmp, g_num_of_iommus); if (iommu_id < 0 || iommu_id >= g_num_of_iommus) return NULL;