From: Markus Armbruster <armbru@redhat.com>
To: "Dr. David Alan Gilbert" <dave@treblig.org>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-riscv@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Marcelo Tosatti" <mtosatti@redhat.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Weiwei Li" <liwei1518@gmail.com>,
"Daniel Henrique Barboza" <dbarboza@ventanamicro.com>,
"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
"Yoshinori Sato" <yoshinori.sato@nifty.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] monitor/hmp: Reduce target-specific definitions
Date: Mon, 12 Jan 2026 08:00:14 +0100 [thread overview]
Message-ID: <87a4yjiadd.fsf@pond.sub.org> (raw)
In-Reply-To: <aWOvk527PkZzLtSp@gallifrey> (David Alan Gilbert's message of "Sun, 11 Jan 2026 14:11:31 +0000")
"Dr. David Alan Gilbert" <dave@treblig.org> writes:
> * Markus Armbruster (armbru@redhat.com) wrote:
>> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>>
>> > From "monitor/hmp-target.h", only the MonitorDef structure
>> > is target specific (by using the 'target_long' type). All
>> > the rest (even target_monitor_defs and target_get_monitor_def)
>> > can be exposed to target-agnostic units, allowing to build
>> > some of them in meson common source set.
>> >
>> > Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>
>> The only use of the ->get_value() callback I can see is in
>> get_monitor_def(), to implement HMP's $register feature. I can't see
>> the callback being set. Is it dead?
>
> I think I see that being used in ppc;
> target/ppc/ppc-qmp-cmds.c
>
> const MonitorDef monitor_defs[] = {
> { "fpscr", offsetof(CPUPPCState, fpscr) },
> /* Next instruction pointer */
> { "nip|pc", offsetof(CPUPPCState, nip) },
> { "lr", offsetof(CPUPPCState, lr) },
> { "ctr", offsetof(CPUPPCState, ctr) },
> { "decr", 0, &monitor_get_decr, },
> { "ccr|cr", 0, &monitor_get_ccr, },
> /* Machine state register */
> { "xer", 0, &monitor_get_xer },
> { "msr", offsetof(CPUPPCState, msr) },
> { "tbu", 0, &monitor_get_tbu, },
> #if defined(TARGET_PPC64)
> { "tb", 0, &monitor_get_tbl, },
> #else
> { "tbl", 0, &monitor_get_tbl, },
> #endif
> { NULL },
> };
>
> those monitor_get_* functions are that get_value() aren't they?
You're right.
target/sparc/monitor.c and target/i386/monitor.c have more.
I prefer .member = initial-value when member is optional.
Thanks!
next prev parent reply other threads:[~2026-01-12 7:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260107182019.51769-1-philmd@linaro.org>
2026-01-07 18:20 ` [PATCH 1/2] target/i386: Include missing 'svm.h' header in 'sev.h' Philippe Mathieu-Daudé
2026-01-07 18:20 ` [PATCH 2/2] monitor/hmp: Reduce target-specific definitions Philippe Mathieu-Daudé
2026-01-08 7:42 ` Markus Armbruster
2026-01-11 14:11 ` Dr. David Alan Gilbert
2026-01-12 7:00 ` Markus Armbruster [this message]
2026-01-12 7:06 ` Markus Armbruster
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=87a4yjiadd.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=alistair.francis@wdc.com \
--cc=dave@treblig.org \
--cc=dbarboza@ventanamicro.com \
--cc=eduardo@habkost.net \
--cc=jcmvbkbc@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=laurent@vivier.eu \
--cc=liwei1518@gmail.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=yoshinori.sato@nifty.com \
--cc=zhao1.liu@intel.com \
--cc=zhiwei_liu@linux.alibaba.com \
/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