NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/38667: cpuctl does not properly deal with AMD Phenom



Paul Goyette wrote:
>  The following patch is necessary to enable cpuctl to properly identify 
>  my Phenom processor:
>  
>  Index: i386.c
>  ===================================================================
>  RCS file: /cvsroot/src/usr.sbin/cpuctl/arch/i386.c,v
>  retrieving revision 1.3
>  diff -u -p -r1.3 i386.c
>  --- i386.c   15 May 2008 23:31:56 -0000      1.3
>  +++ i386.c   16 May 2008 13:15:45 -0000
>  @@ -983,7 +983,8 @@ amd_amd64_name(struct cpu_info *ci)
>       extfamily = CPUID2EXTFAMILY(ci->ci_signature);
>       extmodel  = CPUID2EXTMODEL(ci->ci_signature);
>  
>  -    if (extfamily == 0x00) {
>  +    switch (extfamily) {
>  +    case 0x00:
>               switch (model) {
>               case 0x1:
>                       switch (extmodel) {
>  @@ -1093,6 +1094,17 @@ amd_amd64_name(struct cpu_info *ci)
>               default:
>                       ret = "Unknown AMD64 CPU";
>               }
>  +            break;
>  +    case 0x01:
>  +            switch (model) {
>  +                    case 0x02:
>  +                            ret = "Phenom";

I think this would have to actually be "Family 10h", as Opteron's also
report the same cpuid.  See page 5 of:
http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/41322.pdf

If you're ok with that I'll check in the change.

I guess we should also pick-up and fix errata 298 if necessary.
Although that is more complex as I believe the registers have to be
updated on every core.

Thanks,
Chris


Home | Main Index | Thread Index | Old Index