From owner-freebsd-arm@FreeBSD.ORG Wed Feb 17 15:24:01 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 7ED24106566B for ; Wed, 17 Feb 2010 15:24:01 +0000 (UTC) (envelope-from batcilla@gmail.com) Received: from gv-out-0910.google.com (gv-out-0910.google.com [216.239.58.189]) by mx1.freebsd.org (Postfix) with ESMTP id 13E608FC0A for ; Wed, 17 Feb 2010 15:24:00 +0000 (UTC) Received: by gv-out-0910.google.com with SMTP id y18so24049gvf.39 for ; Wed, 17 Feb 2010 07:24:00 -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=GPAq5G1bsIx0zt5Fm4+y/W7Muvg1sqISbEjWBta2t+k=; b=eC3SE5k8YNF+QlDRnuKQA2uzJ+t6mQ+y2PWNizi44MASz7kifFM1+rDs0c/DivohmF n/VSAI2zrAzUrb5ToXitJ9MMVB8N1AbrdVq2e2WzGXIlmsf1ncldKtWvqIk6A+ycqT+r ZqXpKwr/B2rOeTM4ofBhF0xMkwLGRWGxfH/qk= 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=SJeTJW4pr4Mul5KJDFztHQE7E1zw4eQwb+fctLu2mNR6I9f4h0J+xipZXdpxaCwrdv BPjrhFDR9tNkYdQsFF06qdsx/7Ciuz7Or0MaxW7RU2aRYCTTeSFAbww9rnYv/svozeJJ IxM/qDfQQMfoyhJKo9GlhijSqCcGeaMoQE694= MIME-Version: 1.0 Received: by 10.239.193.5 with SMTP id g5mr939212hbi.3.1266418496751; Wed, 17 Feb 2010 06:54:56 -0800 (PST) In-Reply-To: <201002171542.35757.hselasky@c2i.net> References: <4B7BFAA4.4040607@semihalf.com> <201002171542.35757.hselasky@c2i.net> Date: Wed, 17 Feb 2010 16:54:56 +0200 Message-ID: <6c36ec371002170654n5e441c6eib9a8c9aad61c1e87@mail.gmail.com> From: batcilla itself To: Hans Petter Selasky 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 15:24:01 -0000 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 solu= tion > > =A0is to copy structure into local variable and then process it, please= see > > =A0patch below. But I am not sure if this is the best solution and mayb= e > > =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 stat)= ) > > =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 stat)); > > + =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 sockaddr= ) || > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0datalen !=3D ((struct sockad= dr *)(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 soc= kaddr)); > > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ktrsockaddr(&sockaddr); > > +#else > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ktrsockaddr((struct sockaddr *)data)= ; > > +#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 //batcilla