Hi, In this new version the most significant change is in patch 6, where a new hflag allows us to not call the instruction helper inside translate.c unless we're absolutely certain that there is an instruction count event being sampled and active in the PMU. This change turned out to be a big boost in performance in the PMU emulation overall, most notably when dealing with cycle events that were calling the helper needlessly.
This and all other changes were suggested by David in his review of the previous version. Changes from v8: - patch 5: * overflow timer of PMC5 is now marked as NULL instead of absent - patch 6: * new hflags HFLAGS_INSN_CNT added to track instruction count state * previous HFLAGS_MMCR0FC flag removed * pmu_count_insns() now works partially with user mode - patch 9: * fixed interrupt comment - v8 link: https://lists.gnu.org/archive/html/qemu-devel/2021-11/msg05160.html Daniel Henrique Barboza (9): target/ppc: introduce PMUEventType and PMU overflow timers target/ppc: PMU basic cycle count for pseries TCG target/ppc: PMU: update counters on PMCs r/w target/ppc: PMU: update counters on MMCR1 write target/ppc: enable PMU counter overflow with cycle events target/ppc: enable PMU instruction count target/ppc/power8-pmu.c: add PM_RUN_INST_CMPL (0xFA) event PPC64/TCG: Implement 'rfebb' instruction target/ppc/excp_helper.c: EBB handling adjustments Gustavo Romero (1): target/ppc: PMU Event-Based exception support hw/ppc/spapr_cpu_core.c | 1 + target/ppc/cpu.h | 60 +++- target/ppc/cpu_init.c | 46 ++- target/ppc/excp_helper.c | 93 ++++++ target/ppc/helper.h | 6 + target/ppc/helper_regs.c | 7 + target/ppc/insn32.decode | 5 + target/ppc/meson.build | 1 + target/ppc/power8-pmu-regs.c.inc | 69 ++++- target/ppc/power8-pmu.c | 386 +++++++++++++++++++++++++ target/ppc/power8-pmu.h | 26 ++ target/ppc/spr_tcg.h | 5 + target/ppc/translate.c | 78 +++++ target/ppc/translate/branch-impl.c.inc | 33 +++ 14 files changed, 801 insertions(+), 15 deletions(-) create mode 100644 target/ppc/power8-pmu.c create mode 100644 target/ppc/power8-pmu.h create mode 100644 target/ppc/translate/branch-impl.c.inc -- 2.31.1