iommu/vt-d: Kill dmar_domain->id

This field is now obsolete because all places use the
per-iommu domain-ids. Kill the remaining uses of this field
and remove it.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
This commit is contained in:
Joerg Roedel 2015-07-21 15:45:19 +02:00
parent 0dc7971594
commit af1089ce38

View file

@ -374,7 +374,6 @@ static int hw_pass_through = 1;
#define DOMAIN_FLAG_STATIC_IDENTITY (1 << 1) #define DOMAIN_FLAG_STATIC_IDENTITY (1 << 1)
struct dmar_domain { struct dmar_domain {
int id; /* domain id */
int nid; /* node id */ int nid; /* node id */
DECLARE_BITMAP(iommu_bmp, DMAR_UNITS_SUPPORTED); DECLARE_BITMAP(iommu_bmp, DMAR_UNITS_SUPPORTED);
/* bitmap of iommus this domain uses*/ /* bitmap of iommus this domain uses*/
@ -1655,8 +1654,6 @@ static void free_dmar_iommu(struct intel_iommu *iommu)
static struct dmar_domain *alloc_domain(int flags) static struct dmar_domain *alloc_domain(int flags)
{ {
/* domain id for virtual machine, it won't be set in context */
static atomic_t vm_domid = ATOMIC_INIT(0);
struct dmar_domain *domain; struct dmar_domain *domain;
domain = alloc_domain_mem(); domain = alloc_domain_mem();
@ -1668,8 +1665,6 @@ static struct dmar_domain *alloc_domain(int flags)
domain->flags = flags; domain->flags = flags;
spin_lock_init(&domain->iommu_lock); spin_lock_init(&domain->iommu_lock);
INIT_LIST_HEAD(&domain->devices); INIT_LIST_HEAD(&domain->devices);
if (flags & DOMAIN_FLAG_VIRTUAL_MACHINE)
domain->id = atomic_inc_return(&vm_domid);
return domain; return domain;
} }
@ -2392,8 +2387,7 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
domain = alloc_domain(0); domain = alloc_domain(0);
if (!domain) if (!domain)
return NULL; return NULL;
domain->id = iommu_attach_domain(domain, iommu); if (iommu_attach_domain(domain, iommu) < 0) {
if (domain->id < 0) {
free_domain_mem(domain); free_domain_mem(domain);
return NULL; return NULL;
} }
@ -2446,8 +2440,7 @@ static int iommu_domain_identity_map(struct dmar_domain *domain,
return -ENOMEM; return -ENOMEM;
} }
pr_debug("Mapping reserved region %llx-%llx for domain %d\n", pr_debug("Mapping reserved region %llx-%llx\n", start, end);
start, end, domain->id);
/* /*
* RMRR range might have overlap with physical memory range, * RMRR range might have overlap with physical memory range,
* clear it first * clear it first