Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Jul 1999 10:18:50 +0200
From:      Thao et Hubert Tournier <hubert.tournier@online.fr>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/12896: Incorrect CPU model display at boot time
Message-ID:  <37A2B16A.D4159733@online.fr>

next in thread | raw e-mail | index | archive | help

>Number:         12896
>Category:       kern
>Synopsis:       Incorrect CPU model display at boot time
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 31 01:20:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     hubert.tournier@online.fr
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
home
>Environment:

Only for machines with AMD processors.

>Description:

At boot time, I've the following display :

CPU: \^E (400.91-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x58c  Stepping=12
  Features=0x8021bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,PGE,MMX>

instead of :

CPU: AMD K6-2 (400.91-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x58c  Stepping=12
  Features=0x8021bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8,PGE,MMX>

>How-To-Repeat:

Reboot. It's systematic.

>Fix:

In "/sys/i386/i386/identcpu.c", near line 313, the "cpu_model" variable
is
overwritten with the memcpy functions.

[...]
printcpuinfo(void)
{
	[...]
		do_cpuid(0x80000000, regs);
		nreg = regs[0];
		if (nreg >= 0x80000004) {
			do_cpuid(0x80000002, regs);
			memcpy(cpu_model, regs, sizeof regs);
			do_cpuid(0x80000003, regs);
			memcpy(cpu_model+16, regs, sizeof regs);
			do_cpuid(0x80000004, regs);
			memcpy(cpu_model+32, regs, sizeof regs);
		}
	[...]
}
[...]

Obviously, the cpu_model variable, a string, was not meant to receive
integer values.

As I don't understand the purpose of the do_cpuid function, I just wrap
this
part of the code with the following lines :

{
	char cpu_model_backup[128];
	[...]
	strcpy(cpu_model_backup, cpu_model);
	[block]
	strcpy(cpu_model, cpu_model_backup);
	[...]

It's a kludge but it fixes the problem ;-)

>Release-Note:
>Audit-Trail:
>Unformatted:
 X-send-pr-version: 3.2
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37A2B16A.D4159733>