From barner@in.tum.de  Thu Sep  4 10:07:03 2003
Return-Path: <barner@in.tum.de>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3CF4616A4BF
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Sep 2003 10:07:03 -0700 (PDT)
Received: from mailout.informatik.tu-muenchen.de (mailout.informatik.tu-muenchen.de [131.159.0.5])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 9F4DF43FE5
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Sep 2003 10:07:01 -0700 (PDT)
	(envelope-from barner@in.tum.de)
Received: by zi025.glhnet.mhn.de (Postfix, from userid 1000)
	id CC47F38A92; Thu,  4 Sep 2003 19:06:59 +0200 (CEST)
Message-Id: <20030904170659.CC47F38A92@zi025.glhnet.mhn.de>
Date: Thu,  4 Sep 2003 19:06:59 +0200 (CEST)
From: Simon Barner <barner@in.tum.de>
Reply-To: Simon Barner <barner@in.tum.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: /compat/linux/proc/cpuinfo gives wrong CPU model
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         56451
>Category:       kern
>Synopsis:       [linprocfs] [patch] /compat/linux/proc/cpuinfo gives wrong CPU model
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep 04 10:10:09 PDT 2003
>Closed-Date:    Fri Mar 15 23:41:40 UTC 2013
>Last-Modified:  Sat Mar 16 22:50:00 UTC 2013
>Originator:     Simon Barner
>Release:        FreeBSD 4.9-PRERELEASE i386
>Organization:
>Environment:
System: FreeBSD zi025.glhnet.mhn.de 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #0: Thu Sep 4 17:34:02 CEST 2003 simon@zi025.glhnet.mhn.de:/usr/src/sys/compile/KISTE i386

From dmesg:
[...]
Timecounter "i8254"  frequency 1193182 Hz
CPU: AMD-K6(tm) 3D+ Processor (400.91-MHz 586-class CPU)
Origin = "AuthenticAMD"  Id = 0x591  Stepping = 1
Features=0x8021bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,PGE,MMX>
AMD Features=0x80000800<SYSCALL,3DNow!>
real memory  = 201326592 (196608K bytes)
avail memory = 192172032 (187668K bytes)
Preloaded elf kernel "kernel" at 0xc03ab000.
Preloaded userconfig_script "/boot/kernel.conf" at 0xc03ab09c.
Preloaded elf module "bktr_mem.ko" at 0xc03ab0ec.
Preloaded elf module "bktr.ko" at 0xc03ab18c.
bktr_mem: memory holder loaded
netsmb_dev: loaded
K6-family MTRR support enabled (2 registers)
md0: Malloc disk
[...]

>Description:
I noticed that linprocfs' cpuinfo gives me the wrong CPU model
(according to the cpu_id, which is 0x591, it should be 9 instead of 5).

% cat /compat/linux/proc/cpuinfo 
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 5
model           : 5  <--- wrong!
stepping        : 1
flags           : fpu vme de pse tsc msr mce cx8 pge mmx
cpu MHz         : 400.91
bogomips        : 400.91

I came across the problem when I tried the latest Mplayer pre-release,
which is not yet in the ports. Its configure script uses FreeBSD's
linprocfs in order to determine the CPU it is being compiled on.

Of course, it would be an easy task to patch Mplayer's configure script,
which as a fallback cpu identification program (which uses the CPUID
assembler instruction and works correctly btw.). But, IMO this is a bug
in linprocfs and should be fixed.

>How-To-Repeat:
cat /compat/linux/proc/cpuinfo on 586+ class CPUs.

>Fix:

Since I do not know a lot about i386-class processor detection, my
suggestions might be wrong, but I'll send them anyway:

As far as I can see, the problem is here:

i386/linux/linprocfs/linprocfs_misc.c, l. 199

	switch (cpu_class) {
	case CPUCLASS_286:
		class = 2;
		break;
	case CPUCLASS_386:
		class = 3;
		break;
	case CPUCLASS_486:
		class = 4;
		break;
	case CPUCLASS_586:
		class = 5;
		break;
	case CPUCLASS_686:
		class = 6;
		break;
	default:
                class = 0;
		break;
	}

	ps = psbuf;
	ps += sprintf(ps,
			"processor\t: %d\n"
			"vendor_id\t: %.20s\n"
			"cpu family\t: %d\n"
			"model\t\t: %d\n"
			"stepping\t: %d\n",
			0, cpu_vendor, class, cpu, cpu_id & 0xf);

        ps += sprintf(ps,
                        "flags\t\t:");

Since pre-i586 CPUs do not support the CPUID instruction and cpu_id is
not set on these CPUs (I am right here?), the information is collected
from cpu_class, cpu (and cpu_id for the stepping).

AFAIK, on a i586+class CPU, one could extract all the information from the
cpu_id variable:

   0, cpu_vendor, cpu_id & 0xf00, cpu_id & 0xf0, cpu_id & 0xf);
   
I am not sure if there is a `model' specification for pre-i586 CPUs, and
if there is one, how to extract it.

Perhaps this here might be a solution, that keeps compatibility with
older CPUs, but sets the model for newer ones correctly:

   0, cpu_vendor, class, cpu_id & 0xf0, cpu_id & 0xf);
>Release-Note:
>Audit-Trail:

From: Marcin Cieslak <saper@SYSTEM.PL>
To: bug-followup@FreeBSD.org, barner@in.tum.de
Cc:  
Subject: Re: kern/56451: /compat/linux/proc/cpuinfo gives wrong CPU model
Date: Fri, 11 Jul 2008 23:09:26 +0200

 This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
 --------------enigB813C209E6BCC01CB50B348B
 Content-Type: text/plain; charset=ISO-8859-2; format=flowed
 Content-Transfer-Encoding: quoted-printable
 
 I think this was fixed with rev1.95 of linprocfs.c in Jun 2006.
 
 I know it's a bit old, but possibly you can verify this?
 
 --=20
                << Marcin Cieslak // saper@system.pl >>
 
 
 --------------enigB813C209E6BCC01CB50B348B
 Content-Type: application/pgp-signature; name="signature.asc"
 Content-Description: OpenPGP digital signature
 Content-Disposition: attachment; filename="signature.asc"
 
 -----BEGIN PGP SIGNATURE-----
 
 iQCVAwUBSHfMCj2W2v2wY27ZAQNqFgP8DpxKtiI5ce11NXcaBfZRiMtLnmQ3dFUC
 qF5HPYeCgdx7G08+4frbHXp3PdBQcMbr6scJBPGsaUlkMR7HgAV8YL6JK9vC2YQQ
 5K39KEcUKkzXfYyDJ7ta77AEYVS9wyIjmaOJ16fcn7ZnuqlSqUCihw8obChhaoNY
 uIf1zRETGi4=
 =VJ6x
 -----END PGP SIGNATURE-----
 
 --------------enigB813C209E6BCC01CB50B348B--
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Sat Jul 12 06:45:12 UTC 2008 
State-Changed-Why:  
Note that submitter has been asked for feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56451 
State-Changed-From-To: feedback->open 
State-Changed-By: gavin 
State-Changed-When: Thu Apr 16 11:36:04 UTC 2009 
State-Changed-Why:  
Over to maintainer(s). 


Responsible-Changed-From-To: freebsd-bugs->freebsd-emulation 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Thu Apr 16 11:36:04 UTC 2009 
Responsible-Changed-Why:  
Put back into the "open" state.  Although no feedback was received, as far 
as I can tell hte code hasn't changed, and this bug should be easy for 
somebody familiar with linprocfs to verify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56451 

From: Alexander Best <alexbestms@math.uni-muenster.de>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: kern/56451: [linprocfs] /compat/linux/proc/cpuinfo gives wrong
 CPU model
Date: Wed, 16 Sep 2009 00:50:15 +0200 (CEST)

 i can confirm that this problem still exists in 9.0-CURRENT (FreeBSD otaku
 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r197043: Sat Sep 12 01:07:56 CEST 2009
 root@otaku:/usr/obj/usr/src/sys/ARUNDEL  i386).
 
 from `dmesg`:
 
 Timecounter "i8254" frequency 1193182 Hz quality 0
 CPU: Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz (1800.01-MHz 686-class
 CPU)
   Origin = "GenuineIntel"  Id = 0x6fd  Stepping = 13
   Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
   Features2=0xe39d<SSE3,DTES64,MON,DS_CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM>
   AMD Features=0x20100000<NX,LM>
   AMD Features2=0x1<LAHF>
   TSC: P-state invariant
 
 
 from `cat /compat/linux/proc/cpuinfo`:
 
 processor       : 0
 vendor_id       : GenuineIntel
 cpu family      : 6
 model           : 7
 model name      : Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
 stepping        : 13
 processor       : 1
 vendor_id       : GenuineIntel
 cpu family      : 6
 model           : 7
 model name      : Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
 stepping        : 13
 flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
 cmov pat pse36 b19 b21 mmxext mmx fxsr xmm sse2 b27 b28 b29 3dnow
 cpu MHz         : 1800.01
 bogomips        : 1800.01
 
 cheers.
 alex

From: Alexander Best <alexbestms@wwu.de>
To: <bug-followup@FreeBSD.org>
Cc: Simon Barner <barner@in.tum.de>
Subject: Re: kern/56451: [linprocfs] /compat/linux/proc/cpuinfo gives wrong
 CPU model
Date: Wed, 10 Feb 2010 02:29:19 +0100 (CET)

   This is a MIME encoded multipart message.
 
 --+permail-20100210012919f7e55a9d00006fa1-a_best01+
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 seems cpuinfo is broken too under amd64. this is the output i get:
 
 processor       : 0
 vendor_id       : GenuineIntel
 cpu family      : 15
 model           : 1
 model name      : Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
 stepping        : 13
 processor       : 1
 vendor_id       : GenuineIntel
 cpu family      : 15
 model           : 1
 model name      : Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
 stepping        : 13
 flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
 cmov pat pse36 b19 b21 mmxext mmx fxsr xmm sse2 b27 b28 b29 3dnow
 cpu MHz         : 1800.01
 bogomips        : 1800.01
 
 since dmesg says
 
 Origin = "GenuineIntel"  Id = 0x6fd  Stepping = 13
 
 the values for model and cpu family are wrong.
 
 with the patch (well lets call it hack ;)) attached the output changes to
 
 processor       : 0
 vendor_id       : GenuineIntel
 cpu family      : 6
 model           : 15
 model name      : Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
 stepping        : 13
 processor       : 1
 vendor_id       : GenuineIntel
 cpu family      : 6
 model           : 15
 model name      : Intel(R) Pentium(R) Dual  CPU  E2160  @ 1.80GHz
 stepping        : 13
 flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
 cmov pat pse36 b19 b21 mmxext mmx fxsr xmm sse2 b27 b28 b29 3dnow
 cpu MHz         : 1800.01
 bogomips        : 1800.01
 
 which i believe is what the output should look like. maybe somebody could shed
 some light on this. maybe by starting to look for the place where "class" and
 "cpu" are being defined?
 
 cheers.
 alex
 
 --+permail-20100210012919f7e55a9d00006fa1-a_best01+
 Content-Type: text/plain
 Content-Transfer-Encoding: Base64
 Content-Disposition: attachment; filename="linprocfs.patch.txt"
 
 SW5kZXg6IHN5cy9jb21wYXQvbGlucHJvY2ZzL2xpbnByb2Nmcy5jCj09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5
 cy9jb21wYXQvbGlucHJvY2ZzL2xpbnByb2Nmcy5jCShyZXZpc2lvbiAyMDM3MTMpCisrKyBzeXMv
 Y29tcGF0L2xpbnByb2Nmcy9saW5wcm9jZnMuYwkod29ya2luZyBjb3B5KQpAQCAtMjczLDcgKzI3
 Myw3IEBACiAJCSAgICAibW9kZWxcdFx0OiAlZFxuIgogCQkgICAgIm1vZGVsIG5hbWVcdDogJXNc
 biIKIAkJICAgICJzdGVwcGluZ1x0OiAlZFxuIiwKLQkJICAgIGksIGNwdV92ZW5kb3IsIGNsYXNz
 LCBjcHUsIG1vZGVsLCBjcHVfaWQgJiAweGYpOworCQkgICAgaSwgY3B1X3ZlbmRvciwgKGNwdV9p
 ZCAmIDB4ZjAwKSA+PiA4LCAoY3B1X2lkICYgMHhmMCkgPj4gNCwgbW9kZWwsIGNwdV9pZCAmIDB4
 Zik7CiAJCS8qIFhYWCBwZXItY3B1IHZlbmRvciAvIGNsYXNzIC8gbW9kZWwgLyBpZD8gKi8KIAl9
 CiAK
 
 --+permail-20100210012919f7e55a9d00006fa1-a_best01+--

From: Alexander Best <alexbestms@wwu.de>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: kern/56451: [linprocfs] /compat/linux/proc/cpuinfo gives wrong
 CPU model
Date: Sat, 27 Feb 2010 02:32:53 +0100 (CET)

   This is a MIME encoded multipart message.
 
 --+permail-201002270132531e86ffa800006210-a_best01+
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 actually it appears the patch i submitted isn't that hackish. this is exactly
 what's being done in i386/i386/identcpu.c and amd64/amd64/identcpu.c to output
 the cpu stepping.
 
 cheers.
 alex
 
 --+permail-201002270132531e86ffa800006210-a_best01+
 Content-Type: text/plain
 Content-Transfer-Encoding: Base64
 Content-Disposition: attachment; filename="linprocfs.c.patch.txt"
 
 SW5kZXg6IHN5cy9jb21wYXQvbGlucHJvY2ZzL2xpbnByb2Nmcy5jCj09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5
 cy9jb21wYXQvbGlucHJvY2ZzL2xpbnByb2Nmcy5jCShyZXZpc2lvbiAyMDQzNzQpCisrKyBzeXMv
 Y29tcGF0L2xpbnByb2Nmcy9saW5wcm9jZnMuYwkod29ya2luZyBjb3B5KQpAQCAtMjczLDcgKzI3
 Myw3IEBACiAJCSAgICAibW9kZWxcdFx0OiAlZFxuIgogCQkgICAgIm1vZGVsIG5hbWVcdDogJXNc
 biIKIAkJICAgICJzdGVwcGluZ1x0OiAlZFxuIiwKLQkJICAgIGksIGNwdV92ZW5kb3IsIGNsYXNz
 LCBjcHUsIG1vZGVsLCBjcHVfaWQgJiAweGYpOworCQkgICAgaSwgY3B1X3ZlbmRvciwgKGNwdV9p
 ZCAmIDB4ZjAwKSA+PiA4LCAoY3B1X2lkICYgMHhmMCkgPj4gNCwgbW9kZWwsIGNwdV9pZCAmIDB4
 Zik7CiAJCS8qIFhYWCBwZXItY3B1IHZlbmRvciAvIGNsYXNzIC8gbW9kZWwgLyBpZD8gKi8KIAl9
 CiAK
 
 --+permail-201002270132531e86ffa800006210-a_best01+--

From: Alexander Best <alexbestms@wwu.de>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: kern/56451: [linprocfs] /compat/linux/proc/cpuinfo gives wrong
 CPU model
Date: Sat, 27 Feb 2010 02:53:24 +0100 (CET)

 to committer: please turn all the %d's into %u's since cpu_vendor and cpu_id
 are unsigned.
 
 cheers.
 alex

From: Alexander Best <alexbestms@wwu.de>
To: <bug-followup@FreeBSD.org>
Cc:  
Subject: Re: kern/56451: [linprocfs] /compat/linux/proc/cpuinfo gives wrong
 CPU model
Date: Sat, 27 Feb 2010 03:46:23 +0100 (CET)

   This is a MIME encoded multipart message.
 
 --+permail-2010022702462380e26a0b00001b04-a_best01+
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 here's a final cleaned up patch using macros instead of direct AND's and
 shifts.
 
 alex
 
 --+permail-2010022702462380e26a0b00001b04-a_best01+
 Content-Type: text/plain
 Content-Transfer-Encoding: Base64
 Content-Disposition: attachment; filename="linprocfs.c.patch.txt"
 
 SW5kZXg6IHN5cy9jb21wYXQvbGlucHJvY2ZzL2xpbnByb2Nmcy5jCj09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5
 cy9jb21wYXQvbGlucHJvY2ZzL2xpbnByb2Nmcy5jCShyZXZpc2lvbiAyMDQzODMpCisrKyBzeXMv
 Y29tcGF0L2xpbnByb2Nmcy9saW5wcm9jZnMuYwkod29ya2luZyBjb3B5KQpAQCAtMjY5LDExICsy
 NjksMTEgQEAKIAkJc2J1Zl9wcmludGYoc2IsCiAJCSAgICAicHJvY2Vzc29yXHQ6ICVkXG4iCiAJ
 CSAgICAidmVuZG9yX2lkXHQ6ICUuMjBzXG4iCi0JCSAgICAiY3B1IGZhbWlseVx0OiAlZFxuIgot
 CQkgICAgIm1vZGVsXHRcdDogJWRcbiIKKwkJICAgICJjcHUgZmFtaWx5XHQ6ICV1XG4iCisJCSAg
 ICAibW9kZWxcdFx0OiAldVxuIgogCQkgICAgIm1vZGVsIG5hbWVcdDogJXNcbiIKLQkJICAgICJz
 dGVwcGluZ1x0OiAlZFxuIiwKLQkJICAgIGksIGNwdV92ZW5kb3IsIGNsYXNzLCBjcHUsIG1vZGVs
 LCBjcHVfaWQgJiAweGYpOworCQkgICAgInN0ZXBwaW5nXHQ6ICV1XG4iLAorCQkgICAgaSwgY3B1
 X3ZlbmRvciwgQ1BVSURfVE9fRkFNSUxZKGNwdV9pZCksIENQVUlEX1RPX01PREVMKGNwdV9pZCks
 IG1vZGVsLCBjcHVfaWQgJiBDUFVJRF9TVEVQUElORyk7CiAJCS8qIFhYWCBwZXItY3B1IHZlbmRv
 ciAvIGNsYXNzIC8gbW9kZWwgLyBpZD8gKi8KIAl9CiAK
 
 --+permail-2010022702462380e26a0b00001b04-a_best01+--
Responsible-Changed-From-To: freebsd-emulation->des 
Responsible-Changed-By: des 
Responsible-Changed-When: Wed Mar 24 21:40:37 UTC 2010 
Responsible-Changed-Why:  
linprocfs is mine. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56451 

From: Alexander Best <arundel@freebsd.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/56451: [linprocfs] [patch] /compat/linux/proc/cpuinfo gives wrong CPU model
Date: Wed, 3 Nov 2010 12:40:28 +0000

 any update on this issue? for me the last patch i submitted as followup to this
 PR works.
 
 cheers.
 alex
 
 -- 
 a13x

From: Alexander Best <arundel@freebsd.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: kern/56451: [linprocfs] [patch] /compat/linux/proc/cpuinfo gives wrong CPU model
Date: Wed, 3 Nov 2010 12:59:15 +0000

 --YZ5djTAD1cGYuMQK
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 this patch should apply cleanly to HEAD.
 
 cheers.
 alex
 
 -- 
 a13x
 
 --YZ5djTAD1cGYuMQK
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="linprocfs.c.diff"
 
 diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
 index 76c8c37..88b9150 100644
 --- a/sys/compat/linprocfs/linprocfs.c
 +++ b/sys/compat/linprocfs/linprocfs.c
 @@ -276,11 +276,11 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
  		sbuf_printf(sb,
  		    "processor\t: %d\n"
  		    "vendor_id\t: %.20s\n"
 -		    "cpu family\t: %d\n"
 -		    "model\t\t: %d\n"
 +		    "cpu family\t: %u\n"
 +		    "model\t\t: %u\n"
  		    "model name\t: %s\n"
 -		    "stepping\t: %d\n\n",
 -		    i, cpu_vendor, class, cpu, model, cpu_id & 0xf);
 +		    "stepping\t: %u\n\n",
 +		    i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING);
  		/* XXX per-cpu vendor / class / model / id? */
  	}
  
 
 --YZ5djTAD1cGYuMQK--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/56451: commit references a PR
Date: Mon,  8 Nov 2010 12:04:46 +0000 (UTC)

 Author: des
 Date: Mon Nov  8 12:04:41 2010
 New Revision: 214982
 URL: http://svn.freebsd.org/changeset/base/214982
 
 Log:
   Fix CPU ID in /proc/cpuinfo.
   
   PR:		kern/56451
   Submitted by:	arundel@
   MFC after:	3 weeks
 
 Modified:
   head/sys/compat/linprocfs/linprocfs.c
 
 Modified: head/sys/compat/linprocfs/linprocfs.c
 ==============================================================================
 --- head/sys/compat/linprocfs/linprocfs.c	Mon Nov  8 11:22:55 2010	(r214981)
 +++ head/sys/compat/linprocfs/linprocfs.c	Mon Nov  8 12:04:41 2010	(r214982)
 @@ -276,11 +276,11 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
  		sbuf_printf(sb,
  		    "processor\t: %d\n"
  		    "vendor_id\t: %.20s\n"
 -		    "cpu family\t: %d\n"
 -		    "model\t\t: %d\n"
 +		    "cpu family\t: %u\n"
 +		    "model\t\t: %u\n"
  		    "model name\t: %s\n"
 -		    "stepping\t: %d\n\n",
 -		    i, cpu_vendor, class, cpu, model, cpu_id & 0xf);
 +		    "stepping\t: %u\n\n",
 +		    i, cpu_vendor, CPUID_TO_FAMILY(cpu_id), CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING);
  		/* XXX per-cpu vendor / class / model / id? */
  	}
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: arundel 
State-Changed-When: Fri Jan 28 19:05:39 UTC 2011 
State-Changed-Why:  
Fixed in HEAD (214982). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56451 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Fri Mar 15 23:41:39 UTC 2013 
State-Changed-Why:  
MFCed/fixed by now or it will never be MFCed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=56451 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/56451: commit references a PR
Date: Sat, 16 Mar 2013 22:43:21 +0000 (UTC)

 Author: des
 Date: Sat Mar 16 22:43:08 2013
 New Revision: 248390
 URL: http://svnweb.freebsd.org/changeset/base/248390
 
 Log:
   MFH (r214982, r214985): fix CPU ID in /proc/cpuinfo.
   
   PR:             kern/56451
   Approved by:	re (kib)
 
 Modified:
   stable/8/sys/compat/linprocfs/linprocfs.c
 Directory Properties:
   stable/8/sys/   (props changed)
   stable/8/sys/compat/   (props changed)
 
 Modified: stable/8/sys/compat/linprocfs/linprocfs.c
 ==============================================================================
 --- stable/8/sys/compat/linprocfs/linprocfs.c	Sat Mar 16 22:40:20 2013	(r248389)
 +++ stable/8/sys/compat/linprocfs/linprocfs.c	Sat Mar 16 22:43:08 2013	(r248390)
 @@ -276,11 +276,12 @@ linprocfs_docpuinfo(PFS_FILL_ARGS)
  		sbuf_printf(sb,
  		    "processor\t: %d\n"
  		    "vendor_id\t: %.20s\n"
 -		    "cpu family\t: %d\n"
 -		    "model\t\t: %d\n"
 +		    "cpu family\t: %u\n"
 +		    "model\t\t: %u\n"
  		    "model name\t: %s\n"
 -		    "stepping\t: %d\n",
 -		    i, cpu_vendor, class, cpu, model, cpu_id & 0xf);
 +		    "stepping\t: %u\n\n",
 +		    i, cpu_vendor, CPUID_TO_FAMILY(cpu_id),
 +		    CPUID_TO_MODEL(cpu_id), model, cpu_id & CPUID_STEPPING);
  		/* XXX per-cpu vendor / class / model / id? */
  	}
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
