arm64: add support to dump the kernel page tables
PATCH 1/1 arm64: add support to dump the kernel page tables
In a similar manner to arm, it's useful to be able to dump the page tables to verify permissions and memory types. Add a debugfs file to check the page tables.
Signed-off-by Laura Abbott <[email protected]>
---
Not tested with 64K pages or anything similar.
--- arch/arm64/Kconfig.debug | 12 ++ arch/arm64/mm/Makefile | 1 + arch/arm64/mm/dump.c | 353 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 366 insertions(+) create mode 100644 arch/arm64/mm/dump.c
arch/arm64/Kconfig.debug +12 -0
@@ -6,6 +6,18 @@ config FRAME_POINTER bool default y +config ARM64_PTDUMP + bool "Export kernel pagetable layout to userspace via debugfs" + depends on DEBUG_KERNEL + select DEBUG_FS + help + Say Y here if you want to show the kernel pagetable layout in a + debugfs file. This information is only useful for kernel developers + who are working in architecture specific areas of the kernel. + It is probably not a good idea to enable this feature in a production + kernel. + If in doubt, say "N" + config STRICT_DEVMEM bool "Filter access to /dev/mem" depends on MMU
arch/arm64/mm/Makefile +1 -0
@@ -3,3 +3,4 @@ obj-y := dma-mapping.o extable.o fault.o init.o \ ioremap.o mmap.o pgd.o mmu.o \ context.o proc.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o +obj-$(CONFIG_ARM64_PTDUMP) += dump.o
arch/arm64/mm/dump.c new file +353 -0
353 lines not on this page · raw message
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation