]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
target/riscv: Fix privilege mode of G-stage translation for debugging
authorHiroaki Yamamoto <hrak1529@gmail.com>
Wed, 28 Feb 2024 08:10:28 +0000 (17:10 +0900)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 8 Mar 2024 10:48:03 +0000 (20:48 +1000)
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>
target/riscv/cpu_helper.c

index c994a72634a8bc473e150c95b78b80c6153164cd..ce7322011d5d651fe37ea57e89a1aff39b9777e3 100644 (file)
@@ -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;
         }
     }