qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH-for-6.1 v2 0/6] target/mips/cp0_timer: Use new clock_ns_to_ticks()
@ 2021-04-09  9:36 Philippe Mathieu-Daudé
  2021-04-09  9:36 ` [RFC PATCH-for-6.1 v2 1/6] target/mips/cpu: Use clock_has_source() instead of clock_get() Philippe Mathieu-Daudé
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-09  9:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Aleksandar Rikalo, Luc Michel, Huacai Chen,
	Philippe Mathieu-Daudé,
	Hao Wu, Aurelien Jarno

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(-)

-- 
2.26.3



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-04-10 14:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09  9:36 [RFC PATCH-for-6.1 v2 0/6] target/mips/cp0_timer: Use new clock_ns_to_ticks() Philippe Mathieu-Daudé
2021-04-09  9:36 ` [RFC PATCH-for-6.1 v2 1/6] target/mips/cpu: Use clock_has_source() instead of clock_get() Philippe Mathieu-Daudé
2021-04-09 16:13   ` Richard Henderson
2021-04-09  9:36 ` [RFC PATCH-for-6.1 v2 2/6] target/mips/cpu: Update CP0 clock when CPU clock is propagated Philippe Mathieu-Daudé
2021-04-09 16:13   ` Richard Henderson
2021-04-09  9:36 ` [RFC PATCH-for-6.1 v2 3/6] target/mips/cp0_timer: Add ns_to_count() helper Philippe Mathieu-Daudé
2021-04-09 16:15   ` Richard Henderson
2021-04-09  9:36 ` [RFC PATCH-for-6.1 v2 4/6] target/mips/cp0_timer: Add ns_substract_to_count() helper Philippe Mathieu-Daudé
2021-04-09 16:27   ` Richard Henderson
2021-04-09  9:36 ` [RFC PATCH-for-6.1 v2 5/6] target/mips/cp0_timer: Use new clock_ns_to_ticks() Philippe Mathieu-Daudé
2021-04-09 16:42   ` Richard Henderson
2021-04-09  9:36 ` [RFC PATCH-for-6.1 v2 6/6] hw/mips/loongson3_virt: Raise CPU clock to 2 GHz Philippe Mathieu-Daudé
2021-04-10  2:43   ` Huacai Chen
2021-04-10 14:05     ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).