Subject: port-vax/27218: kernel incorrectly identifies a KA692 CPU as a KA694 during boot
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <kirk@ba23.org>
List: netbsd-bugs
Date: 10/10/2004 23:54:03
>Number:         27218
>Category:       port-vax
>Synopsis:       kernel incorrectly identifies a KA692 CPU as a KA694 during boot
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-vax-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 10 23:55:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Kirk Russell
>Release:        1.6.2 and 2.0_BETA
>Organization:
Bridlewood Software Testers Guild
>Environment:
VAX 4000 model 700A with a KA692 CPU
>Description:
When I boot NetBSD 1.6.2 on a VAX 4000 model 700A, with a KA692 CPU, the
kernel incorrectly guesses that I have a KA694 CPU:
    NetBSD 1.6.2 (GENERIC) #0: Wed Feb 11 09:22:23 UTC 2004
        autobuild@tgm.netbsd.org:/autobuild/netbsd-1-6-PATCH002/vax/OBJ/autobuil
d/netbsd-1-6-PATCH002/src/sys/arch/vax/compile/GENERIC
    VAX 4000/705A
    cpu0: KA694, ucode rev 2


When I boot NetBSD 2.0 BETA (200406230000), it also guesses incorrectly:
    NetBSD 2.0_BETA (GENERIC) #0: Mon Jun 28 07:27:40 UTC 2004
            autobuild@tgm.netbsd.org:/autobuild/netbsd-2-0/vax/OBJ/autobuild/net
bsd-2-0/src/sys/arch/vax/compile/GENERIC

    VAX 4000/705A
    cpu0: KA694, ucode rev 2


But when I boot OpenBSD OpenBSD 3.5, it guesses the CPU type correctly:
    OpenBSD 3.5 (GENERIC) #41: Mon Mar 29 12:38:53 MST 2004
        deraadt@vax.openbsd.org:/usr/src/sys/arch/vax/compile/GENERIC
    VAX 4000 700A [13000202 05231001]
    cpu0: KA692, ucode rev 2

>How-To-Repeat:
Boot the NetBSD kernel, under test, on my VAX 4000 model 700A, with a KA692 CPU.
>Fix:
Merged in two KA692 changes from OpenBSD:
http://www.openbsd.org/cgi-bin/cvsweb/src/sys/arch/vax/vax/ka680.c.diff?r1=1.4.4.5&r2=1.4.4.6
http://www.openbsd.org/cgi-bin/cvsweb/src/sys/arch/vax/vax/locore.c.diff?r1=1.9.12.6&r2=1.9.12.7

$ cvs diff ka680.c
Index: ka680.c
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/vax/ka680.c,v
retrieving revision 1.9
diff -r1.9 ka680.c
131c131
<                       case VAX_STYP_694: cpuname = "KA694"; break;
---
>                       case VAX_STYP_694: cpuname = (vax_cpudata & 0x1000) ? "KA694" : "KA692"; break;

$ cvs diff locore.c
Index: locore.c
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/vax/locore.c,v
retrieving revision 1.68
diff -r1.68 locore.c
273c273
<                       strcpy(cpu_model,"VAX 4000/705A"); break;
---
>                       strcpy(cpu_model,(vax_cpudata & 0x1000) ? "VAX 4000/705A" : "VAX 4000/700A"); break;

And now I get:
NetBSD 1.6.2 (BRONZEVAX) #2: Sun Oct 10 19:50:04 EDT 2004
    root@bronzevax:/usr/src/sys/arch/vax/compile/BRONZEVAX
 
VAX 4000/700A
cpu0: KA692, ucode rev 2

>Release-Note:
>Audit-Trail:
>Unformatted: