Bug 31716

Summary: FreeBSD uses broken tsc timecounter by default
Product: Base System Reporter: Christian Ruppert <arc>
Component: i386Assignee: Poul-Henning Kamp <phk>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Christian Ruppert 2001-11-02 22:10:01 UTC
although the kernel detects the cpu (AMD K5 model 0) correctly and thus (should) set tsc_is_broken = 1 in line 282 of i386/i386/identcpu.c it uses tsc as default timecounter. this results in a disfunctional system clock (since tsc is really broken at least on my k5 model 0) until you change the method using sysctl -w kern.timecounter.hardware=i8254.

Fix: 

WORKAROUND: sysctl -w kern.timecounter.hardware=i8254 after booting.
however this results in an offset (usually some seconds) of the system clock due to the period the broken timecounter was used.
How-To-Repeat: boot the kernel (without apm or smp support compiled in) on an AMD K5 model 0 machine and take a look at sysctl kern.timecounter.hardware.
i expect similar behaviour using an IDT WinChip C6 since FreeBSD uses the same mechanism here (setting tsc_is_bromen = 1) however i could not verify this.
Comment 1 iedowse freebsd_committer freebsd_triage 2002-12-01 20:20:03 UTC
State Changed
From-To: open->feedback


Is this problem still present in more recent releases?
Comment 2 Kris Kennaway freebsd_committer freebsd_triage 2003-07-13 00:21:16 UTC
Responsible Changed
From-To: freebsd-bugs->phk

PHK is Mr Timekeeping
Comment 3 Poul-Henning Kamp freebsd_committer freebsd_triage 2003-07-29 11:18:04 UTC
State Changed
From-To: feedback->closed

This has already been fixed at some point.