From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: Fixing up unaligned userspace access
Date: Fri, 21 Mar 2008 08:49:49 +0000 [thread overview]
Message-ID: <20080321084949.GB17623@linux-sh.org> (raw)
In-Reply-To: <1204900215.12315.174.camel@atlas.mpc-data.co.uk>
On Fri, Mar 14, 2008 at 02:10:59PM +0000, Kieran Bingham wrote:
> Fixing up unaligned userspace access in "unaligned-acces" pidW
> pc=0x0cfa0116 ins=0x0009
> instruction : 9
>
> Code from above:
>
> 0CFA010A 0009 NOP
> 0CFA010C 0009 NOP
> 0CFA010E 0009 NOP
> 0CFA0110 51E1 MOV.L @(H'04:4,R14),R1 # R1 is
> 0x4466 at this point
> 0CFA0112 6112 MOV.L @R1,R1
> 0CFA0114 1E13 MOV.L R1,@(H'0C:4,R14)
> 0CFA0116 0009 NOP
> 0CFA0118 0009 NOP
> 0CFA011A 0009 NOP
>
>
> Is there some sort of timing issue here where by the time the
> exception is raised, the CPU has already started to execute the
> following instructions ? Something in a pipeline perhaps ? Surely when
> an address error occurs - thats it - it should stop ? But maybe I'm
> missing something...
>
It would be helpful to know what the stack layout is at the time you
enter the exception, both from HEW and from regular processing. The saved
PC value in this case is the next instruction to be executed, and even if
it's partially split out in the pipeline, the exec stage should not be
hit until execution resumes.
Looking at address_error_trap_handler(), I wonder if we have an
inconsistency between the stack-relative saved (ie, OFF_PC) PC and the
saved PC on the top of the stack pushed by the hardware on top of the
saved SR before the processing begins. You may wish to pop the saved PC
off and toss that in r7 or some such thing so you can more easily
compare. The only issue is that the hardware-saved PC at the top of the
stack can occasionally be undefined (ie, in the case of nested
exceptions), in which case we have to go to the OFF_PC value on-stack
regardless. This is fairly easy to test for however.
prev parent reply other threads:[~2008-03-21 8:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-07 14:30 Fixing up unaligned userspace access Kieran Bingham
2008-03-07 14:44 ` Adrian McMenamin
2008-03-12 18:41 ` Kieran Bingham
2008-03-13 10:39 ` Paul Mundt
2008-03-14 14:10 ` Kieran Bingham
2008-03-21 8:49 ` Paul Mundt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080321084949.GB17623@linux-sh.org \
--to=lethal@linux-sh.org \
--cc=linux-sh@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.