From owner-freebsd-arm@FreeBSD.ORG Sat May 4 22:44:41 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6633E752 for ; Sat, 4 May 2013 22:44:41 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 2CA253C6 for ; Sat, 4 May 2013 22:44:40 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r44MicVZ022335; Sat, 4 May 2013 22:44:38 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id 3art5is5gmh9ttydkcee8jkt7e; Sat, 04 May 2013 22:44:38 +0000 (UTC) (envelope-from tim@kientzle.com) Subject: Re: Is this related to the general panic discussed in freebsd-current? Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: Date: Sat, 4 May 2013 15:44:37 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <6D0E82C9-79D1-4804-9B39-3440F99AA8FE@kientzle.com> References: <51835891.4050409@thieprojects.ch> <03971BD1-4ADE-4435-BDD0-B94B62634F1D@bsdimp.com> <5183BF8C.4040406@thieprojects.ch> To: Tim Kientzle X-Mailer: Apple Mail (2.1283) 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: Sat, 04 May 2013 22:44:41 -0000 On May 4, 2013, at 2:41 PM, Tim Kientzle wrote: >=20 > On May 3, 2013, at 6:45 AM, Werner Thie wrote: >=20 >> On 5/3/13 3:13 PM, Warner Losh wrote: >>> On May 3, 2013, at 12:26 AM, Werner Thie wrote: >>>=20 >>>> Hi all >>>>=20 >>>> just came around yesterday to start playing with crochet, built an = image and KDB entering panic when booting >>>>=20 >>>> FreeBSD 10.0-CURRENT #0 r250144M: Thu May 2 10:10:20 CEST 2013 >>>> = root@xtools:/usr/home/wthie/proj/crochet-freebsd/work/obj/arm.armv6/usr/lo= cal/src/sys/BEAGLEBONE arm >>>> FreeBSD clang version 3.3 (trunk 178860) 20130405 >>>> WARNING: WITNESS option enabled, expect reduced performance. >>>> panic: acquiring blockable sleep lock with spinlock or critical = section held (rw) pmap pv global @ = /usr/local/src/sys/arm/arm/pmap-v6.c:1187 >>>> KDB: enter: panic >>>> [ thread pid 0 tid 0 ] >>>> Stopped at $d: ldrb r15, [r15, r15, ror r15]! >=20 > I think I've managed to isolate this to the stack_capture function in = sys/arm/arm/stack_machdep.c. >=20 > Here's the breadcrumb trail I've followed so far: >=20 > 1. Witness is complaining about pmap_fault_fixup trying to acquire the = "pmap pv global" lock before it dies. >=20 > 2. Inserted printfs, found that pmap_fault_fixup was being called from = data_abort_handler (in sys/arm/arm/trap.c). >=20 > 3. Uncommenting the printf in data_abort_handler gives the next step: >=20 > data abort: fault address=3D0xe28db008 (from pc=3D0xc0519d08 = lr=3D0xc0519d14) >=20 > 4. According to objdump, the PC address above is in stack_save = (actually, the inlined version of stack_capture), in = sys/arm/arm/stack_machdep.c. >=20 > If I add a printf() to the middle of stack_capture, the kernel boots. = So it definitely smells like a code-generation error of some sort. >=20 > I'm going to start digging through the assembly next. I'm baffled. If I insert a printf into the loop in stack_capture, the = kernel boots. But the generated assembly looks perfectly correct to me in either case. So inserting the printf must have some side-effect. The stack does end up aligned differently: The failing version puts 16 = bytes on the stack, the working version puts 24 bytes. But I can't figure out = how that would explain what I'm seeing... Tim