Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1afc736f authored by Patrick Daly's avatar Patrick Daly
Browse files

iommu: iommu-debug: Remove CONFIG_IOMMU_DEBUG_TRACKING



Remove this interface in preparation for a more modern replacement.

Change-Id: I84e6827167be54366bb78c6389131119ca6ccd33
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent df92ab00
Loading
Loading
Loading
Loading
+2 −14
Original line number Diff line number Diff line
@@ -495,26 +495,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

+1 −63
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -86,68 +86,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

drivers/iommu/iommu-debug.h

deleted100644 → 0
+0 −27
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2015-2018, 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 */
+0 −4
Original line number Diff line number Diff line
@@ -35,8 +35,6 @@
#include <linux/property.h>
#include <trace/events/iommu.h>

#include "iommu-debug.h"

static struct kset *iommu_group_kset;
static DEFINE_IDA(iommu_group_ida);
#ifdef CONFIG_IOMMU_DEFAULT_PASSTHROUGH
@@ -1320,7 +1318,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);
@@ -1339,7 +1336,6 @@ static int __iommu_attach_device(struct iommu_domain *domain,
	ret = domain->ops->attach_dev(domain, dev);
	if (!ret) {
		trace_attach_device_to_domain(dev);
		iommu_debug_attach_device(domain, dev);

		if (!strnlen(domain->name, IOMMU_DOMAIN_NAME_LEN)) {
			strlcpy(domain->name, dev_name(dev),