[SeaBIOS] [PATCH v2] add acpi pmtimer support

Gerd Hoffmann kraxel at redhat.com
Wed Sep 5 07:27:56 CEST 2012

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.
But, yes, the ioport read should better be masked to be on the safe
side.  v3 will go out in a minute.


More information about the SeaBIOS mailing list