From nobody@FreeBSD.org  Fri Nov  2 14:04:16 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 3F97237B408
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  2 Nov 2001 14:04:16 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id fA2M4GN55990;
	Fri, 2 Nov 2001 14:04:16 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200111022204.fA2M4GN55990@freefall.freebsd.org>
Date: Fri, 2 Nov 2001 14:04:16 -0800 (PST)
From: Christian Ruppert <arc@gmx.li>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FreeBSD uses broken tsc timecounter by default
X-Send-Pr-Version: www-1.0

>Number:         31716
>Category:       i386
>Synopsis:       FreeBSD uses broken tsc timecounter by default
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    phk
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 02 14:10:01 PST 2001
>Closed-Date:    Tue Jul 29 03:18:31 PDT 2003
>Last-Modified:  Tue Jul 29 03:18:31 PDT 2003
>Originator:     Christian Ruppert
>Release:        FreeBSD4.3, security patches 01:42, 01:52, 01:53, 01:55 installed
>Organization:
-
>Environment:
FreeBSD arc.rezel.enst.fr 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Fri Nov  2 21:15:39 CET 2001     root@arc.rezel.enst.fr:/usr/src/sys/compile/nevermind  i386
>Description:
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.
>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.
>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.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: iedowse 
State-Changed-When: Sun Dec 1 12:20:03 PST 2002 
State-Changed-Why:  

Is this problem still present in more recent releases? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=31716 
Responsible-Changed-From-To: freebsd-bugs->phk 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sat Jul 12 16:21:16 PDT 2003 
Responsible-Changed-Why:  
PHK is Mr Timekeeping 

http://www.freebsd.org/cgi/query-pr.cgi?pr=31716 
State-Changed-From-To: feedback->closed 
State-Changed-By: phk 
State-Changed-When: Tue Jul 29 03:18:04 PDT 2003 
State-Changed-Why:  
This has already been fixed at some point. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=31716 
>Unformatted:
