From nobody@FreeBSD.org  Thu Jul 25 01:08:56 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 0276D83B
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 25 Jul 2013 01:08:56 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id E4666248F
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 25 Jul 2013 01:08:55 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r6P18tar021868
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 25 Jul 2013 01:08:55 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r6P18tkA021862;
	Thu, 25 Jul 2013 01:08:55 GMT
	(envelope-from nobody)
Message-Id: <201307250108.r6P18tkA021862@oldred.freebsd.org>
Date: Thu, 25 Jul 2013 01:08:55 GMT
From: Samuel Seay <lightningth@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FreeBSD v10.0 kernal panic on Raspberry Pi + Fix
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         180820
>Category:       arm
>Synopsis:       FreeBSD v10.0 kernal panic on Raspberry Pi + Fix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-arm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 25 01:10:00 UTC 2013
>Closed-Date:    Thu Jul 25 03:49:19 UTC 2013
>Last-Modified:  Thu Jul 25 03:50:01 UTC 2013
>Originator:     Samuel Seay
>Release:        10.0-CURRENT r253520M
>Organization:
>Environment:
no environment due to kernel panic
>Description:
Per the thread at http://lists.freebsd.org/pipermail/svn-src-head/2013-July/049735.html, I encountered the same issue when building a raspberry pi with the script at http://kernelnomicon.org/?p=275. After applying the patch I am able to fully boot the latest FreeBSD on my Raspberry Pi.

I do not see this patch in the latest tree nor do I see a bug report about the issue so I am filing this to bring attention to it and get the bug corrected, hopefully in the near future.
>How-To-Repeat:
Download the latest svn base head and compile the kernel for arm based on the script at http://kernelnomicon.org/?p=275. Attempt to boot the image on a raspberry pi after writing it to a sdcard.
>Fix:
Index: sys/vm/vm_map.c
===================================================================
--- sys/vm/vm_map.c     (revision 253514)
+++ sys/vm/vm_map.c     (working copy)
@@ -239,8 +239,7 @@
        vm_map_t map;
 
        map = (vm_map_t)mem;
-       map->nentries = 0;
-       map->size = 0;
+       memset(map, 0, sizeof(*map));
        mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | 
MTX_DUPOK);
        sx_init(&map->lock, "vm map (user)");
        return (0);

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: kientzle 
State-Changed-When: Thu Jul 25 03:48:52 UTC 2013 
State-Changed-Why:  
Committed patch. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: arm/180820: commit references a PR
Date: Thu, 25 Jul 2013 03:48:50 +0000 (UTC)

 Author: kientzle
 Date: Thu Jul 25 03:48:37 2013
 New Revision: 253636
 URL: http://svnweb.freebsd.org/changeset/base/253636
 
 Log:
   Clear entire map structure including locks so that the
   locks don't accidentally appear to have been already
   initialized.
   
   In particular, this fixes a consistent kernel crash on
   armv6 with:
     panic: lock "vm map (user)" 0xc09cc050 already initialized
   that appeared with r251709.
   
   PR: arm/180820
 
 Modified:
   head/sys/vm/vm_map.c
 
 Modified: head/sys/vm/vm_map.c
 ==============================================================================
 --- head/sys/vm/vm_map.c	Thu Jul 25 03:44:12 2013	(r253635)
 +++ head/sys/vm/vm_map.c	Thu Jul 25 03:48:37 2013	(r253636)
 @@ -239,8 +239,7 @@ vm_map_zinit(void *mem, int size, int fl
  	vm_map_t map;
  
  	map = (vm_map_t)mem;
 -	map->nentries = 0;
 -	map->size = 0;
 +	memset(map, 0, sizeof(*map));
  	mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | MTX_DUPOK);
  	sx_init(&map->lock, "vm map (user)");
  	return (0);
 _______________________________________________
 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:
