Subject: port-i386/32496: Newer AMD CPUs don't do page colouring due to unrecognised CPU family 15
To: None <port-i386-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <g.mcgarry@ieee.org>
List: netbsd-bugs
Date: 01/11/2006 04:30:01
>Number:         32496
>Category:       port-i386
>Synopsis:       Newer AMD CPUs don't do page colouring due to unrecognised CPU family 15
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 11 04:30:01 +0000 2006
>Originator:     Gregory McGarry
>Release:        -current
>Organization:
>Environment:
>Description:
The latest AMD and Intel CPUs uses extended processor identification of the cpuid instruction (ie family 15).  identcpu.c doesn't support the extended processor identification, and always identifies the machine as Unknown.  Unknown AMD CPUs don't have their cache information read and page colouring isn't enabled for them
>How-To-Repeat:

>Fix:
I doubt that future CPUs aren't going to be backward compatible wrt cache information, therefore I don't see that this patch should be a problem.  The patch also includes the model names for some of more recent AMD CPUs.

Index: identcpu.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/identcpu.c,v
retrieving revision 1.26
diff -u -r1.26 identcpu.c
--- identcpu.c  2 Jan 2006 20:55:42 -0000       1.26
+++ identcpu.c  11 Jan 2006 04:23:20 -0000
@@ -305,9 +305,10 @@
                        CPUCLASS_686,
                        {
                                0, "Athlon Model 1", "Athlon Model 2",
-                               "Duron", "Athlon Model 4 (Thunderbird)",
-                               0, "Athlon", "Duron", "Athlon", 0,
-                               "Athlon", 0, 0, 0, 0, 0,
+                               "Duron", "Athlon (Thunderbird)",
+                               0, "Athlon (Palamino)", "Duron (Morgan)",
+                               "Athlon (Thoroughbred)", 0,
+                               "Athlon (Barton)", 0, 0, 0, 0, 0,
                                "K7 (Athlon)"   /* Default */
                        },
                        NULL,
@@ -323,8 +324,8 @@
                                "Unknown K7 (Athlon)"   /* Default */
                        },
                        NULL,
-                       NULL,
-                       NULL,
+                       amd_family6_probe,
+                       amd_cpu_cacheinfo,
                } }
        },
        {