From john@pacer.pakprotector.com  Sun Oct  1 07:11:54 2000
Return-Path: <john@pacer.pakprotector.com>
Received: from nhj.nlc.net.au (nhj.nlc.net.au [203.24.133.1])
	by hub.freebsd.org (Postfix) with SMTP id C7D9637B66D
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  1 Oct 2000 07:11:52 -0700 (PDT)
Received: (qmail 11667 invoked from network); 2 Oct 2000 01:11:49 +1100
Received: from monster.nlc.net.au (203.24.133.6)
  by nhj.nlc.net.au with SMTP; 2 Oct 2000 01:11:49 +1100
Received: (qmail 2371 invoked from network); 2 Oct 2000 01:11:48 +1100
Received: from pacer.nlc.net.au (HELO sentinel.pakprotector.com) (203.24.133.16)
  by monster.nlc.net.au with SMTP; 2 Oct 2000 01:11:48 +1100
Received: from pacer.pakprotector.com (root@pacer.pakprotector.com [203.41.181.2])
	by sentinel.pakprotector.com (8.11.0/8.9.3) with ESMTP id e91ECTA11377
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 2 Oct 2000 01:12:30 +1100 (EST)
	(envelope-from john@pacer.pakprotector.com)
Received: (from john@localhost)
	by pacer.pakprotector.com (8.11.0/8.11.0) id e91EBwm00582;
	Mon, 2 Oct 2000 01:11:58 +1100 (EST)
	(envelope-from john)
Message-Id: <200010011411.e91EBwm00582@pacer.pakprotector.com>
Date: Mon, 2 Oct 2000 01:11:58 +1100 (EST)
From: john@pakprotector.com
Sender: john@pacer.pakprotector.com
Reply-To: john@pakprotector.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: AMD Duron Rev. A0 reports incorrect L2 cache size
X-Send-Pr-Version: 3.2

>Number:         21672
>Category:       i386
>Synopsis:       [i386] AMD Duron Rev. A0 reports incorrect L2 cache size
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 01 07:20:01 PDT 2000
>Closed-Date:    
>Last-Modified:  Sun Jan 23 21:36:51 UTC 2011
>Originator:     John Saunders
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
NORTHLINK COMMUNICATIONS PTY LTD
>Environment:

	AMD Duron Rev. A0 chip.

>Description:

	There is errata with Rev. A0 AMD Duron in that it reports a L2 cache size of 1K
	when it really should be 64K.

>How-To-Repeat:

	Boot with the -v option with a Rev. A0 Duron.

>Fix:

Apply the following patch to implement AMD's suggestion solution.

--- sys/i386/i386/identcpu.c.orig	Sat Sep 30 15:07:33 2000
+++ sys/i386/i386/identcpu.c	Mon Oct  2 01:07:22 2000
@@ -918,9 +918,16 @@
 		printf(", %d bytes/line", regs[3] & 0xff);
 		printf(", %d lines/tag", (regs[3] >> 8) & 0xff);
 		print_AMD_assoc((regs[3] >> 16) & 0xff);
-		if (amd_maxregs >= 0x80000006) {	/* K6-III only */
+		if (amd_maxregs >= 0x80000006) {	/* K6-III, K7 or later */
 			do_cpuid(0x80000006, regs);
-			printf("L2 internal cache: %d kbytes", regs[2] >> 16);
+			/*
+			 * Duron Rev. A0 incorrectly reports L2 cache size as 1K when it's 64K.
+			 */
+			if ((cpu_id & 0xFF0) == 0x630) {
+				printf("L2 internal cache: 64 kbytes");
+			} else {
+				printf("L2 internal cache: %d kbytes", regs[2] >> 16);
+			}
 			printf(", %d bytes/line", regs[2] & 0xff);
 			printf(", %d lines/tag", (regs[2] >> 8) & 0x0f);
 			print_AMD_assoc((regs[2] >> 12) & 0x0f);	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Sun Sep 2 10:07:17 PDT 2001 
Responsible-Changed-Why:  
I'll look at i. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21672 
Responsible-Changed-From-To: obrien->brucec  
Responsible-Changed-By: brucec 
Responsible-Changed-When: Sun Sep 12 10:27:34 UTC 2010 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=21672 
Responsible-Changed-From-To: brucec->freebsd-bugs 
Responsible-Changed-By: brucec 
Responsible-Changed-When: Sun Jan 23 21:36:30 UTC 2011 
Responsible-Changed-Why:  
Back to the pool due to lack of time. 

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