#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)
{ … }
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)
{ … }
void intel_iommu_debugfs_create_dev(struct device_domain_info *info)
{ … }
void intel_iommu_debugfs_remove_dev(struct device_domain_info *info)
{ … }
void intel_iommu_debugfs_create_dev_pasid(struct dev_pasid_info *dev_pasid)
{ … }
void intel_iommu_debugfs_remove_dev_pasid(struct dev_pasid_info *dev_pasid)
{ … }