Skip to content

RFC target/mips/cp0_timer: Use new clock_ns_to_ticks()

Philippe Mathieu-Daudé qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest6 patches 7 repliesIn review
  2. v1 RFC1 patch 4 repliesSuperseded

Changes in v2 from the cover letter

- Fix clock_has_source()
- Split patch to be more digestible
- Raise loongson3_virt/TCG clock

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6target/mips/cpu: Use clock_has_source() instead of clock_get()target/mips/cpu.c+1 -11 reply
2/6target/mips/cpu: Update CP0 clock when CPU clock is propagatedtarget/mips/cpu.c+9 -21 reply
3/6target/mips/cp0_timer: Add ns_to_count() helpertarget/mips/cp0_timer.c+10 -81 reply
4/6target/mips/cp0_timer: Add ns_substract_to_count() helpertarget/mips/cp0_timer.c+9 -31 reply
5/6target/mips/cp0_timer: Use new clock_ns_to_ticks()target/mips/cp0_timer.c target/mips/cpu.c target/mips/cpu.h+31 -291 reply
6/6hw/mips/loongson3_virt: Raise CPU clock to 2 GHzhw/mips/loongson3_virt.c+1 -12 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchRichard Henderson
1/6R-b
2/6R-b
3/6R-b
4/6
5/6
6/6

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

Read the v2 thread

Cover letter [RFC PATCH-for-6.1 v2 0/6] target/mips/cp0_timer: Use new clock_ns_to_ticks()

Since v1:
- Fix clock_has_source()
- Split patch to be more digestible
- Raise loongson3_virt/TCG clock

This series uses the recently introduced clock_ns_to_ticks() function which "tells me how many times this clock would tick in this length of time" to simplify the MIPS CP0 R4K timer logic and remove the restriction to use frequencies >= 1GHz.

Still RFC because we could rethink the MIPS CP0 timer logic to avoid too frequent divu128 calls (painful on 32-bit hosts).

Also, env_archcpu() could eventually be dropped (by passing MIPSCPU* instead of CPUMIPSState*).

Still, enough for a first step cleanup.

Regards,

Phil.

Philippe Mathieu-Daudé (6):
target/mips/cpu: Use clock_has_source() instead of clock_get() target/mips/cpu: Update CP0 clock when CPU clock is propagated target/mips/cp0_timer: Add ns_to_count() helper target/mips/cp0_timer: Add ns_substract_to_count() helper target/mips/cp0_timer: Use new clock_ns_to_ticks() hw/mips/loongson3_virt: Raise CPU clock to 2 GHz

 target/mips/cpu.h        |  1 -
 hw/mips/loongson3_virt.c |  2 +-
 target/mips/cp0_timer.c  | 45 ++++++++++++++++++++++++++++++++--------
 target/mips/cpu.c        | 15 +++-----------
 4 files changed, 40 insertions(+), 23 deletions(-)
Signature · 1 line
2.26.3