From: pegasus <aijazbaig1.new@gmail.com>
To: linuxppc-dev@ozlabs.org
Subject: BookE "branch taken" behavior vis-a-vis updating the NIP register
Date: Fri, 8 Nov 2013 02:46:24 -0800 (PST) [thread overview]
Message-ID: <1383907583944-77960.post@n7.nabble.com> (raw)
Hello.
I was reading the source code for the debug exception under powerpc. I saw
that BookE processors stop before (actually) taking a branch. Hence in order
to force it to take that branch and then stop, the source code for it had to
be "hacked' to (temporarily) enable single step until the branch
instruction has been taken, thereby mimicing the BookS behavior.
By doing this, I believe we would want the exception to be triggered after
the branch has been successfully taken. Hence I put a printk to print the
value of the instruction that actually caused the exception. I was assuming
that initially a debug breakpoint would be hit on the branch instruction
(assuming the branch is supposed to be taken). Now since at this point in
time, the branch instruction has NOT finished, the kernel, after merely
disabling the BT bit in DBCR0 and enabling IC bit in DBCR0, returns. At this
point I was assuming we will see another exception at the very same
instruction in userspace. However, when printing the NIP it becomes clear
that when it gets to the debug exception handler after being (temporarily)
set to single step, NIP points to the instruction after the branch
instruction. To me, it appears that, after disabling BT (branch taken) debug
event monitoring (and enabling single stepping), it does not catch an
exception at that very same branch instruction, instead it catches an
exception for the subsequent instruction. Sorry for the repetition but I
wanted to clarify what I am seeing here.
May be this IS the way it is supposed to behave (which means my thinking
about it is flawed). I am a bit confused here.
Please let me know more..Im keen to hear from you folks.
--
View this message in context: http://linuxppc.10917.n7.nabble.com/BookE-branch-taken-behavior-vis-a-vis-updating-the-NIP-register-tp77960.html
Sent from the linuxppc-dev mailing list archive at Nabble.com.
next reply other threads:[~2013-11-08 10:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-08 10:46 pegasus [this message]
2013-11-10 22:22 ` BookE "branch taken" behavior vis-a-vis updating the NIP register James Yang
2013-11-11 7:51 ` pegasus
2013-11-11 20:11 ` James Yang
2013-11-12 7:37 ` pegasus
2013-11-13 17:20 ` James Yang
2014-06-27 0:15 ` Sakthi
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=1383907583944-77960.post@n7.nabble.com \
--to=aijazbaig1.new@gmail.com \
--cc=linuxppc-dev@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).