Getting rid of alignment faults in userspace

Steve Langasek vorlon at
Fri Jun 17 22:23:49 UTC 2011

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.

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                          
slangasek at                                     vorlon at

[1] Originally ia64; historically ported to hppa and alpha; currently
available in Debian unstable for ia64 and powerpc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <>

More information about the ubuntu-devel mailing list