From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC1oP-0000yn-OI for qemu-devel@nongnu.org; Mon, 06 Jul 2015 04:31:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZC1oN-0003Yt-9t for qemu-devel@nongnu.org; Mon, 06 Jul 2015 04:31:37 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:47085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZC1oN-0003S8-1Z for qemu-devel@nongnu.org; Mon, 06 Jul 2015 04:31:35 -0400 Date: Mon, 6 Jul 2015 10:31:24 +0200 From: Aurelien Jarno Message-ID: <20150706083124.GS931@aurel32.net> References: <20150701100251.GA11361@aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH pic32 v2 1/5] Speed of MIPS CPU timer made configurable per platform. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Serge Vakulenko Cc: Leon Alrae , qemu-devel@nongnu.org On 2015-07-05 16:25, Serge Vakulenko wrote: > On Wed, Jul 1, 2015 at 3:02 AM, Aurelien Jarno 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 aurelien@aurel32.net http://www.aurel32.net