From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NTJYQ-00018Z-1W for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:27:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NTJYL-00016R-Bj for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:27:21 -0500 Received: from [199.232.76.173] (port=54294 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NTJYL-00016L-8X for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:27:17 -0500 Received: from cantor.suse.de ([195.135.220.2]:44067 helo=mx1.suse.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NTJYK-0001Ks-NN for qemu-devel@nongnu.org; Fri, 08 Jan 2010 13:27:17 -0500 Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: Date: Fri, 8 Jan 2010 19:27:12 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <6C965A04-49D9-4529-B1A0-E931C7626C87@suse.de> References: <1262972592-7317-1-git-send-email-agraf@suse.de> <6374C4B6-BFB4-4EC5-8DA9-1377392623CF@suse.de> 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: Blue Swirl Cc: QEMU Developers , Aurelien Jarno On 08.01.2010, at 19:22, Blue Swirl wrote: > On Fri, Jan 8, 2010 at 6:07 PM, Alexander Graf wrote: >>=20 >> On 08.01.2010, at 19:04, Blue Swirl wrote: >>=20 >>> 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. >>>>=20 >>>> 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. >>>>=20 >>>> 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. >>>>=20 >>>> This leads to massive timing problems. On my test machine, a "sleep = 2" takes >>>> about 14 seconds with KVM enabled. >>>>=20 >>>> 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. >>>=20 >>> IIRC copying the host CPU frequency to guest was rejected earlier = for x86. >>=20 >> 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. >=20 > The frequency could be a parameter for the -cpu flag, like -cpu > 970fx,frequency=3D1000000000. We could implement that as an override to the current static code path. For KVM it doesn't make any sense, as you really want to see the host = frequency in the guest here. That's what users expect. Period. Alex=