]> Git Repo - qemu.git/commitdiff
target/riscv: support cache-related PMU events in virtual mode
authorJim Shu <[email protected]>
Wed, 23 Nov 2022 09:06:29 +0000 (09:06 +0000)
committerAlistair Francis <[email protected]>
Fri, 6 Jan 2023 00:42:55 +0000 (10:42 +1000)
let tlb_fill() function also increments PMU counter when it is from
two-stage translation, so QEMU could also monitor these PMU events when
CPU runs in VS/VU mode (like running guest OS).

Signed-off-by: Jim Shu <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-Id: <20221123090635[email protected]>
Signed-off-by: Alistair Francis <[email protected]>
target/riscv/cpu_helper.c

index 427d4d43862ca61f8c2d9151eb6826ce29008939..1ff6ab574641ce7fa301dcdbec396d84efd091d9 100644 (file)
@@ -1258,6 +1258,7 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
         }
     }
 
+    pmu_tlb_fill_incr_ctr(cpu, access_type);
     if (riscv_cpu_virt_enabled(env) ||
         ((riscv_cpu_two_stage_lookup(mmu_idx) || two_stage_lookup) &&
          access_type != MMU_INST_FETCH)) {
@@ -1321,7 +1322,6 @@ bool riscv_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
             }
         }
     } else {
-        pmu_tlb_fill_incr_ctr(cpu, access_type);
         /* Single stage lookup */
         ret = get_physical_address(env, &pa, &prot, address, NULL,
                                    access_type, mmu_idx, true, false, false);
This page took 0.029498 seconds and 4 git commands to generate.