From owner-freebsd-arm@FreeBSD.ORG Tue Apr 16 23:44:58 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C23D3521 for ; Tue, 16 Apr 2013 23:44:58 +0000 (UTC) (envelope-from damjan.marion@gmail.com) Received: from mail-ea0-x229.google.com (mail-ea0-x229.google.com [IPv6:2a00:1450:4013:c01::229]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF061E9F for ; Tue, 16 Apr 2013 23:44:58 +0000 (UTC) Received: by mail-ea0-f169.google.com with SMTP id n15so483649ead.28 for ; Tue, 16 Apr 2013 16:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:content-type:mime-version:subject:from:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer; bh=jWiUZnqA9WknswE3UhvXBSLsZr/x6HZQ7DKNiLhxFjg=; b=L6O4Ik1/3Rv5+N2bBqSWakuSYWU6akTkklpFkmNgpCjQCznXdZLlKT4qDDzNF0wo2K o5RcDJ6xMA6mVBBydohEUwmB4OuHtoou89viwrpXmHg8CQPLSakqcTGbMR0aCuwMR5/V I/G5UwaDoe8z35oLHvQim5emfjYIGt1V0eMYcJp/M5gcfUgnk1OGkU9UXLQgirl5HXTk kZpwzZvO94Tba+8E2OlPGzdZQdTcbDGXFlXPKIhnfI1Y/mPgipfZjK2FG/RaA0alHO7v Rd6GjS6L8b1Te3MzQhSvCqA+INzvImH8BxB6JVILJLHJMx7H+vcjU4uROLWw6ZO1H1hq uJcg== X-Received: by 10.15.22.76 with SMTP id e52mr11854454eeu.7.1366155897418; Tue, 16 Apr 2013 16:44:57 -0700 (PDT) Received: from damarion-mac.home (cpe-109-60-68-57.zg3.cable.xnet.hr. [109.60.68.57]) by mx.google.com with ESMTPS id cb50sm5400014eeb.14.2013.04.16.16.44.55 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Apr 2013 16:44:56 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: __rw_wlock_hard panic on 1st malloc From: Damjan Marion In-Reply-To: Date: Wed, 17 Apr 2013 01:44:54 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <92C60946-8FFB-46A1-9400-9E0F7B11FC23@gmail.com> References: <8DE83B01-4508-41C5-B2BD-95A72D0AD963@bsdimp.com> To: Warner Losh X-Mailer: Apple Mail (2.1503) Cc: "freebsd-arm@FreeBSD.org" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 23:44:58 -0000 When I apply your patch I'm getting the same error but this time in = busdma_init(). Again it is 1st malloc() inside busdma_bufalloc_create(). Can anybody confirm that latest HEAD is working on other Cortex-A CPUs? Damjan On Apr 17, 2013, at 12:43 AM, Warner Losh wrote: > The problem here is a double fault. The first fault is in = init_dynamic_kenv when we try to read the kernel environment. The second = fault happens because we don't wind up in the debugger (I think due to = reading the stack goes awry). >=20 > I've fixed the first problem in r249570. >=20 > Not sure what's going on beyond that, since after fixing that I hit a = similar issue in stack_copy() but without a traceback, it is kinda hard. >=20 > This is on my MarsBoard with an allwinner tech's A10 CPU. >=20 > Warner >=20 >=20 > On Apr 14, 2013, at 12:51 PM, Damjan Marion wrote: >=20 >>=20 >> I doubt. init_dynamic_kenv() is called by sysinit as part of standard = sysinit sequence and=20 >> it is called after kmeminit(). >>=20 >> There is no my custom code except standard parts of initarm = initialisation. >>=20 >> Damjan >>=20 >> On Apr 14, 2013, at 7:19 PM, Warner Losh wrote: >>=20 >>> Maybe you are calling malloc before these locks are initialized? >>>=20 >>> Warner >>>=20 >>> On Apr 14, 2013, at 5:03 AM, Damjan Marion wrote: >>>=20 >>>>=20 >>>> Hi, >>>>=20 >>>> I'm playing a bit with i.MX6 based board (wandboard) and I have = serial console working but >>>> now it panics in init_dynamic_kenv() with the following error: >>>>=20 >>>> panic: __rw_wlock_hard: recursing but non-recursive rw pmap pv = global @ /usr/src/sys/arm/arm/pmap-v6.c:1187 >>>>=20 >>>> It looks like this is the 1st place where malloc() is called, an = malloc returns valid VA >>>> but 1st attempt to access that address produces panic above. >>>>=20 >>>> Any idea what can be the reason for this or any other hint? >>>>=20 >>>> Thanks, >>>>=20 >>>> Damjan >>>> _______________________________________________ >>>> freebsd-arm@freebsd.org mailing list >>>> http://lists.freebsd.org/mailman/listinfo/freebsd-arm >>>> To unsubscribe, send any mail to = "freebsd-arm-unsubscribe@freebsd.org" >>>=20 >>=20 >=20