1 // SPDX-License-Identifier: GPL-2.0
3 * IOMMU debugfs core infrastructure
5 * Copyright (C) 2018 Advanced Micro Devices, Inc.
7 * Author: Gary R Hook <gary.hook@amd.com>
10 #include <linux/pci.h>
11 #include <linux/iommu.h>
12 #include <linux/debugfs.h>
14 struct dentry *iommu_debugfs_dir;
15 EXPORT_SYMBOL_GPL(iommu_debugfs_dir);
18 * iommu_debugfs_setup - create the top-level iommu directory in debugfs
20 * Provide base enablement for using debugfs to expose internal data of an
21 * IOMMU driver. When called, this function creates the
22 * /sys/kernel/debug/iommu directory.
24 * Emit a strong warning at boot time to indicate that this feature is
27 * This function is called from iommu_init; drivers may then use
28 * iommu_debugfs_dir to instantiate a vendor-specific directory to be used
29 * to expose internal data.
31 void iommu_debugfs_setup(void)
33 if (!iommu_debugfs_dir) {
34 iommu_debugfs_dir = debugfs_create_dir("iommu", NULL);
36 pr_warn("*************************************************************\n");
37 pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n");
39 pr_warn("** IOMMU DebugFS SUPPORT HAS BEEN ENABLED IN THIS KERNEL **\n");
41 pr_warn("** This means that this kernel is built to expose internal **\n");
42 pr_warn("** IOMMU data structures, which may compromise security on **\n");
43 pr_warn("** your system. **\n");
45 pr_warn("** If you see this message and you are not debugging the **\n");
46 pr_warn("** kernel, report this immediately to your vendor! **\n");
48 pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n");
49 pr_warn("*************************************************************\n");