From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTJVp-0008IU-6Q for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:24:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTJVk-0008H5-89 for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:24:40 -0500 Received: from [199.232.76.173] (port=54224 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTJVj-0008Gv-U1 for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:24:36 -0500 Received: from mx20.gnu.org ([199.232.41.8]:17246) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NTJVY-0000Hu-Df for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:24:35 -0500 Received: from mail-pz0-f188.google.com ([209.85.222.188]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NTJUi-0007Pq-On for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:23:32 -0500 Received: by pzk26 with SMTP id 26so10908995pzk.4 for ; Fri, 08 Jan 2010 10:23:01 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <6374C4B6-BFB4-4EC5-8DA9-1377392623CF@suse.de> References: <1262972592-7317-1-git-send-email-agraf@suse.de> <6374C4B6-BFB4-4EC5-8DA9-1377392623CF@suse.de> From: Blue Swirl Date: Fri, 8 Jan 2010 18:22:40 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] Re: [PATCH] PPC: tell the guest about the time base frequency List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: QEMU Developers , Aurelien Jarno On Fri, Jan 8, 2010 at 6:07 PM, Alexander Graf wrote: > > On 08.01.2010, at 19:04, Blue Swirl wrote: > >> On Fri, Jan 8, 2010 at 5:43 PM, Alexander Graf wrote: >>> Our guest systems need to know by how much the timebase increases every second, >>> so there usually is a "timebase-frequency" property in the cpu leaf of the >>> device tree. >>> >>> This property is missing in OpenBIOS, as is the "clock-frequency" property that >>> tells the guest how fast the CPU is. FWIW that one is only used for >>> /proc/cpuinfo though. >>> >>> With qemu, Linux's fallback timebase speed and qemu's internal timebase speed >>> match up. With KVM, that is no longer true. The guest is running at the same >>> timebase speed as the host. >>> >>> This leads to massive timing problems. On my test machine, a "sleep 2" takes >>> about 14 seconds with KVM enabled. >>> >>> This patch exports the timebase and clock frequencies to OpenBIOS, so it can >>> then put them into the device tree. I'll push the OpenBIOS change with the >>> NewWorld patch set, once that's either been reviewed or applied. >> >> IIRC copying the host CPU frequency to guest was rejected earlier for x86. > > Well IIRC x86 Linux tries to find out the cpu frequency itself. > PPC Linux doesn't - it completely relies on entries in the device tree. The frequency could be a parameter for the -cpu flag, like -cpu 970fx,frequency=1000000000.