From: Will Deacon <will.deacon@arm.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: hw_breakpoint: Clear breakpoints before enabling monitor mode
Date: Thu, 20 Sep 2012 18:35:56 +0100 [thread overview]
Message-ID: <20120920173556.GQ4654@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1348160260-19486-1-git-send-email-sboyd@codeaurora.org>
Hi Stephen,
On Thu, Sep 20, 2012 at 05:57:40PM +0100, Stephen Boyd wrote:
> The reset value of the BCR, BVR, WCR, and WVR registers are all
> UNKNOWN on ARMv7. Unfortunately, reset_ctrl_regs() clears these
> registers *after* enabling monitor mode, not before, and so some
> implementations may experience UNPREDICTABLE behavior if the
> reset values of these registers are non-zero. Clear the
> breakpoints before enabling monitor mode so that we don't
> experience boot hangs/loops due to breakpoints being enabled
> out of reset.
>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Aha, thanks for the patch. We should definitely zero these registers before
enabling monitor mode. However...
> +/* Determine if halting mode is enabled */
> +static int halting_mode_enabled(void)
> +{
> + u32 dscr;
> +
> + ARM_DBG_READ(c1, 0, dscr);
> +
> + if (WARN_ONCE(dscr & ARM_DSCR_HDBGEN,
> + "halting debug mode enabled. Unable to access hardware resources.\n")) {
> + return -EPERM;
> + }
> + return 0;
> +}
...it looks like debug arch 7.1 defines this bit as UNKNOWN when the OS lock
is clear, so we probably shouldn't be reading it at all. I'll pour myself a
stiff drink and start reading the debug arch docs to work out what on Earth
we should do.
Stay tuned.
Will
next prev parent reply other threads:[~2012-09-20 17:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 16:57 Stephen Boyd
2012-09-20 17:35 ` Will Deacon [this message]
2012-09-24 17:19 ` Will Deacon
2012-09-24 18:04 ` Stephen Boyd
2012-09-24 19:17 ` Will Deacon
2012-10-02 0:34 ` Stephen Boyd
2012-10-02 9:13 ` Will Deacon
2012-10-02 17:47 ` Stephen Boyd
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=20120920173556.GQ4654@mudshark.cambridge.arm.com \
--to=will.deacon@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@codeaurora.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
all inboxes | Powered by JetHome®