aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/debug_pagetables.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/mm/debug_pagetables.c')
-rw-r--r--arch/x86/mm/debug_pagetables.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/x86/mm/debug_pagetables.c b/arch/x86/mm/debug_pagetables.c
index 421f2664ffa0..51a6f92da2bf 100644
--- a/arch/x86/mm/debug_pagetables.c
+++ b/arch/x86/mm/debug_pagetables.c
@@ -72,6 +72,31 @@ static const struct file_operations ptdump_curusr_fops = {
72}; 72};
73#endif 73#endif
74 74
75#if defined(CONFIG_EFI) && defined(CONFIG_X86_64)
76extern pgd_t *efi_pgd;
77static struct dentry *pe_efi;
78
79static int ptdump_show_efi(struct seq_file *m, void *v)
80{
81 if (efi_pgd)
82 ptdump_walk_pgd_level_debugfs(m, efi_pgd, false);
83 return 0;
84}
85
86static int ptdump_open_efi(struct inode *inode, struct file *filp)
87{
88 return single_open(filp, ptdump_show_efi, NULL);
89}
90
91static const struct file_operations ptdump_efi_fops = {
92 .owner = THIS_MODULE,
93 .open = ptdump_open_efi,
94 .read = seq_read,
95 .llseek = seq_lseek,
96 .release = single_release,
97};
98#endif
99
75static struct dentry *dir, *pe_knl, *pe_curknl; 100static struct dentry *dir, *pe_knl, *pe_curknl;
76 101
77static int __init pt_dump_debug_init(void) 102static int __init pt_dump_debug_init(void)
@@ -96,6 +121,13 @@ static int __init pt_dump_debug_init(void)
96 if (!pe_curusr) 121 if (!pe_curusr)
97 goto err; 122 goto err;
98#endif 123#endif
124
125#if defined(CONFIG_EFI) && defined(CONFIG_X86_64)
126 pe_efi = debugfs_create_file("efi", 0400, dir, NULL, &ptdump_efi_fops);
127 if (!pe_efi)
128 goto err;
129#endif
130
99 return 0; 131 return 0;
100err: 132err:
101 debugfs_remove_recursive(dir); 133 debugfs_remove_recursive(dir);