qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH pic32 v2 1/5] Speed of MIPS CPU timer made confi


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PATCH pic32 v2 1/5] Speed of MIPS CPU timer made configurable per platform.
Date: Mon, 6 Jul 2015 10:31:24 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On 2015-07-05 16:25, Serge Vakulenko wrote:
> On Wed, Jul 1, 2015 at 3:02 AM, Aurelien Jarno <address@hidden> 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
address@hidden                 http://www.aurel32.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]