riscv: Add support to dump the kernel page tables

In a similar manner to arm64, x86, powerpc, etc., it can traverse all
page tables, and dump the page table layout with the memory types and
permissions.

Add a debugfs file at /sys/kernel/debug/kernel_page_tables to export
the page table layout to userspace.

Signed-off-by: Zong Li <zong.li@sifive.com>
Tested-by: Alexandre Ghiti <alex@ghiti.fr>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
Zong Li 2020-03-12 10:58:35 +08:00 • committed by Palmer Dabbelt
commit 59c4da8640
No known key found for this signature in database
GPG key ID: 2E1319F35FBB1889
5 changed files with 340 additions and 0 deletions