riscv: hmp: Add a command to show virtual memory mappings
PATCH v3 1/1 riscv: hmp: Add a command to show virtual memory mappings
This adds 'info mem' command for RISC-V, to show virtual memory mappings of each hart that aids debugging.
Rather than showing every valid PTE, the command compacts the output by merging all contiguous physical address mappings into one block and only shows the merged block mapping details.
Signed-off-by Bin Meng <[email protected]>
---
Changes in v3:
- print PTEs for all harts instead of just current hart
Changes in v2:
- promote ppn to hwaddr when doing page table address calculation
hmp-commands-info.hx | 2 +- target/riscv/Makefile.objs | 4 + target/riscv/monitor.c | 234 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 239 insertions(+), 1 deletion(-) create mode 100644 target/riscv/monitor.c
hmp-commands-info.hx +1 -1
@@ -249,7 +249,7 @@ STEXI Show virtual to physical memory mappings. ETEXI -#if defined(TARGET_I386) +#if defined(TARGET_I386) || defined(TARGET_RISCV) { .name = "mem", .args_type = "",
target/riscv/Makefile.objs +4 -0
@@ -1,5 +1,9 @@ obj-y += translate.o op_helper.o cpu_helper.o cpu.o csr.o fpu_helper.o gdbstub.o pmp.o +ifeq ($(CONFIG_SOFTMMU),y) +obj-y += monitor.o +endif + DECODETREE = $(SRC_PATH)/scripts/decodetree.py decode32-y = $(SRC_PATH)/target/riscv/insn32.decode
target/riscv/monitor.c new file +234 -0
234 lines not on this page · raw message
Signature · 1 line
2.7.4