From owner-freebsd-arm@FreeBSD.ORG Thu Feb 18 00:28:34 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 557B5106568D for ; Thu, 18 Feb 2010 00:28:34 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from mail-ew0-f225.google.com (mail-ew0-f225.google.com [209.85.219.225]) by mx1.freebsd.org (Postfix) with ESMTP id D76038FC17 for ; Thu, 18 Feb 2010 00:28:33 +0000 (UTC) Received: by ewy25 with SMTP id 25so216056ewy.3 for ; Wed, 17 Feb 2010 16:28:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=dVty+a8umjIOY9r+8aH+lCrIscsfHkT8iMzsB8Dh/nc=; b=jEn8cR/wCPr/jMcFfoylZNA8IFgCGmau4CeCxV8iRbQ+GWPcuTdFXL6e4Fh+66f9yY yfqGby3W09lK+uOR7dqMFxYakIhHi9f6+8inCM5Udc6WGvCDZfqjoO6s5ixjNlzIORdn 46SHkOFPhRfb2qc8CwUA6mklvrnLvYAYS9WV8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=CEotFCvqnL051tS42polKmcEuY7rQfkov76GWcylEo9tt34V6BEquSttGBAu8q96aR lEQz4JTmaUqCV1BqwY4Tcx+vWMgpfs8SlF9pQ2KxaOtQudsQ0JphrKSWSHff/VLzpF6O lnSmnjS+c5ZPXOrCXtXxAY0HNSKkZMcg43aWM= Received: by 10.213.96.227 with SMTP id i35mr3556875ebn.35.1266452912739; Wed, 17 Feb 2010 16:28:32 -0800 (PST) Received: from ?10.0.10.4? (54.81.54.77.rev.vodafone.pt [77.54.81.54]) by mx.google.com with ESMTPS id 7sm22311570eyg.17.2010.02.17.16.28.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 17 Feb 2010 16:28:31 -0800 (PST) Sender: Rui Paulo Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Rui Paulo In-Reply-To: <20100217.121545.260300876949842220.imp@bsdimp.com> Date: Thu, 18 Feb 2010 00:28:30 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <987A4BCD-03A9-49ED-9E2E-AA4C2C6CA345@freebsd.org> References: <6c36ec371002170654n5e441c6eib9a8c9aad61c1e87@mail.gmail.com> <20100217.094559.29593248078653355.imp@bsdimp.com> <6c36ec371002171047m13544419sf8ca5ad283cdc65@mail.gmail.com> <20100217.121545.260300876949842220.imp@bsdimp.com> To: M. Warner Losh X-Mailer: Apple Mail (2.1077) 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: Thu, 18 Feb 2010 00:28:34 -0000 On 17 Feb 2010, at 19:15, M. Warner Losh wrote: > In message: = <6c36ec371002171047m13544419sf8ca5ad283cdc65@mail.gmail.com> > batcilla itself writes: > : 2010/2/17 M. Warner Losh : > : > In message: = <6c36ec371002170654n5e441c6eib9a8c9aad61c1e87@mail.gmail.com> > : > batcilla 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 > : > : > > error. The problem is that structures dumped into = ktrace.out are not > : > : > > aligned. Processing such a structure causes Aligment Fault. = One solution > : > : > > is to copy structure into local variable and then process = it, please see > : > : > > patch below. But I am not sure if this is the best solution = and maybe > : > : > > someone 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) > : > : > > void > : > : > > ktrstruct(char *buf, size_t buflen) > : > : > > { > : > : > > +#if defined(__arm__) > : > : > > + struct stat stat; > : > : > > + struct sockaddr sockaddr; > : > : > > +#endif > : > : > > char *name, *data; > : > : > > size_t namelen, datalen; > : > : > > int i; > : > : > > @@ -1348,12 +1352,22 @@ ktrstruct(char *buf, size_t buflen) > : > : > > if (strcmp(name, "stat") =3D=3D 0) { > : > : > > if (datalen !=3D sizeof(struct stat)) > : > : > > goto invalid; > : > : > > +#if defined(__arm__) > : > : > > + memcpy(&stat, data, sizeof(struct stat)); > : > : > > + ktrstat(&stat); > : > : > > +#else > : > : > > ktrstat((struct stat *)data); > : > : > > +#endif > : > : > > } else if (strcmp(name, "sockaddr") =3D=3D 0) { > : > : > > if (datalen < sizeof(struct sockaddr) || > : > : > > datalen !=3D ((struct sockaddr = *)(data))->sa_len) > : > : > > goto invalid; > : > : > > +#if defined(__arm__) > : > : > > + memcpy(&sockaddr, data, sizeof(struct = sockaddr)); > : > : > > + ktrsockaddr(&sockaddr); > : > : > > +#else > : > : > > ktrsockaddr((struct sockaddr *)data); > : > : > > +#endif > : > : > > } else { > : > : > > printf("unknown structure\n"); > : > : > > } > : > : > > : > : > 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? Do 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: > :=20 > : 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 > :=20 > : 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 > :=20 > : uname: avila ... FreeBSD 9.0-CURRENT #1: Wed Feb 17 12:08:37 UTC = 2010 ... arm > :=20 > : 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. >=20 > I'd wager that it wasn't caused by kdump, but something in the kernel. I definitely agree. -- Rui Paulo