Skip to content

hexagon: model the PCYCLE registers

Brian Cain qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 3 repliesIn review
  2. v12 patches 8 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4target/hexagon: remove packet-count PCYCLE implementationtarget/hexagon/cpu.c target/hexagon/cpu.h target/hexagon/cpu_helper.c +4 more+1 -1121 reply
2/4hw/hexagon: model PCYCLE with virtual clockhw/hexagon/hexagon_globalreg.c hw/hexagon/trace-events include/hw/hexagon/hexagon_globalreg.h +5 more+205 -41 reply
3/4target/hexagon: mark clock-backed register reads as I/Otarget/hexagon/gen_tcg_sys.h target/hexagon/genptr.c target/hexagon/hex_common.py+36 -100 replies
4/4exec: correct translator_io_start documentationinclude/exec/translator.h+2 -31 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchPierrick Bouvier
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/4] hexagon: model the PCYCLE registers

The pcycle registers measure activity - a very coarse and simple PMU-like feature. The baseline had a "count the instructions per TB and scale a counter" model (to be summed across vCPUs upon reg read). But that's not a good model and it adds work to all TBs.

Instead: we'll use time as a slightly better model, but only accumulating when there's activity. Using a clock is unfortunately less stable across hosts and changes to translation, but still a net improvement all things considered.

In v2:
- Removed "pcycle_freq_hz" property.
- Moved deletions into "remove packet-count PCYCLE implementation" patch at the start of the series.
- Removed translator_io_start() from start/stop/wait/resume instructions:
these do not trigger I/O.
- added comment update for translator_io_start()

v1: https://lore.kernel.org/qemu-devel/[email protected]/

Brian Cain (4):
target/hexagon: remove packet-count PCYCLE implementation hw/hexagon: model PCYCLE with virtual clock target/hexagon: mark clock-backed register reads as I/O
exec: correct translator_io_start documentation

 include/exec/translator.h              |   5 +-
 include/hw/hexagon/hexagon_globalreg.h |   5 +
 target/hexagon/cpu.h                   |   2 -
 target/hexagon/cpu_helper.h            |   6 --
 target/hexagon/gen_tcg_sys.h           |   8 +-
 target/hexagon/helper.h                |   2 +
 target/hexagon/translate.h             |   2 -
 hw/hexagon/hexagon_globalreg.c         | 129 +++++++++++++++++++++++++
 target/hexagon/cpu.c                   |  10 +-
 target/hexagon/cpu_helper.c            |  79 ---------------
 target/hexagon/genptr.c                |  38 +++++++-
 target/hexagon/hexswi.c                |  10 +-
 target/hexagon/machine.c               |   2 +-
 target/hexagon/op_helper.c             |  45 +++++++++
 target/hexagon/translate.c             |  21 ----
 hw/hexagon/trace-events                |   1 +
 target/hexagon/hex_common.py           |   8 +-
 17 files changed, 244 insertions(+), 129 deletions(-)
Signature · 1 line
2.34.1