NetBSD-Bugs archive

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

kern/49124: Soekris net4501 panics during boot after merge of "tls-earlyentropy" to HEAD



>Number:         49124
>Category:       kern
>Synopsis:       Soekris net4501 panics during boot after merge of 
>"tls-earlyentropy" to HEAD
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 18 21:10:00 +0000 2014
>Originator:     John D. Baker
>Release:        NetBSD/i386-6.99.49 (10-Aug-2014 16:45 UTC), 
>NetBSD/i386-7.99.1, NetBSD/i386-7.0_BETA
>Organization:
>Environment:
NetBSD net4501d.technoskunk.fur 7.99.1 NetBSD 7.99.1 (NET4501) #1: Wed Aug 13 
12:14:29 CDT 2014  
sysop%verthandi.technoskunk.fur@localhost:/d0/build/current/obj/i386/sys/arch/i386/compile/NET4501
 i386

>Description:
Soekris net4501 panics during boot with:

NetBSD 7.99.1 (NET4501) #1: Wed Aug 13 12:14:29 CDT 2014
        
sysop%verthandi.technoskunk.fur@localhost:/d0/build/current/obj/i386/sys/arch/i386/compile/NET4501
total memory = 65148 KB
avail memory = 59884 KB
kern.module.path=/stand/i386/7.99.1/modules
fatal privileged instruction fault in supervisor mode
trap type 0 code 0 eip c0155690 cs 8 eflags 10286 cr2 0 ilevel 8 esp c02164d8
curlwp 0xc03dd9a0 pid 0 lid 1 lowest kstack 0xc04ff2c0
kernel: supervisor trap privileged instruction fault, code=0
Stopped in pid 0.1 (system) at  netbsd:cpu_counter32:   rdtsc
db{0}> bt
cpu_counter32(c03f135a,2,6,0,c04fe00c,504000,c0500fa0,c030b5b9,5,0) at netbsd:cp
u_counter32
rnd_init(5,0,0,ffff,c04fe00c,4fe000,504000,0,c01002de,0) at netbsd:rnd_init+0x2b
[machine reboots]

Also seen with GENERIC kernel.
>How-To-Repeat:
Using an i386 GENERIC or NET4501 kernel from sources after the
merge of "tls-earlyentropy" to HEAD, attempt to boot a Soekris net4501
system.
>Fix:
"sys/kern/kern_rndq.c" eliminated the call to "cpu_hascounter()" that
guarded whether "cpu_counter32()" was used in "rnd_init()".

The following patch restores the previous behavior (patch against
netbsd-7 sources for expediency as my -HEAD tree will take too
long to rebuild and test):

Index: sys/kern/kern_rndq.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_rndq.c,v
retrieving revision 1.26.2.1
diff -u -p -r1.26.2.1 kern_rndq.c
--- sys/kern/kern_rndq.c        11 Aug 2014 15:38:27 -0000      1.26.2.1
+++ sys/kern/kern_rndq.c        18 Aug 2014 19:40:19 -0000
@@ -222,7 +222,8 @@ rnd_counter(void)
        uint32_t ret;
 
 #if defined(__HAVE_CPU_COUNTER)
-       return (cpu_counter32());
+       if (cpu_hascounter())
+               return (cpu_counter32());
 #endif
        if (rnd_ready) {
                nanouptime(&ts);



Home | Main Index | Thread Index | Old Index