From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [SeaBIOS] [PATCH v2] add acpi pmtimer support Date: Wed, 5 Sep 2012 11:39:49 -0400 Message-ID: <50477245.4030003@CloudSwitch.Com> References: <1344922159-22703-1-git-send-email-kraxel@redhat.com> <20120902204243.GC1814@morn.localdomain> <5046E2DC.4080104@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: Kevin O'Connor , , To: Gerd Hoffmann Return-path: Received: from hub021-nj-7.exch021.serverdata.net ([206.225.164.223]:2812 "EHLO hub021-nj-7.exch021.serverdata.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297Ab2IEPjx (ORCPT ); Wed, 5 Sep 2012 11:39:53 -0400 In-Reply-To: <5046E2DC.4080104@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/05/12 01:27, Gerd Hoffmann wrote: > On 09/02/12 22:42, Kevin O'Connor wrote: >> On Tue, Aug 14, 2012 at 07:29:19AM +0200, Gerd Hoffmann wrote: >>> This patch makes seabios use the acpi pmtimer instead of tsc for >>> timekeeping. The pmtimer has a fixed frequency and doesn't need >>> calibration, thus it doesn't suffer from calibration errors due to a >>> loaded host machine. >> The patch looks okay to me, but is it still needed? (I recall seeing >> something on the kvm list about a bug fix to the main timer.) > It is still a good idea to make timing in a virtual machine more robust. > >>> + u32 pmtimer = inl(ioport); >>> + return (u64)wraps << 24 | pmtimer; >> BTW, why is this "<< 24", and if it should be that way, shouldn't the >> pmtimer be "inl(ioport) & 0xffffff" ? > The pmtimer is defined to be 24 bits wide, so the shift is correct. This is not true in general. It can be either 24 or 32 bits. What it is depends on ACPI data (acpi_gbl_FADT->tmr_val_ext). However it is valid to only used 24 bits. */ /* > But, yes, the ioport read should better be masked to be on the safe > side. v3 will go out in a minute. > > cheers, > Gerd > > _______________________________________________ > SeaBIOS mailing list > SeaBIOS@seabios.org > http://www.seabios.org/mailman/listinfo/seabios -Don Slutz