[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Getting rid of alignment faults in userspace



On Fri, Jun 17, 2011 at 01:10:11PM +0100, Dave Martin wrote:

> For ARM, we can achieve the goal by augmenting the default kernel command-
> line options: either

>     alignment=3
>         Fix up each alingment fault, but also log the faulting address
>         and name of the offending process to dmesg.

>     alignment=5
>         Pass each alignment fault to the user process as SIGBUS (fatal
>         by default) and log the faulting address and name of the
>         offending process to dmesg.

> Fault statistics cat also be obtained at runtime by reading
> /proc/cpu/alignment.

> For other architectures, there may be other arch-specific ways of
> achieving something similar.

Other architectures[1] use the 'prctl' tool, which uses the
prctl(PR_SET_UNALIGN,...) kernel interface to control the unaligned trap
behavior for the process.  If this can be sanely togglable on ARM at
runtime, it would be keen to use the same interface on this arch.

HTH,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org

[1] Originally ia64; historically ported to hppa and alpha; currently
available in Debian unstable for ia64 and powerpc

Attachment: signature.asc
Description: Digital signature


Reply to: