From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KXYcp-0007bx-Jq for qemu-devel@nongnu.org; Mon, 25 Aug 2008 05:44:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KXYcm-0007YO-Rg for qemu-devel@nongnu.org; Mon, 25 Aug 2008 05:44:38 -0400 Received: from [199.232.76.173] (port=46391 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KXYcm-0007Y9-Ku for qemu-devel@nongnu.org; Mon, 25 Aug 2008 05:44:36 -0400 Received: from il.qumranet.com ([212.179.150.194]:14099) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KXYcm-00027c-9p for qemu-devel@nongnu.org; Mon, 25 Aug 2008 05:44:36 -0400 Received: from gleb-debian.qumranet.com (gleb-debian.qumranet.com.qumranet.com [172.16.15.143]) by il.qumranet.com (Postfix) with ESMTP id 3B9F6250310 for ; Mon, 25 Aug 2008 12:44:33 +0300 (IDT) Date: Mon, 25 Aug 2008 12:44:33 +0300 From: Gleb Natapov Subject: Re: [Qemu-devel] [PATCH 6/6] Pass cpu speed into SM BIOS. Message-ID: <20080825094433.GH6192@minantech.com> References: <20080824113258.5652.92531.stgit@gleb-debian.qumranet.com.qumranet.com> <20080824113329.5652.94322.stgit@gleb-debian.qumranet.com.qumranet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Sun, Aug 24, 2008 at 09:14:23PM +0300, Blue Swirl wrote: > On 8/24/08, Gleb Natapov wrote: > > +static uint32_t cpu_speed; > > 32 bits won't be enough when we get >4GHz CPUs. > The value stored there is in MHz. Actually even 32 bits is to much since SMBIOS specification uses 16 bit for CPU speed. > +static double get_freq(int divisor, unsigned int cpu) > > I'd use uint64_t and throw away the divisor and double math. > I've copied this function from another project and didn't want to change it much in case we will want to use newer version someday. > On Sparc64, the frequency line in /proc/cpuinfo looks like: > Cpu0ClkTck : 000000000ee6b280 > Can somebody with this HW add support for it. I don't want to do changes which I can't test. -- Gleb.