From owner-freebsd-arm@FreeBSD.ORG Fri May 10 05:17:12 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 5B3D7335 for ; Fri, 10 May 2013 05:17:12 +0000 (UTC) (envelope-from kientzle@freebsd.org) 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 205AAD6E for ; Fri, 10 May 2013 05:17:11 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id r4A5HAQD067362; Fri, 10 May 2013 05:17:10 GMT (envelope-from kientzle@freebsd.org) Received: from [192.168.2.123] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id xaz5abrea4i376vhymdsgbvk4e; Fri, 10 May 2013 05:17:10 +0000 (UTC) (envelope-from kientzle@freebsd.org) 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=windows-1252 From: Tim Kientzle In-Reply-To: <20130506124711.23978ec8@bender.lan> Date: Thu, 9 May 2013 22:17:09 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <51835891.4050409@thieprojects.ch> <03971BD1-4ADE-4435-BDD0-B94B62634F1D@bsdimp.com> <5183BF8C.4040406@thieprojects.ch> <6D0E82C9-79D1-4804-9B39-3440F99AA8FE@kientzle.com> <20130505140006.0d671ba5@bender> <20130505233729.63ac23bc@bender.lan> <724191A9-57F4-4D66-9E4A-EBBC13BDC0D1@freebsd.org> <20130506124711.23978ec8@bender.lan> To: Andrew Turner 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: Fri, 10 May 2013 05:17:12 -0000 On May 6, 2013, at 4:47 AM, Andrew Turner wrote: > On Sun, 5 May 2013 22:39:56 -0700 > Tim Kientzle wrote: >> Here's a version of stack_capture that allows a Clang-built >> OABI kernel with WITNESS enabled to boot: >>=20 >> /* In sys/arm/arm/stack_machdep.c */ >> static void >> stack_capture(struct stack *st, u_int32_t *frame) >> { >> vm_offset_t callpc; >>=20 >> stack_zero(st); >> while (INKERNEL(frame)) { >> callpc =3D frame[1]; >> if (stack_put(st, callpc) =3D=3D -1) >> break; >> frame =3D (u_int32_t *)(frame[0]); >> } >> } > It looks like this should work in most cases where fp and lr are next > to each other (ip and sp are between them but doesn't need to be = saved). Disassembling an EABI kernel, there are 7930 'push' instructions with fp and lr next to each other and only 220 without, so it looks like the = EABI kernel uses this frame convention as well. So what do you think of the following? #if defined(__ARM_EABI__) static void stack_capture(struct stack *st, u_int32_t *frame) { vm_offset_t callpc; stack_zero(st); while (INKERNEL(frame)) { callpc =3D frame[1]; if (stack_put(st, callpc) =3D=3D -1) break; frame =3D (u_int32_t *)(frame[0]); } } #elif !defined(__clang__) =85 old stack_capture code that works for OABI with gcc =85 #else /* * Clang doesn't yet produce compliant stack frames for OABI. */ static void stack_capture(=85) { /* empty */ } #endif