From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: Single-stepping ARMv7 with KDB...
Date: Tue, 22 Mar 2011 19:52:57 -0000 [thread overview]
Message-ID: <002b01cbe8ca$be358f10$3aa0ad30$@deacon@arm.com> (raw)
In-Reply-To: <AANLkTikL0KUdY5Ggv1BRfRQiwxyd9B6ooMXT2rPoVAxA@mail.gmail.com>
Hi Andrei,
> > x86 uses the hw_breakpoint framework for handling hardware breakpoints
> > in KGDB (see kgdb_correct_hw_break for how it converts breakinfo
> > structures into perf_events) so it might be possible to do something
> > similar for single-step on ARM if we allow the kernel to specify that
> > the breakpoint is to be a mismatch by poking the step_ctrl field in
> > the arch_hw_breakpoint struct.
>
> ...in this case monitor mode will have to be turned on outside SVC,
> else it will immediately trigger a debug abort inside the code
> programming BRV/BRC for mismatch... I guess that's the point I wanted
> to bring up. I suppose it's only really useful for KDB, as with KGDB
> you can have a debugger take care of branches, and all you would need
> to ensure is to save/restore breakpoints across context switches (and
> reentrancy). I'll play with enabling 'ss' with KDB as soon as I get
> linux-next running on our platform...
At the moment monitor mode is enabled all of the time, so you might
want to add a thread flag when a thread is using hardware debugging
resources. You can check that on return to userspace and enable monitor
mode only then (I'm not sure about your ABT trick, need to check the
docs). There will still be places in the hardware breakpoint code where
we need monitor mode enabled so you'll need to bank any mismatch
breakpoints over these regions of code and disable monitor mode before
reinstalling them again.
Note that enabling monitor mode is pretty error prone and might not
even be possible on your CPU so the failure path needs to be graceful.
Will
next prev parent reply other threads:[~2011-03-22 19:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-10 9:12 Single-stepping ARMv7 with KDB Andrei Warkentin
2011-03-11 16:33 ` Will Deacon
[not found] ` <766766263404232078@unknownmsgid>
2011-03-22 7:43 ` Andrei Warkentin
2011-03-22 19:52 ` Will Deacon [this message]
[not found] ` <8808174326287130926@unknownmsgid>
2011-03-22 22:26 ` Andrei Warkentin
2011-03-23 10:46 ` Will Deacon
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='002b01cbe8ca$be358f10$3aa0ad30$@deacon@arm.com' \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).