From: Jason Wessel <jason.wessel@windriver.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] perf,hw_breakpoint: Initialize hardware api earlier
Date: Thu, 18 Nov 2010 10:09:03 -0600 [thread overview]
Message-ID: <4CE54F9F.5000603@windriver.com> (raw)
In-Reply-To: <1289942654.2109.671.camel@laptop>
On 11/16/2010 03:24 PM, Peter Zijlstra wrote:
> On Sun, 2010-11-14 at 07:33 -0600, Jason Wessel wrote:
>> This sounds to me like it would be early enough. I could certainly run
>> the simple test case in the patch to make sure it still works, if you
>> point me to your patch(es). I imagine I should also test the hand off
>> procedure where the debugger uses the registers directly up until the
>> point that perf is capable of handling reservations for the hw
>> breakpoint slots.
>
> I had to actually write them -- I had some hacky things in my sysfs RFC.
> Find attached.
It is worth summarizing the out of band discussion for anyone following
this thread.
The patch set did not address the problem of initializing the
hw_breakpoint api early enough to allow the breakpoint register hand
off to work correctly.
> Index: linux-2.6/kernel/hw_breakpoint.c
> ===========================================================
> --- linux-2.6.orig/kernel/hw_breakpoint.c
> +++ linux-2.6/kernel/hw_breakpoint.c
> @@ -655,6 +655,6 @@ static int __init init_hw_breakpoint(voi
>
> return -ENOMEM;
> }
> -core_initcall(init_hw_breakpoint);
> +early_initcall(init_hw_breakpoint);
An early_initcall is still well after smp_init() and not early enough
for the kgdb arch setup to succeed when transitioning from early
debugging to late debugging.
There is a patch pending in the tip tree which moves the
hw_breakpoint_api registration to the same time the other perf
callbacks register. We will go with that for now.
In the long term picture, at some point we should have a hand off
function that tells an early user of the hw breakpoint registers to
stop using them. Presently there is a small window of overlap where
perf and kgdb both might write to the hw break point registers up
until the late kgdb initialization completes. Presently there are no
regression tests for this condition and it might be the case that no
one ever has to debug this area with a hardware breakpoint, so we'll
leave it as a TODO item for the time being.
Thanks,
Jason.
next prev parent reply other threads:[~2010-11-18 16:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-13 21:37 [GIT PULL] hw-breakpoint fixes Frederic Weisbecker
2010-11-13 21:37 ` [PATCH 1/2] x86: Ignore trap bits on single step exceptions Frederic Weisbecker
2010-11-24 20:32 ` Michael Stefaniuc
2010-11-25 7:47 ` Frederic Weisbecker
2010-11-13 21:37 ` [PATCH 2/2] perf,hw_breakpoint: Initialize hardware api earlier Frederic Weisbecker
2010-11-13 21:46 ` Peter Zijlstra
2010-11-14 13:33 ` Jason Wessel
2010-11-16 21:24 ` Peter Zijlstra
2010-11-18 16:09 ` Jason Wessel [this message]
2010-11-18 9:39 ` [GIT PULL] hw-breakpoint fixes Ingo Molnar
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=4CE54F9F.5000603@windriver.com \
--to=jason.wessel@windriver.com \
--cc=a.p.zijlstra@chello.nl \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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