]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
target/riscv: Report errors validating 2nd-stage PTEs
authorAlistair Francis <alistair.francis@wdc.com>
Fri, 27 Mar 2020 19:54:45 +0000 (12:54 -0700)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 19 Jun 2020 15:24:07 +0000 (08:24 -0700)
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
target/riscv/cpu_helper.c

index eda7057663e4c93f4f5f0c5b883aa61860c5e587..75d2ae34349808740b54b66f10d9641467899667 100644 (file)
@@ -435,8 +435,13 @@ restart:
             hwaddr vbase;
 
             /* Do the second stage translation on the base PTE address. */
-            get_physical_address(env, &vbase, &vbase_prot, base, MMU_DATA_LOAD,
-                                 mmu_idx, false, true);
+            int vbase_ret = get_physical_address(env, &vbase, &vbase_prot,
+                                                 base, MMU_DATA_LOAD,
+                                                 mmu_idx, false, true);
+
+            if (vbase_ret != TRANSLATE_SUCCESS) {
+                return vbase_ret;
+            }
 
             pte_addr = vbase + idx * ptesize;
         } else {