On 2015-07-05 16:25, Serge Vakulenko wrote: > On Wed, Jul 1, 2015 at 3:02 AM, Aurelien Jarno <aurel...@aurel32.net> wrote: > > On 2015-06-30 21:12, Serge Vakulenko wrote: > >> @@ -153,5 +153,6 @@ void cpu_mips_clock_init (CPUMIPSState *env) > >> */ > >> if (!kvm_enabled()) { > >> env->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &mips_timer_cb, > >> env); > >> + env->count_freq = count_freq; > >> } > >> } > > > > So it means the value passed as an argument to this function is ignored > > in the KVM case. I guess we want to be able to tell the kernel about the > > request frequency. > > Sound like a new feature request for MIPS KVM developers. I cannot > find any such possibility in the current KVM API.
Ok. > My patch changes nothing for existing platforms like Malta, Fulong or > MIPSsim. Everything continues to work as it is. Only for pic32mx7 cpu > the clock rate is decreased to 40MHz. I'm not sure anybody could ever > run KVM on this processor. :) Yes, but you give the possibility to tweak the speed, so later someone might wrongly pass a value different than 100MHz for a CPU usable with KVM. The way to go is to do add a comment with an assert: if (kvm_enabled()) { /* FIXME: KVM only supports a 100MHz clock. */ assert(count_freq == 100*1000*1000); } else { env->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &mips_timer_cb, env); env->count_freq = count_freq; } -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurel...@aurel32.net http://www.aurel32.net