-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arm64: dump: Make ptdump debugfs a separate option
ptdump_register currently initializes a set of page table information and registers debugfs. There are uses for the ptdump option without wanting the debugfs options. Split this out to make it a separate option. Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
- Loading branch information
Laura Abbott
authored and
Catalin Marinas
committed
Nov 7, 2016
1 parent
0bfc445
commit 4ddb9bf
Showing
6 changed files
with
54 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <linux/debugfs.h> | ||
#include <linux/seq_file.h> | ||
|
||
#include <asm/ptdump.h> | ||
|
||
static int ptdump_show(struct seq_file *m, void *v) | ||
{ | ||
struct ptdump_info *info = m->private; | ||
ptdump_walk_pgd(m, info); | ||
return 0; | ||
} | ||
|
||
static int ptdump_open(struct inode *inode, struct file *file) | ||
{ | ||
return single_open(file, ptdump_show, inode->i_private); | ||
} | ||
|
||
static const struct file_operations ptdump_fops = { | ||
.open = ptdump_open, | ||
.read = seq_read, | ||
.llseek = seq_lseek, | ||
.release = single_release, | ||
}; | ||
|
||
int ptdump_debugfs_register(struct ptdump_info *info, const char *name) | ||
{ | ||
struct dentry *pe; | ||
pe = debugfs_create_file(name, 0400, NULL, info, &ptdump_fops); | ||
return pe ? 0 : -ENOMEM; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters