NetBSD Problem Report #49124

From www@NetBSD.org  Mon Aug 18 21:07:22 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B8A11ADFF3
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 18 Aug 2014 21:07:22 +0000 (UTC)
Message-Id: <20140818210721.2C474ADFF4@mollari.NetBSD.org>
Date: Mon, 18 Aug 2014 21:07:21 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: Soekris net4501 panics during boot after merge of "tls-earlyentropy" to HEAD
X-Send-Pr-Version: www-1.0

>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:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 18 21:10:00 +0000 2014
>Closed-Date:    Tue Jan 13 10:01:21 +0000 2015
>Last-Modified:  Tue Jan 13 10:01:21 +0000 2015
>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:/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:/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);

>Release-Note:

>Audit-Trail:
From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: "William D. Jones" <thor0505@comcast.net>
Subject: Re: kern/49124: Soekris net4501 panics during boot after merge of
 "tls-earlyentropy" to HEAD
Date: Thu, 8 Jan 2015 14:06:05 -0600 (CST)

 The following commit by christos@ fixes the problem:

   http://mail-index.netbsd.org/source-changes/2015/01/08/msg062260.html

 It was posted to port-i386/49104.  It is not clear to me that this is
 the same problem reported there, but is likely related.

 Once pulled up to netbsd-7, this PR may be closed

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/49124 CVS commit: [netbsd-7] src/sys/kern
Date: Fri, 9 Jan 2015 14:06:55 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Jan  9 14:06:55 UTC 2015

 Modified Files:
 	src/sys/kern [netbsd-7]: kern_rndq.c

 Log Message:
 Pull up following revision(s) (requested by christos in ticket #397):
 	sys/kern/kern_rndq.c: revision 1.29
 PR 49104: Jarle Greipsland: Don't use cpu_counter32() unconditionally.
 PR 49124: Soekris net4501 panics during boot after merge of "tls-earlyentropy" to HEAD


 To generate a diff of this commit:
 cvs rdiff -u -r1.26.2.2 -r1.26.2.3 src/sys/kern/kern_rndq.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: snj@NetBSD.org
State-Changed-When: Tue, 13 Jan 2015 10:01:21 +0000
State-Changed-Why:
Pulled up.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.