kdump on ARM
batcilla itself
batcilla at gmail.com
Wed Feb 17 18:47:53 UTC 2010
2010/2/17 M. Warner Losh <imp at bsdimp.com>:
> In message: <6c36ec371002170654n5e441c6eib9a8c9aad61c1e87 at mail.gmail.com>
> batcilla itself <batcilla at gmail.com> writes:
> : 2010/2/17 Hans Petter Selasky <hselasky at c2i.net>
> : >
> : > 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") == 0) {
> : > > if (datalen != 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") == 0) {
> : > > if (datalen < sizeof(struct sockaddr) ||
> : > > datalen != ((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:
Fatal kernel mode data abort: 'Alignment Fault 3'
trapframe: 0xc5e38cac
FSR=00000003, FAR=c10fd1fe, spsr=00000013
r0 =c0e15080, r1 =c0508288, r2 =c10fd1fe, r3 =00000001
r4 =0000003c, r5 =c0e15080, r6 =c0e15500, r7 =c111a600
r8 =c1182a00, r9 =c116dc00, r10=c0e15d80, r11=00000001
r12=c0e15080, ssp=c5e38cf8, slr=c041cb58, pc =c041ec98
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 ... arm
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
>
More information about the freebsd-arm
mailing list