From owner-freebsd-arm@FreeBSD.ORG Wed Feb 17 18:47:52 2010 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E211010656D1 for ; Wed, 17 Feb 2010 18:47:52 +0000 (UTC) (envelope-from batcilla@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 993258FC13 for ; Wed, 17 Feb 2010 18:47:52 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 8so1099924qwh.7 for ; Wed, 17 Feb 2010 10:47:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Qyrvmymf/he2n4fPzbrIhtFAiUz9EFekPeiWgXnFrFk=; b=OBVxX9sTubdWYB8j0Pkgx3Pjh4apTOl2pt9Oe9YZBf8E939tGUXMG0ffe9WG+zH4HU pfpikSTUCshtK5zIwg+ZWnLXMMH8fZ4DDzLi3DclIAFH5PYsDALLZmlYOkNMXwrE6oID PXMRbwJMgBCspIspv9dHWN4v740K0GkPqA0uk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fWfAHBPqlkjuHA0KjyK3f6Hs8FTH66Z/Bj91c9KyCljogtHwLOZ4Y/s4bSW9CuRvWt dupGoTgZg0kpggv+EBWH+qiXIRp3nSbc63Ia0MV0pt7vrbLU9Sshyo62+W2a66VArMVO +tCN9I5T0L4HrW2U77+QKSOXi7bw/3w8VD3wY= MIME-Version: 1.0 Received: by 10.239.159.146 with SMTP id y18mr882410hbc.196.1266432470803; Wed, 17 Feb 2010 10:47:50 -0800 (PST) In-Reply-To: <20100217.094559.29593248078653355.imp@bsdimp.com> References: <4B7BFAA4.4040607@semihalf.com> <201002171542.35757.hselasky@c2i.net> <6c36ec371002170654n5e441c6eib9a8c9aad61c1e87@mail.gmail.com> <20100217.094559.29593248078653355.imp@bsdimp.com> Date: Wed, 17 Feb 2010 20:47:50 +0200 Message-ID: <6c36ec371002171047m13544419sf8ca5ad283cdc65@mail.gmail.com> From: batcilla itself To: "M. Warner Losh" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-arm@freebsd.org Subject: Re: kdump on ARM X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 18:47:53 -0000 2010/2/17 M. Warner Losh : > In message: <6c36ec371002170654n5e441c6eib9a8c9aad61c1e87@mail.gmail.com> > =A0 =A0 =A0 =A0 =A0 =A0batcilla itself writes: > : 2010/2/17 Hans Petter Selasky > : > > : > On Wednesday 17 February 2010 15:18:12 Grzegorz Bernacki wrote: > : > > Hi, > : > > > : > > I've noticed that kdump on ARM doesn't work properly, it generates = bus > : > > =A0error. The problem is that structures dumped into ktrace.out are= not > : > > =A0aligned. Processing such a structure causes Aligment Fault. One = solution > : > > =A0is to copy structure into local variable and then process it, pl= ease see > : > > =A0patch below. But I am not sure if this is the best solution and = maybe > : > > =A0someone has a better idea. > : > > > : > > grzesiek > : > > > : > > > : > > diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c > : > > index 386221e..5a15886 100644 > : > > --- a/usr.bin/kdump/kdump.c > : > > +++ b/usr.bin/kdump/kdump.c > : > > @@ -1325,6 +1325,10 @@ ktrstat(struct stat *statp) > : > > =A0 void > : > > =A0 ktrstruct(char *buf, size_t buflen) > : > > =A0 { > : > > +#if defined(__arm__) > : > > + =A0 =A0 =A0 struct stat stat; > : > > + =A0 =A0 =A0 struct sockaddr sockaddr; > : > > +#endif > : > > =A0 =A0 =A0 =A0 =A0char *name, *data; > : > > =A0 =A0 =A0 =A0 =A0size_t namelen, datalen; > : > > =A0 =A0 =A0 =A0 =A0int i; > : > > @@ -1348,12 +1352,22 @@ ktrstruct(char *buf, size_t buflen) > : > > =A0 =A0 =A0 =A0 =A0if (strcmp(name, "stat") =3D=3D 0) { > : > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (datalen !=3D sizeof(struct s= tat)) > : > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto invalid; > : > > +#if defined(__arm__) > : > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 memcpy(&stat, data, sizeof(struct sta= t)); > : > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ktrstat(&stat); > : > > +#else > : > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ktrstat((struct stat *)data); > : > > +#endif > : > > =A0 =A0 =A0 =A0 =A0} else if (strcmp(name, "sockaddr") =3D=3D 0) { > : > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (datalen < sizeof(struct sock= addr) || > : > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0datalen !=3D ((struct so= ckaddr *)(data))->sa_len) > : > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0goto invalid; > : > > +#if defined(__arm__) > : > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 memcpy(&sockaddr, data, sizeof(struct= sockaddr)); > : > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ktrsockaddr(&sockaddr); > : > > +#else > : > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ktrsockaddr((struct sockaddr *)d= ata); > : > > +#endif > : > > =A0 =A0 =A0 =A0 =A0} else { > : > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0printf("unknown structure\n"); > : > > =A0 =A0 =A0 =A0 =A0} > : > > : > I think more than ARM is affected by this. > : > > : > --HPS > : ARM affected definitely, just today had that Align error with -current > : while tried to use ng_bridge with wlan0 > > Where exactly was the error? =A0Do you have a traceback? It was ARM/Xcale avila custom nanobsd build, error was caused adding wlan0 into ng_bridge, while wlan0 was in tdma master (slot 0) mode, with slot 1 there was no errors. Exact message here: Fatal kernel mode data abort: 'Alignment Fault 3' trapframe: 0xc5e38cac FSR=3D00000003, FAR=3Dc10fd1fe, spsr=3D00000013 r0 =3Dc0e15080, r1 =3Dc0508288, r2 =3Dc10fd1fe, r3 =3D00000001 r4 =3D0000003c, r5 =3Dc0e15080, r6 =3Dc0e15500, r7 =3Dc111a600 r8 =3Dc1182a00, r9 =3Dc116dc00, r10=3Dc0e15d80, r11=3D00000001 r12=3Dc0e15080, ssp=3Dc5e38cf8, slr=3Dc041cb58, pc =3Dc041ec98 panic: Fatal abort Uptime: 3h26m17s Cannot dump. Device not defined or unavailable. Automatic reboot in 15 seconds - press a key on the console to abort uname: avila ... FreeBSD 9.0-CURRENT #1: Wed Feb 17 12:08:37 UTC 2010 ... a= rm Not really sure, if this alignment error come from kdump, there is really no dump device in this unit and other debugging facilities was turned off to save space. //batcilla > > Warner >