Skip to content

Commit

Permalink
target/riscv: Fix privilege mode of G-stage translation for debugging
Browse files Browse the repository at this point in the history
G-stage translation should be considered to be user-level access in
riscv_cpu_get_phys_page_debug(), as already done in riscv_cpu_tlb_fill().

This fixes a bug that prevents gdb from reading memory while the VM is
running in VS-mode.

Signed-off-by: Hiroaki Yamamoto <hrak1529@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240228081028.35081-1-hrak1529@gmail.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
  • Loading branch information
tokyo4j authored and alistair23 committed Mar 8, 2024
1 parent 0678e9f commit 6979b7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion target/riscv/cpu_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ hwaddr riscv_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)

if (env->virt_enabled) {
if (get_physical_address(env, &phys_addr, &prot, phys_addr, NULL,
0, mmu_idx, false, true, true)) {
0, MMUIdx_U, false, true, true)) {
return -1;
}
}
Expand Down

0 comments on commit 6979b7b

Please sign in to comment.