[SeaBIOS] [PATCH] tsc: use kvmclock for calibration

Gerd Hoffmann kraxel at redhat.com
Fri Aug 10 10:10:27 CEST 2012


  Hi,

>>>   (1) Use this patch (with alignment issue fixed of course).
>>>   (2) Do a full kvmclock implementation.  Feels a bit like overkill.
>>>   (3) SeaBIOS can fallback to the PIT for timing on machines which
>>>       have no TSC.  We could do that too in case we detect kvm ...
>>
>> What sort of timeouts are these?  If seconds, maybe the rtc would be best.
> 
> I vote for 3 so nobody has to maintain kvmclock code in SeaBIOS and Gerd
> can fix the in-kernel PIT issues with GRUB (see Michaels message) while testing.

(2) turned out to be not too bad when taking a shortcut: Go through an
enable/disable cycle each time we read the clock, then just grab
system_time.  Not that efficient, but should be ok for seabios.  Usually
it checks the clock when sitting around idle, waiting for something to
happen.  And it simplifies the implementation alot as we can just skip
all the tsc frequency & delta calculations.

Draft patch attached.  Comments?

cheers,
  Gerd
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-kvmclock-clocksource.patch
URL: <http://www.seabios.org/pipermail/seabios/attachments/20120810/a4f78f89/attachment-0001.ksh>


More information about the SeaBIOS mailing list