Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Dec 2016 11:13:06 -0800
From:      Oleksandr Tymoshenko <gonzo@bluezbox.com>
To:        Lee D <embaudarm@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Please help me understand "Translation Fault" in custom device drivers, and how to debug
Message-ID:  <85666618-B6A5-4577-86B9-914DEDE84ACD@bluezbox.com>
In-Reply-To: <CANC_bnPtD%2Bay9OQmZHjgzbcEq75mFNss6O7QCUY6Yg0tnVZ-Fw@mail.gmail.com>
References:  <CANC_bnPtD%2Bay9OQmZHjgzbcEq75mFNss6O7QCUY6Yg0tnVZ-Fw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Dec 4, 2016, at 10:32 AM, Lee D <embaudarm@gmail.com> wrote:
>=20
> Hello,
>=20
> I need help understanding what a translation fault is, and how to =
debug
> it.  I have googled like crazy but can't seem to find any detailed
> information.
>=20
> I am working on an embedded system using an ARM processor, and =
consequently
> am writing a bunch of device device drivers for my custom hardware.
>=20
> I am having a problem with occasional crashes when kldload'ing my =
modules
> in a boot script.  I get various errors, including "Translation Fault" =
(L1
> or L2), "Alignment Fault", "vm_fault", and "undefined instruction in
> kernel".  My code works 95% of the time though.
>=20
> I never see any crashes while running, so I don't think this is a =
flaky
> hardware problem.
>=20
> Any suggestions on what kernel debugger commands to enter to gather
> information would also be helpful.  Here are the commands I am =
currently
> recording the output of when I get a crash:
>=20
> db> bt
> db> ps
> db> show intr
> db> show proc 618
> db> show allpcpu
> db> show allrman
> db> show intrcnt
> db> show proc
> db> show procvm
>=20
> For a single concrete example, here is a backtrace of a device driver =
that
> failed with a translation fault on kldload.  This BT is unique in that =
it
> actually seems to contain useful information.  Most of the backtraces =
just
> show some abort/exeception related calls and then say "Unable to =
unwind
> into user space" (paraphrased), leaving me no info about where my =
crash
> happened.
>=20
> FreeBSD 10.3

Hi Lee,

Random crashes during kldload sounds like missing or incomplete icache
sync to me. You can take a look at icache-realted fixes in HEAD=E2=80=99s =
sys/arm
and try to backport them to 10.3.=20=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?85666618-B6A5-4577-86B9-914DEDE84ACD>