iommu: iommu-debug: Remove CONFIG_IOMMU_DEBUG_TRACKING

Remove this interface in preparation for a more modern replacement.

Change-Id: I84e6827167be54366bb78c6389131119ca6ccd33
Signed-off-by: Patrick Daly <[email protected]>
[[email protected]: resolved trivial merge conflicts]
Signed-off-by: Isaac J. Manjarres <[email protected]>
This commit is contained in:
Patrick Daly 2020-01-20 15:39:43 -08:00 • committed by Isaac J. Manjarres
commit 209228f315
4 changed files with 3 additions and 110 deletions

View file

@ -562,26 +562,14 @@ menuconfig IOMMU_DEBUG
if IOMMU_DEBUG
config IOMMU_DEBUG_TRACKING
bool "Track key IOMMU events"
select IOMMU_API
help
Enables additional debug tracking in the IOMMU framework code.
Tracking information and tests can be accessed through various
debugfs files.
Say Y here if you need to debug IOMMU issues and are okay with
the performance penalty of the tracking.
config IOMMU_TESTS
bool "Interactive IOMMU performance/functional tests"
select IOMMU_API
select ARM64_PTDUMP_CORE
help
Enables a suite of IOMMU unit tests. The tests are runnable
through debugfs. Unlike the IOMMU_DEBUG_TRACKING option, the
impact of enabling this option to overal system performance
should be minimal.
through debugfs. The impact of enabling this option to overall
system performance should be minimal.
endif # IOMMU_DEBUG

View file

@ -32,7 +32,6 @@
#include <linux/dma-mapping.h>
#include <asm/cacheflush.h>
#include <linux/dma-mapping-fast.h>
#include "iommu-debug.h"
#ifdef CONFIG_ARM64_PTDUMP_CORE
#include <asm/ptdump.h>
@ -91,68 +90,6 @@ static const char *iommu_debug_attr_to_string(enum iommu_attr attr)
}
#endif
#ifdef CONFIG_IOMMU_DEBUG_TRACKING
static DEFINE_MUTEX(iommu_debug_attachments_lock);
static LIST_HEAD(iommu_debug_attachments);
/*
* Each group may have more than one domain; but each domain may
* only have one group.
* Used by debug tools to display the name of the device(s) associated
* with a particular domain.
*/
struct iommu_debug_attachment {
struct iommu_domain *domain;
struct iommu_group *group;
struct list_head list;
};
void iommu_debug_attach_device(struct iommu_domain *domain,
struct device *dev)
{
struct iommu_debug_attachment *attach;
struct iommu_group *group;
group = dev->iommu_group;
if (!group)
return;
mutex_lock(&iommu_debug_attachments_lock);
list_for_each_entry(attach, &iommu_debug_attachments, list)
if ((attach->domain == domain) && (attach->group == group))
goto out;
attach = kzalloc(sizeof(*attach), GFP_KERNEL);
if (!attach)
goto out;
attach->domain = domain;
attach->group = group;
INIT_LIST_HEAD(&attach->list);
list_add(&attach->list, &iommu_debug_attachments);
out:
mutex_unlock(&iommu_debug_attachments_lock);
}
void iommu_debug_domain_remove(struct iommu_domain *domain)
{
struct iommu_debug_attachment *it, *tmp;
mutex_lock(&iommu_debug_attachments_lock);
list_for_each_entry_safe(it, tmp, &iommu_debug_attachments, list) {
if (it->domain != domain)
continue;
list_del(&it->list);
kfree(it);
}
mutex_unlock(&iommu_debug_attachments_lock);
}
#endif
#ifdef CONFIG_IOMMU_TESTS
#ifdef CONFIG_64BIT

View file

@ -1,27 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
*/
#ifndef IOMMU_DEBUG_H
#define IOMMU_DEBUG_H
#ifdef CONFIG_IOMMU_DEBUG_TRACKING
void iommu_debug_attach_device(struct iommu_domain *domain, struct device *dev);
void iommu_debug_domain_remove(struct iommu_domain *domain);
#else /* !CONFIG_IOMMU_DEBUG_TRACKING */
static inline void iommu_debug_attach_device(struct iommu_domain *domain,
struct device *dev)
{
}
static inline void iommu_debug_domain_remove(struct iommu_domain *domain)
{
}
#endif /* CONFIG_IOMMU_DEBUG_TRACKING */
#endif /* IOMMU_DEBUG_H */

View file

@ -26,8 +26,6 @@
#include <linux/module.h>
#include <trace/events/iommu.h>
#include "iommu-debug.h"
static struct kset *iommu_group_kset;
static DEFINE_IDA(iommu_group_ida);
@ -1646,7 +1644,6 @@ EXPORT_SYMBOL_GPL(iommu_domain_alloc);
void iommu_domain_free(struct iommu_domain *domain)
{
iommu_debug_domain_remove(domain);
domain->ops->domain_free(domain);
}
EXPORT_SYMBOL_GPL(iommu_domain_free);
@ -1663,10 +1660,8 @@ static int __iommu_attach_device(struct iommu_domain *domain,
return -ENODEV;
ret = domain->ops->attach_dev(domain, dev);
if (!ret) {
if (!ret)
trace_attach_device_to_domain(dev);
iommu_debug_attach_device(domain, dev);
}
return ret;
}