From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: peter.maydell@linaro.org, qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-ppc] [RFC/PATCH] monitor/ppc: Access all SPRs from the monitor
Date: Wed, 30 Sep 2015 16:24:07 +1000 [thread overview]
Message-ID: <1443594247.2828.3.camel@kernel.crashing.org> (raw)
In-Reply-To: <20150930060355.GE23574@voom>
On Wed, 2015-09-30 at 16:03 +1000, David Gibson wrote:
> On Sun, Sep 27, 2015 at 04:31:16PM +1000, Benjamin Herrenschmidt wrote:
> > We already have a table with all supported SPRs along with their names,
> > so let's use that rather than a duplicate table that is perpetually
> > out of sync in the monitor code.
> >
> > This adds a new monitor hook target_extra_monitor_def() which is called
> > if nothing is found is the normal table. We still use the old mechanism
> > for anything that isn't an SPR.
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> This looks like a good idea, but it seems to be a slightly different
> approach from the one taken by some rather similar patches Alexey
> posted recently.
>
> Would you care to co-ordinate on which of those approaches to go ahead
> with?
The code upstream has changed quite a bit...
> [snip]
> > @@ -253,3 +180,23 @@ const MonitorDef *target_monitor_defs(void)
> > {
> > return monitor_defs;
> > }
> > +
> > +int target_extra_monitor_def(uint64_t *pval, const char *name)
> > +{
> > + /* On ppc, search through the SPRs so we can print any of them */
> > + {
> ^
> Also, this appears to be a redundant set of braces.
Ah right, that used to be inside the caller (monitor_defs()) and I
moved it to a hook and forgot to take out the extra braces.
I'll respin.
> + CPUArchState *env = mon_get_cpu_env();
> > + ppc_spr_t *spr_cb = env->spr_cb;
> > + int i;
> > +
> > + for (i = 0; i < 1024; i++) {
> > + if (!spr_cb[i].name || strcasecmp(name, spr_cb[i].name)) {
> > + continue;
> > + }
> > + *pval = env->spr[i];
> > + return 0;
> > + }
> > + }
> > + return -1;
> > +}
> > +
> >
> >
> >
>
next prev parent reply other threads:[~2015-09-30 6:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-27 6:31 [Qemu-devel] [RFC/PATCH] monitor/ppc: Access all SPRs from the monitor Benjamin Herrenschmidt
2015-09-30 6:03 ` [Qemu-devel] [Qemu-ppc] " David Gibson
2015-09-30 6:24 ` Benjamin Herrenschmidt [this message]
2015-09-30 11:47 ` [Qemu-devel] " Peter Maydell
2015-09-30 20:41 ` Benjamin Herrenschmidt
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=1443594247.2828.3.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=david@gibson.dropbear.id.au \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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).