summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/intel-iommu.c
diff options
context:
space:
mode:
authorSai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>2019-06-11 20:28:50 -0400
committerJoerg Roedel <jroedel@suse.de>2019-06-12 04:36:59 -0400
commit16c9e29e12e8edbdf437001f46cf3f557aca80e8 (patch)
tree328574b994ee4a7718c1806e78a162559f5a632a /drivers/iommu/intel-iommu.c
parentd5692d4af08cde48ee98968aeb62077e2f6c50d5 (diff)
iommu/vt-d: Cleanup after delegating DMA domain to generic iommu
[No functional changes] 1. Starting with commit df4f3c603aeb ("iommu/vt-d: Remove static identity map code") there are no callers for iommu_prepare_rmrr_dev() but the implementation of the function still exists, so remove it. Also, as a ripple effect remove get_domain_for_dev() and iommu_prepare_identity_map() because they aren't being used either. 2. Remove extra new line in couple of places. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/intel-iommu.c')
-rw-r--r--drivers/iommu/intel-iommu.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 9761ac366e3f..8c6ed39dec01 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -929,7 +929,6 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
929 return pte; 929 return pte;
930} 930}
931 931
932
933/* return address's pte at specific level */ 932/* return address's pte at specific level */
934static struct dma_pte *dma_pfn_level_pte(struct dmar_domain *domain, 933static struct dma_pte *dma_pfn_level_pte(struct dmar_domain *domain,
935 unsigned long pfn, 934 unsigned long pfn,
@@ -1598,7 +1597,6 @@ static void iommu_disable_translation(struct intel_iommu *iommu)
1598 raw_spin_unlock_irqrestore(&iommu->register_lock, flag); 1597 raw_spin_unlock_irqrestore(&iommu->register_lock, flag);
1599} 1598}
1600 1599
1601
1602static int iommu_init_domains(struct intel_iommu *iommu) 1600static int iommu_init_domains(struct intel_iommu *iommu)
1603{ 1601{
1604 u32 ndomains, nlongs; 1602 u32 ndomains, nlongs;
@@ -1636,8 +1634,6 @@ static int iommu_init_domains(struct intel_iommu *iommu)
1636 return -ENOMEM; 1634 return -ENOMEM;
1637 } 1635 }
1638 1636
1639
1640
1641 /* 1637 /*
1642 * If Caching mode is set, then invalid translations are tagged 1638 * If Caching mode is set, then invalid translations are tagged
1643 * with domain-id 0, hence we need to pre-allocate it. We also 1639 * with domain-id 0, hence we need to pre-allocate it. We also
@@ -2664,29 +2660,6 @@ static struct dmar_domain *set_domain_for_dev(struct device *dev,
2664 return domain; 2660 return domain;
2665} 2661}
2666 2662
2667static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
2668{
2669 struct dmar_domain *domain, *tmp;
2670
2671 domain = find_domain(dev);
2672 if (domain)
2673 goto out;
2674
2675 domain = find_or_alloc_domain(dev, gaw);
2676 if (!domain)
2677 goto out;
2678
2679 tmp = set_domain_for_dev(dev, domain);
2680 if (!tmp || domain != tmp) {
2681 domain_exit(domain);
2682 domain = tmp;
2683 }
2684
2685out:
2686
2687 return domain;
2688}
2689
2690static int iommu_domain_identity_map(struct dmar_domain *domain, 2663static int iommu_domain_identity_map(struct dmar_domain *domain,
2691 unsigned long long start, 2664 unsigned long long start,
2692 unsigned long long end) 2665 unsigned long long end)
@@ -2751,33 +2724,6 @@ static int domain_prepare_identity_map(struct device *dev,
2751 return iommu_domain_identity_map(domain, start, end); 2724 return iommu_domain_identity_map(domain, start, end);
2752} 2725}
2753 2726
2754static int iommu_prepare_identity_map(struct device *dev,
2755 unsigned long long start,
2756 unsigned long long end)
2757{
2758 struct dmar_domain *domain;
2759 int ret;
2760
2761 domain = get_domain_for_dev(dev, DEFAULT_DOMAIN_ADDRESS_WIDTH);
2762 if (!domain)
2763 return -ENOMEM;
2764
2765 ret = domain_prepare_identity_map(dev, domain, start, end);
2766 if (ret)
2767 domain_exit(domain);
2768
2769 return ret;
2770}
2771
2772static inline int iommu_prepare_rmrr_dev(struct dmar_rmrr_unit *rmrr,
2773 struct device *dev)
2774{
2775 if (dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO)
2776 return 0;
2777 return iommu_prepare_identity_map(dev, rmrr->base_address,
2778 rmrr->end_address);
2779}
2780
2781static int md_domain_init(struct dmar_domain *domain, int guest_width); 2727static int md_domain_init(struct dmar_domain *domain, int guest_width);
2782 2728
2783static int __init si_domain_init(int hw) 2729static int __init si_domain_init(int hw)
@@ -4094,7 +4040,6 @@ static void __init init_iommu_pm_ops(void)
4094static inline void init_iommu_pm_ops(void) {} 4040static inline void init_iommu_pm_ops(void) {}
4095#endif /* CONFIG_PM */ 4041#endif /* CONFIG_PM */
4096 4042
4097
4098int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) 4043int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
4099{ 4044{
4100 struct acpi_dmar_reserved_memory *rmrr; 4045 struct acpi_dmar_reserved_memory *rmrr;