Skip to content

Commit

Permalink
iommu/vt-d: Cleanup after delegating DMA domain to generic iommu
Browse files Browse the repository at this point in the history
[No functional changes]

1. Starting with commit df4f3c6 ("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>
  • Loading branch information
Sai Praneeth Prakhya authored and Joerg Roedel committed Jun 12, 2019
1 parent d5692d4 commit 16c9e29
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions drivers/iommu/intel-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,6 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
return pte;
}


/* return address's pte at specific level */
static struct dma_pte *dma_pfn_level_pte(struct dmar_domain *domain,
unsigned long pfn,
Expand Down Expand Up @@ -1598,7 +1597,6 @@ static void iommu_disable_translation(struct intel_iommu *iommu)
raw_spin_unlock_irqrestore(&iommu->register_lock, flag);
}


static int iommu_init_domains(struct intel_iommu *iommu)
{
u32 ndomains, nlongs;
Expand Down Expand Up @@ -1636,8 +1634,6 @@ static int iommu_init_domains(struct intel_iommu *iommu)
return -ENOMEM;
}



/*
* If Caching mode is set, then invalid translations are tagged
* with domain-id 0, hence we need to pre-allocate it. We also
Expand Down Expand Up @@ -2664,29 +2660,6 @@ static struct dmar_domain *set_domain_for_dev(struct device *dev,
return domain;
}

static struct dmar_domain *get_domain_for_dev(struct device *dev, int gaw)
{
struct dmar_domain *domain, *tmp;

domain = find_domain(dev);
if (domain)
goto out;

domain = find_or_alloc_domain(dev, gaw);
if (!domain)
goto out;

tmp = set_domain_for_dev(dev, domain);
if (!tmp || domain != tmp) {
domain_exit(domain);
domain = tmp;
}

out:

return domain;
}

static int iommu_domain_identity_map(struct dmar_domain *domain,
unsigned long long start,
unsigned long long end)
Expand Down Expand Up @@ -2751,33 +2724,6 @@ static int domain_prepare_identity_map(struct device *dev,
return iommu_domain_identity_map(domain, start, end);
}

static int iommu_prepare_identity_map(struct device *dev,
unsigned long long start,
unsigned long long end)
{
struct dmar_domain *domain;
int ret;

domain = get_domain_for_dev(dev, DEFAULT_DOMAIN_ADDRESS_WIDTH);
if (!domain)
return -ENOMEM;

ret = domain_prepare_identity_map(dev, domain, start, end);
if (ret)
domain_exit(domain);

return ret;
}

static inline int iommu_prepare_rmrr_dev(struct dmar_rmrr_unit *rmrr,
struct device *dev)
{
if (dev->archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO)
return 0;
return iommu_prepare_identity_map(dev, rmrr->base_address,
rmrr->end_address);
}

static int md_domain_init(struct dmar_domain *domain, int guest_width);

static int __init si_domain_init(int hw)
Expand Down Expand Up @@ -4094,7 +4040,6 @@ static void __init init_iommu_pm_ops(void)
static inline void init_iommu_pm_ops(void) {}
#endif /* CONFIG_PM */


int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg)
{
struct acpi_dmar_reserved_memory *rmrr;
Expand Down

0 comments on commit 16c9e29

Please sign in to comment.