Skip to content

target/ppc: Fix PMU instruction counting

Nicholas Piggin qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2target/ppc: Fix PMC5 instruction countingtarget/ppc/translate.c+82 -800 replies
2/2target/ppc: Tidy pmu_count_insns implementationtarget/ppc/translate.c+28 -270 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] target/ppc: Fix PMU instruction counting

The crux of the problem being that dynamic exits from a TB would not count instructions previously executed in the TB. I don't know how important it is for PMU to count instructions exactly, however for instruction replay this can lead to different counts for the same execution (e.g., because TBs can be different sized) and that blows up reverse debugging.

I posted something on this out before, but missed a few things (most notably faulting memory access). And found that forcing 1 insn per TB seems to be the only feasible way to do this.

Sorry to ping you on this again Richard, it's not urgent but you're the guru with this stuff and I'm hesitant to change it without a better opinion ... Simple band aid for the meanwhile could be leave it as is but just disable counting if record/replay is in use.

Thanks,
Nick

Nicholas Piggin (2):
target/ppc: Fix PMC5 instruction counting
target/ppc: Tidy pmu_count_insns implementation

 target/ppc/translate.c | 163 +++++++++++++++++++++--------------------
 1 file changed, 83 insertions(+), 80 deletions(-)
Signature · 1 line
2.43.0