Skip to content

target/arm: Read generic timer counters without the BQL

Philippe Mathieu-Daudé qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2target/arm: Split ARM_CP_IO as ARM_CP_IO_ENDTB + ARM_CP_IO_BQLdocs/devel/multi-thread-tcg.rst target/arm/cpregs.h target/arm/helper.c +3 more+23 -122 replies
2/2target/arm: Read generic timer counters without the BQLtarget/arm/helper.c+10 -101 reply

Reviews trailers per patch

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

PatchMohamed Mediouni
1/2R-b
2/2R-b

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

Read the v1 thread

Cover letter [PATCH 0/2] target/arm: Read generic timer counters without the BQL

ARM_CP_IO both ends the TB and takes the BQL around the hooks.

Split it into ARM_CP_IO_ENDTB and ARM_CP_IO_BQL (ARM_CP_IO is their union, so existing registers are unchanged), then mark CNTPCT/CNTVCT and their SS variants ENDTB only: they are read-only and only use per-CPU state and QEMU_CLOCK_VIRTUAL, read through the timers_state seqlock.

Under MTTCG, counter reads are no longer serialized on the BQL; with icount this relies on the qemu_icount series based-on below.

Note, RISC-V cycle and instret CSR reads reach icount_get() and icount_get_raw() without holding the BQL. Call path:

helper_csrr()
riscv_csrr()
read_hpmcounter()
riscv_pmu_ctr_get_fixed_counters_val()
cycle = icount_get()
instret = icount_get_raw()

Based-on: <[email protected]> "accel/tcg: Do not write qemu_icount from seqlock readers"

Philippe Mathieu-Daudé (2):
target/arm: Split ARM_CP_IO as ARM_CP_IO_ENDTB + ARM_CP_IO_BQL target/arm: Read generic timer counters without the BQL

 docs/devel/multi-thread-tcg.rst |  8 +++++---
 target/arm/cpregs.h             | 11 ++++++++++-
 target/arm/helper.c             | 24 ++++++++++++------------
 target/arm/tcg/op_helper.c      |  8 ++++----
 target/arm/tcg/translate-a64.c  |  2 +-
 target/arm/tcg/translate.c      |  2 +-
 6 files changed, 33 insertions(+), 22 deletions(-)
Signature · 1 line
2.55.0