linux/drivers/iommu/intel/debugfs.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright © 2018 Intel Corporation.
 *
 * Authors: Gayatri Kammela <[email protected]>
 *	    Sohil Mehta <[email protected]>
 *	    Jacob Pan <[email protected]>
 *	    Lu Baolu <[email protected]>
 */

#include <linux/debugfs.h>
#include <linux/dmar.h>
#include <linux/pci.h>

#include <asm/irq_remapping.h>

#include "iommu.h"
#include "pasid.h"
#include "perf.h"

struct tbl_walk {};

struct iommu_regset {};

#define DEBUG_BUFFER_SIZE
static char debug_buf[DEBUG_BUFFER_SIZE];

#define IOMMU_REGSET_ENTRY(_reg_)

static const struct iommu_regset iommu_regs_32[] =;

static const struct iommu_regset iommu_regs_64[] =;

static struct dentry *intel_iommu_debug;

static int iommu_regset_show(struct seq_file *m, void *unused)
{}
DEFINE_SHOW_ATTRIBUTE();

static inline void print_tbl_walk(struct seq_file *m)
{}

static void pasid_tbl_walk(struct seq_file *m, struct pasid_entry *tbl_entry,
			   u16 dir_idx)
{}

static void pasid_dir_walk(struct seq_file *m, u64 pasid_dir_ptr,
			   u16 pasid_dir_size)
{}

static void ctx_tbl_walk(struct seq_file *m, struct intel_iommu *iommu, u16 bus)
{}

static void root_tbl_walk(struct seq_file *m, struct intel_iommu *iommu)
{}

static int dmar_translation_struct_show(struct seq_file *m, void *unused)
{}
DEFINE_SHOW_ATTRIBUTE();

static inline unsigned long level_to_directory_size(int level)
{}

static inline void
dump_page_info(struct seq_file *m, unsigned long iova, u64 *path)
{}

static void pgtable_walk_level(struct seq_file *m, struct dma_pte *pde,
			       int level, unsigned long start,
			       u64 *path)
{}

static int domain_translation_struct_show(struct seq_file *m,
					  struct device_domain_info *info,
					  ioasid_t pasid)
{}

static int dev_domain_translation_struct_show(struct seq_file *m, void *unused)
{}
DEFINE_SHOW_ATTRIBUTE();

static int pasid_domain_translation_struct_show(struct seq_file *m, void *unused)
{}
DEFINE_SHOW_ATTRIBUTE();

static void invalidation_queue_entry_show(struct seq_file *m,
					  struct intel_iommu *iommu)
{}

static int invalidation_queue_show(struct seq_file *m, void *unused)
{}
DEFINE_SHOW_ATTRIBUTE();

#ifdef CONFIG_IRQ_REMAP
static void ir_tbl_remap_entry_show(struct seq_file *m,
				    struct intel_iommu *iommu)
{}

static void ir_tbl_posted_entry_show(struct seq_file *m,
				     struct intel_iommu *iommu)
{}

/*
 * For active IOMMUs go through the Interrupt remapping
 * table and print valid entries in a table format for
 * Remapped and Posted Interrupts.
 */
static int ir_translation_struct_show(struct seq_file *m, void *unused)
{}
DEFINE_SHOW_ATTRIBUTE();
#endif

static void latency_show_one(struct seq_file *m, struct intel_iommu *iommu,
			     struct dmar_drhd_unit *drhd)
{}

static int latency_show(struct seq_file *m, void *v)
{}

static int dmar_perf_latency_open(struct inode *inode, struct file *filp)
{}

static ssize_t dmar_perf_latency_write(struct file *filp,
				       const char __user *ubuf,
				       size_t cnt, loff_t *ppos)
{}

static const struct file_operations dmar_perf_latency_fops =;

void __init intel_iommu_debugfs_init(void)
{}

/*
 * Create a debugfs directory for each device, and then create a
 * debugfs file in this directory for users to dump the page table
 * of the default domain. e.g.
 * /sys/kernel/debug/iommu/intel/0000:00:01.0/domain_translation_struct
 */
void intel_iommu_debugfs_create_dev(struct device_domain_info *info)
{}

/* Remove the device debugfs directory. */
void intel_iommu_debugfs_remove_dev(struct device_domain_info *info)
{}

/*
 * Create a debugfs directory per pair of {device, pasid}, then create the
 * corresponding debugfs file in this directory for users to dump its page
 * table. e.g.
 * /sys/kernel/debug/iommu/intel/0000:00:01.0/1/domain_translation_struct
 *
 * The debugfs only dumps the page tables whose mappings are created and
 * destroyed by the iommu_map/unmap() interfaces. Check the mapping type
 * of the domain before creating debugfs directory.
 */
void intel_iommu_debugfs_create_dev_pasid(struct dev_pasid_info *dev_pasid)
{}

/* Remove the device pasid debugfs directory. */
void intel_iommu_debugfs_remove_dev_pasid(struct dev_pasid_info *dev_pasid)
{}