diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-07-21 09:45:19 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-08-12 10:23:34 -0400 |
commit | af1089ce388b2d14c8331b96567b7e3b7eb5f35b (patch) | |
tree | fde72475958063eba44e960fa72c7b97d4e5dccf /drivers/iommu | |
parent | 0dc7971594aad73b50722878ea7175055a4fdfcd (diff) |
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>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/intel-iommu.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 2a64c3fe49db..91f0c3d5a6ac 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -374,7 +374,6 @@ static int hw_pass_through = 1; | |||
374 | #define DOMAIN_FLAG_STATIC_IDENTITY (1 << 1) | 374 | #define DOMAIN_FLAG_STATIC_IDENTITY (1 << 1) |
375 | 375 | ||
376 | struct dmar_domain { | 376 | struct dmar_domain { |
377 | int id; /* domain id */ | ||
378 | int nid; /* node id */ | 377 | int nid; /* node id */ |
379 | DECLARE_BITMAP(iommu_bmp, DMAR_UNITS_SUPPORTED); | 378 | DECLARE_BITMAP(iommu_bmp, DMAR_UNITS_SUPPORTED); |
380 | /* bitmap of iommus this domain uses*/ | 379 | /* bitmap of iommus this domain uses*/ |
@@ -1655,8 +1654,6 @@ static void free_dmar_iommu(struct intel_iommu *iommu) | |||
1655 | 1654 | ||
1656 | static struct dmar_domain *alloc_domain(int flags) | 1655 | static struct dmar_domain *alloc_domain(int flags) |
1657 | { | 1656 | { |
1658 | /* domain id for virtual machine, it won't be set in context */ | ||
1659 | static atomic_t vm_domid = ATOMIC_INIT(0); | ||
1660 | struct dmar_domain *domain; | 1657 | struct dmar_domain *domain; |
1661 | 1658 | ||
1662 | domain = alloc_domain_mem(); | 1659 | domain = alloc_domain_mem(); |
@@ -1668,8 +1665,6 @@ static struct dmar_domain *alloc_domain(int flags) | |||
1668 | domain->flags = flags; | 1665 | domain->flags = flags; |
1669 | spin_lock_init(&domain->iommu_lock); | 1666 | spin_lock_init(&domain->iommu_lock); |
1670 | INIT_LIST_HEAD(&domain->devices); | 1667 | INIT_LIST_HEAD(&domain->devices); |
1671 | if (flags & DOMAIN_FLAG_VIRTUAL_MACHINE) | ||
1672 | domain->id = atomic_inc_return(&vm_domid); | ||
1673 | 1668 | ||
1674 | return domain; | 1669 | return domain; |
1675 | } | 1670 | } |
@@ -2392,8 +2387,7 @@ static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw) | |||
2392 | domain = alloc_domain(0); | 2387 | domain = alloc_domain(0); |
2393 | if (!domain) | 2388 | if (!domain) |
2394 | return NULL; | 2389 | return NULL; |
2395 | domain->id = iommu_attach_domain(domain, iommu); | 2390 | if (iommu_attach_domain(domain, iommu) < 0) { |
2396 | if (domain->id < 0) { | ||
2397 | free_domain_mem(domain); | 2391 | free_domain_mem(domain); |
2398 | return NULL; | 2392 | return NULL; |
2399 | } | 2393 | } |
@@ -2446,8 +2440,7 @@ static int iommu_domain_identity_map(struct dmar_domain *domain, | |||
2446 | return -ENOMEM; | 2440 | return -ENOMEM; |
2447 | } | 2441 | } |
2448 | 2442 | ||
2449 | pr_debug("Mapping reserved region %llx-%llx for domain %d\n", | 2443 | pr_debug("Mapping reserved region %llx-%llx\n", start, end); |
2450 | start, end, domain->id); | ||
2451 | /* | 2444 | /* |
2452 | * RMRR range might have overlap with physical memory range, | 2445 | * RMRR range might have overlap with physical memory range, |
2453 | * clear it first | 2446 | * clear it first |