From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [RFC/PATCH] monitor/ppc: Access all SPRs from the monitor
Date: Thu, 01 Oct 2015 06:41:09 +1000 [thread overview]
Message-ID: <1443645669.2828.19.camel@kernel.crashing.org> (raw)
In-Reply-To: <CAFEAcA_T0p2DkUdpB-L1vyWhJgsnVu-YFKqt9UUifCFqWtMgAg@mail.gmail.com>
On Wed, 2015-09-30 at 12:47 +0100, Peter Maydell wrote:
> > const MonitorDef *target_monitor_defs(void);
> > +int target_extra_monitor_def(uint64_t *pval, const char *name);
>
> This would be a good place to put a doc comment documenting
> the semantics of this new hook.
>
> MonitorDef structs treat the value to be obtained as
> a target_long, but this uses uint64_t, which is a bit
> inconsistent.
I couldn't get the definition of target_ulong in the stubs.
[ Note: Alexey has a different approach which completely replaces
monitor_defs() with a CPU specific one via a method in the CPU class.
I don't care which way you prefer as long as the functionality is there
]
> It might be better to:
> (a) fix the core monitor code to deal in int64_t rather
> than target_long
> (b) consider whether it would be better to have the ppc
> code generate a bunch of MonitorDef structs to return for the
> SPRs rather than having an extra hook function
That sounds like the most bloated way to handle this :)
> > --- /dev/null
> > +++ b/stubs/target-extra-monitor-def.c
> > @@ -0,0 +1,10 @@
> > +#include "stddef.h"
> > +#include "qemu/typedefs.h"
> > +#include
> > +
> > +int target_extra_monitor_def(uint64_t *pval, const char *name);
> > +
> > +int target_extra_monitor_def(uint64_t *pval, const char *name)
> > +{
> > + return -1;
> > +}
>
> It would be better to put the prototype for the hook somewhere
> the stub file can include it rather than having it just rewritten
> here.
I just copied the existing practice in get_monitor_defs()... but yes, I
agree.
Ben.
> thanks
> -- PMM
prev parent reply other threads:[~2015-09-30 20:41 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
2015-09-30 11:47 ` [Qemu-devel] " Peter Maydell
2015-09-30 20:41 ` Benjamin Herrenschmidt [this message]
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=1443645669.2828.19.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=agraf@suse.de \
--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).