qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
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:03:55 +1000	[thread overview]
Message-ID: <20150930060355.GE23574@voom> (raw)
In-Reply-To: <1443335476.4610.2.camel@kernel.crashing.org>

[-- Attachment #1: Type: text/plain, Size: 1710 bytes --]

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?

[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.

> +        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;
> +}
> +
> 
> 
> 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-09-30  6:06 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 ` David Gibson [this message]
2015-09-30  6:24   ` [Qemu-devel] [Qemu-ppc] " Benjamin Herrenschmidt
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=20150930060355.GE23574@voom \
    --to=david@gibson.dropbear.id.au \
    --cc=benh@kernel.crashing.org \
    --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).