aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/p2m.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/xen/p2m.c')
-rw-r--r--arch/x86/xen/p2m.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 58efeb9d5440..cc2f8dcf8dda 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -782,8 +782,9 @@ unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn)
782EXPORT_SYMBOL_GPL(m2p_find_override_pfn); 782EXPORT_SYMBOL_GPL(m2p_find_override_pfn);
783 783
784#ifdef CONFIG_XEN_DEBUG_FS 784#ifdef CONFIG_XEN_DEBUG_FS
785 785#include <linux/debugfs.h>
786int p2m_dump_show(struct seq_file *m, void *v) 786#include "debugfs.h"
787static int p2m_dump_show(struct seq_file *m, void *v)
787{ 788{
788 static const char * const level_name[] = { "top", "middle", 789 static const char * const level_name[] = { "top", "middle",
789 "entry", "abnormal" }; 790 "entry", "abnormal" };
@@ -856,4 +857,32 @@ int p2m_dump_show(struct seq_file *m, void *v)
856#undef TYPE_PFN 857#undef TYPE_PFN
857#undef TYPE_UNKNOWN 858#undef TYPE_UNKNOWN
858} 859}
859#endif 860
861static int p2m_dump_open(struct inode *inode, struct file *filp)
862{
863 return single_open(filp, p2m_dump_show, NULL);
864}
865
866static const struct file_operations p2m_dump_fops = {
867 .open = p2m_dump_open,
868 .read = seq_read,
869 .llseek = seq_lseek,
870 .release = single_release,
871};
872
873static struct dentry *d_mmu_debug;
874
875static int __init xen_p2m_debugfs(void)
876{
877 struct dentry *d_xen = xen_init_debugfs();
878
879 if (d_xen == NULL)
880 return -ENOMEM;
881
882 d_mmu_debug = debugfs_create_dir("mmu", d_xen);
883
884 debugfs_create_file("p2m", 0600, d_mmu_debug, NULL, &p2m_dump_fops);
885 return 0;
886}
887fs_initcall(xen_p2m_debugfs);
888#endif /* CONFIG_XEN_DEBUG_FS */