linux-mips
[Top] [All Lists]

Re: unaligned access

To: "sathesh babu" <sathesh_edara2003@yahoo.co.in>, "Rajat Jain" <rajat.noida.india@gmail.com>
Subject: Re: unaligned access
From: "Kevin D. Kissell" <kevink@mips.com>
Date: Thu, 22 Feb 2007 16:06:57 +0100
Cc: <linux-mips@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <80178.32924.qm@web7903.mail.in.yahoo.com>
Sender: linux-mips-bounce@linux-mips.org
Default behavior in MIPS is to silently fix up and emulate.  A MIPS-specific
system call (sys_sysmips with the command argument of MIPS_FIXADE
and a parameter agument of zero) allows for this to be overridden, so that 
such accesses will be fatal.  It looks as if there was once support to log the events
to syslog, independently of whether or not they were fixed up, but it doesn't look to me
as if that still works in 2.6.x kernels.
 
            Regards,
 
            Kevin K.
----- Original Message -----
Sent: Thursday, February 22, 2007 10:18 AM
Subject: Re: unaligned access

Thanks Rajan.
 
In case of arm processor, the alignment trap behavior can be changed by simply echo a number into  /proc/sys/debug/alignment 
 
bit             behavior when set
---             -----------------
0               A user process performing an unaligned memory access
                will cause the kernel to print a message indicating
                process name, pid, pc, instruction, address, and the
                fault code.
1               The kernel will attempt to fix up the user process
                performing the unaligned access.  This is of course
                slow (think about the floating point emulator) and
                not recommended for production use.
2               The kernel will send a SIGBUS signal to the user process
                performing the unaligned access.

I would like to know  Is there similar type of implimentation avalilable for MIPS processor in linux-2.6.12 kernel to view or log the unaligned access addresses and corresponding processor ID.
 
Regards,
Sathesh
 

Rajat Jain <rajat.noida.india@gmail.com> wrote:
On 2/22/07, sathesh babu wrote:
> Hi,
> I have ported linux-2.6.12 kernel on MIPS processor.I would like to
> print the warning messges whenenver kernel or user code try to access
> unaligned address ( including proceor ID ).
> Is there any configuration option avaliable in the kernel to view
> the unaligned address?

Ummm ... not sure about MIPS, but in i386, exception 17 is raised for
every unaligned access. alignment_check() is invoked for every such
access.

Regards,

Rajat



Here?s a new way to find what you're looking for - Yahoo! Answers
<Prev in Thread] Current Thread [Next in Thread>