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

Commit a867db10 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk
Browse files

xen/p2m: Make debug/xen/mmu/p2m visible again.



We dropped a lot of the MMU debugfs in favour of using
tracing API - but there is one which just provides
mostly static information that was made invisible by this change.

Bring it back.

Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 10fe570f
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -53,9 +53,6 @@ extern int m2p_remove_override(struct page *page, bool clear_pte);
extern struct page *m2p_find_override(unsigned long mfn);
extern struct page *m2p_find_override(unsigned long mfn);
extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);
extern unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn);


#ifdef CONFIG_XEN_DEBUG_FS
extern int p2m_dump_show(struct seq_file *m, void *v);
#endif
static inline unsigned long pfn_to_mfn(unsigned long pfn)
static inline unsigned long pfn_to_mfn(unsigned long pfn)
{
{
	unsigned long mfn;
	unsigned long mfn;
+0 −14
Original line number Original line Diff line number Diff line
@@ -2362,17 +2362,3 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
	return err;
	return err;
}
}
EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);
EXPORT_SYMBOL_GPL(xen_remap_domain_mfn_range);

#ifdef CONFIG_XEN_DEBUG_FS
static int p2m_dump_open(struct inode *inode, struct file *filp)
{
	return single_open(filp, p2m_dump_show, NULL);
}

static const struct file_operations p2m_dump_fops = {
	.open		= p2m_dump_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};
#endif /* CONFIG_XEN_DEBUG_FS */
+32 −3
Original line number Original line Diff line number Diff line
@@ -782,8 +782,9 @@ unsigned long m2p_find_override_pfn(unsigned long mfn, unsigned long pfn)
EXPORT_SYMBOL_GPL(m2p_find_override_pfn);
EXPORT_SYMBOL_GPL(m2p_find_override_pfn);


#ifdef CONFIG_XEN_DEBUG_FS
#ifdef CONFIG_XEN_DEBUG_FS

#include <linux/debugfs.h>
int p2m_dump_show(struct seq_file *m, void *v)
#include "debugfs.h"
static int p2m_dump_show(struct seq_file *m, void *v)
{
{
	static const char * const level_name[] = { "top", "middle",
	static const char * const level_name[] = { "top", "middle",
						"entry", "abnormal" };
						"entry", "abnormal" };
@@ -856,4 +857,32 @@ int p2m_dump_show(struct seq_file *m, void *v)
#undef TYPE_PFN
#undef TYPE_PFN
#undef TYPE_UNKNOWN
#undef TYPE_UNKNOWN
}
}
#endif

static int p2m_dump_open(struct inode *inode, struct file *filp)
{
	return single_open(filp, p2m_dump_show, NULL);
}

static const struct file_operations p2m_dump_fops = {
	.open		= p2m_dump_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};

static struct dentry *d_mmu_debug;

static int __init xen_p2m_debugfs(void)
{
	struct dentry *d_xen = xen_init_debugfs();

	if (d_xen == NULL)
		return -ENOMEM;

	d_mmu_debug = debugfs_create_dir("mmu", d_xen);

	debugfs_create_file("p2m", 0600, d_mmu_debug, NULL, &p2m_dump_fops);
	return 0;
}
fs_initcall(xen_p2m_debugfs);
#endif /* CONFIG_XEN_DEBUG_FS */