From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 3/4] AArch64: KGDB: Add step debugging support
Date: Mon, 11 Nov 2013 15:00:13 +0000 [thread overview]
Message-ID: <20131111150013.GJ28302@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <CALicx6uaK_xk+nNCvYMjO2FrNQDQWqhWk54NMccYTE2ji=gycw@mail.gmail.com>
On Mon, Nov 11, 2013 at 11:09:46AM +0000, Vijay Kilari wrote:
> On Fri, Nov 8, 2013 at 7:48 PM, Will Deacon <will.deacon@arm.com> wrote:
> > On Tue, Nov 05, 2013 at 08:45:45AM +0000, vijay.kilari at gmail.com wrote:
> >> @@ -153,6 +166,8 @@ int kgdb_arch_handle_exception(int exception_vector, int signo,
> >> * Packet D (Detach), k (kill). No special handling
> >> * is required here
> >> */
> >> + atomic_set(&kgdb_cpu_doing_single_step, -1);
> >> + kgdb_single_step = 0;
> >
> > This looks really weird: you have two variables, which you attempt to keep
> > in sync, only one of them is an atomic access and you don't have any
> > locking or memory barriers between them, so it must be ok if they're not
> > in-sync. In which case, why do we have two variables?
> >
> IMHO, two variables are being used by kgdb framework
> The variables 'kgdb_cpu_doing_single_step' holds the cpu on which
> step debugging
> is happening. With this, when during step debugging, it ensures that on next
> step debug exception only this CPU aquires master lock and step
> debugging is performed.
>
> The variable 'kgdb_single_step' is used to know if step debugging is
> ongoing or not.
> If so, the non-primary cpu's are not released untill the continue
> command is received
> So, with this the cpu's are not released and acquired for every step command
Ok, but in what situation would you have both kgdb_cpu_doing_single_step == -1
and kgdb_single_step == 1 (ignoring races between setting the two variables)?
In other words, can we reduce this to a single variable?
Will
next prev parent reply other threads:[~2013-11-11 15:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-05 8:45 [PATCH v4 0/4] AArch64: KGDB support vijay.kilari at gmail.com
2013-11-05 8:45 ` [PATCH v4 1/4] arm64: support single-step and breakpoint handler hooks vijay.kilari at gmail.com
2013-11-05 8:45 ` [PATCH v4 2/4] AArch64: KGDB: Add Basic KGDB support vijay.kilari at gmail.com
2013-11-08 14:14 ` Will Deacon
2013-11-05 8:45 ` [PATCH v4 3/4] AArch64: KGDB: Add step debugging support vijay.kilari at gmail.com
2013-11-08 14:18 ` Will Deacon
2013-11-11 11:09 ` Vijay Kilari
2013-11-11 15:00 ` Will Deacon [this message]
2013-11-13 8:56 ` Vijay Kilari
2013-11-05 8:45 ` [PATCH v4 4/4] KGDB: make kgdb_breakpoint() as noinline vijay.kilari at gmail.com
2013-11-08 13:47 ` 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=20131111150013.GJ28302@mudshark.cambridge.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).