linux-mips
[Top] [All Lists]

RE: Kernel unaligned access

To: "Anoop P.A." <Anoop_P.A@pmc-sierra.com>
Subject: RE: Kernel unaligned access
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Tue, 25 May 2010 05:59:53 +0100 (BST)
Cc: linux-mips <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
In-reply-to: <A7DEA48C84FD0B48AAAE33F328C0201404E2D356@BBY1EXM11.pmc_nt.nt.pmc-sierra.bc.ca>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20100524173624.2d3ffc3d.yuasa@linux-mips.org> <A7DEA48C84FD0B48AAAE33F328C0201404E2D299@BBY1EXM11.pmc_nt.nt.pmc-sierra.bc.ca> <alpine.LFD.2.00.1005250413430.4344@eddie.linux-mips.org> <A7DEA48C84FD0B48AAAE33F328C0201404E2D356@BBY1EXM11.pmc_nt.nt.pmc-sierra.bc.ca>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
On Mon, 24 May 2010, Anoop P.A. wrote:

> Thanks for your reply but unfortunately we are not in a position to
> upgrade the kernel. It will be great if you can give me some pointers to
> debug the issue.

 Well, you are on your own then.

 Pointers?  Well, first despite the confusing message it's not an 
alignment error.  The Linux kernel does not try to be particularly precise 
here and hardware does not always help either (the RM9000 isn't a MIPS64 
architecture processor, is it?).  Anyway, BadVAddr is 0x9a5d9c1483fa8a60, 
which clearly indicates this is a reference to an address outside the 
defined address space.  I don't know off the head how many physical 
address bits the RM9000 implements, but the typical number is 40 and the 
extreme one is 44.  Masking out the XKPHYS cache coherence mode and 
(optimistically) 44 address bits we are still left with 
0x025d900000000000.  These bits in the address are what the CPU complains 
about.

 Second, the address looks remarkably similar to the value in $lo, that is 
0x025d9c1482fa8a60.  Go calculate the difference!  That's probably an 
index to an array of some sort that went out of limits.

 The rest you need to figure out yourself.  It might be easier if you 
disable the unaligned access emulator altogether (#ifdef it out or 
whatever) and let the kernel throw an error straight away.  It might be 
that you're getting a nested fault.  That's what the decoded value of EPC 
being do_ade+0x1c4/0x470 actually suggests.

 Good luck!

  Maciej

<Prev in Thread] Current Thread [Next in Thread>