From: "Dr. David Alan Gilbert" <dave@treblig.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
qemu-devel@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Chinmay Rath" <rathc@linux.ibm.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Glenn Miles" <milesg@linux.ibm.com>,
"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Weiwei Li" <liwei1518@gmail.com>,
"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
"Chao Liu" <chao.liu@processmission.com>,
"Max Filippov" <jcmvbkbc@gmail.com>,
qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Artyom Tarasenko" <atar4qemu@gmail.com>,
"Helge Deller" <deller@gmx.de>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Warner Losh" <imp@bsdimp.com>, "Kyle Evans" <kevans@freebsd.org>
Subject: Re: [PATCH v2 04/10] gdbstub: add gdb_register_internal_coprocessor()
Date: Tue, 13 Oct 2026 14:34:32 +0000 [thread overview]
Message-ID: <as5BeHc6uCyYynwz@gallifrey> (raw)
In-Reply-To: <CAFEAcA-sKfp-1u_UaPbv=SCbDNYrdc69NZdVPT8RTTXgwXYSZQ@mail.gmail.com>
* Peter Maydell (peter.maydell@linaro.org) wrote:
> On Tue, 13 Oct 2026 at 14:01, Marc-André Lureau
> <marcandre.lureau@redhat.com> wrote:
> >
> > Hi
> >
> > On Tue, Oct 13, 2026 at 12:51 PM Alex Bennée <alex.bennee@linaro.org> wrote:
> > >
> > > Marc-André Lureau <marcandre.lureau@redhat.com> writes:
> > >
> > > > Add support for registering coprocessor features that are only visible
> > > > to QEMU's internal APIs (HMP monitor $register expressions, plugins) but
> > > > hidden from GDB's target description XML.
> > > >
> > > > When a feature is registered as internal:
> > > > - It is excluded from the target.xml sent to GDB
> > > > - Its XML is not served via qXfer:features:read
> > > > - 'p'/'P' packets for internal register numbers return E14
> > > >
> > > > This is useful for exposing system registers to the HMP monitor without
> > > > affecting GDB's register namespace. Exposing aliases or synthetic
> > > > registers through GDB's target description can cause problems: name
> > > > collisions with GDB's pseudo-registers, independent register caching,
> > > > and missing DWARF unwind rules.
> > >
> > > Hmm are they *that* useful for HMP then?
> > >
> > > The front-ends do limit what they export to gdb (see for example
> > > ARM_CP_NO_GDB) generally because reading them causes side-effects. Those
> > > restrictions are also a reason to limit them from the HMP interface.
> >
> > I am not a user, but I can imagine they are useful for developers.
> >
> > I would like to be able to implement "info registers" purely based on
> > QMP for ex.
>
> Yes, getting rid of the current hacks that "info registers" does will
> be a very nice cleanup.
>
> I think that the reason we get this internal-only interface is
> that gdb itself sets up pseudo-registers for various things that
> are nice for a human to have but are not directly exposed that
> way in the XML. So for HMP we can either:
> (a) not expose that human-facing convenience at all
> (b) reimplement the equivalent of the pseudo-registers and
> aliases, to the extent that we care to do so, in a way
> that they don't appear in the XML we expose to gdb
>
> Personally I'm sceptical of the utility of the "info registers"
> interface -- if you want to see what the guest CPU is doing then
> you're going to have a much better time connecting gdb to the debug
> stub rather than using the extremely rudimentary monitor commands --
> but "preserve the existing functionality" is a much easier path
> towards getting this cleaned up than trying to get agreement that
> we can drop some aspects of it, so I support doing that.
It's useful for getting hints on hung VMs; getting a gdb into a container
on some cluster of hosts and someone letting you poke with it is
often pretty hard.
Getting an admin to run one command when they find a hung VM is more doable.
(Similarly in cases where they wont send you a full vm dump)
Dave
> thanks
> -- PMM
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
next prev parent reply other threads:[~2026-10-13 14:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 20:34 [PATCH v2 00/10] monitor/hmp: replace MonitorDef with GDB registers Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 01/10] hmp: don't crash on invalid register Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 02/10] gdbstub: fix next register base after register gaps Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 03/10] gdbstub: set feature->base_reg for dynamic features Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 04/10] gdbstub: add gdb_register_internal_coprocessor() Marc-André Lureau
2026-10-13 8:42 ` Alex Bennée
2026-10-13 13:00 ` Marc-André Lureau
2026-10-13 13:26 ` Peter Maydell
2026-10-13 14:34 ` Dr. David Alan Gilbert [this message]
2026-10-12 20:34 ` [PATCH v2 05/10] target/i386: expose segment limits via GDB Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 06/10] target/m68k: expose system registers " Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 07/10] target/sparc64: " Marc-André Lureau
2026-10-13 6:57 ` Philippe Mathieu-Daudé
2026-10-12 20:34 ` [PATCH v2 08/10] target/riscv: bypass smstateen check in debugger mode Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 09/10] target/riscv: expose register aliases via GDB Marc-André Lureau
2026-10-12 20:34 ` [PATCH v2 10/10] monitor/hmp: remove legacy MonitorDef infrastructure Marc-André Lureau
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=as5BeHc6uCyYynwz@gallifrey \
--to=dave@treblig.org \
--cc=alex.bennee@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=atar4qemu@gmail.com \
--cc=chao.liu@processmission.com \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=deller@gmx.de \
--cc=harshpb@linux.ibm.com \
--cc=imp@bsdimp.com \
--cc=jcmvbkbc@gmail.com \
--cc=kevans@freebsd.org \
--cc=laurent@vivier.eu \
--cc=liwei1518@gmail.com \
--cc=marcandre.lureau@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=milesg@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@oss.qualcomm.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=rathc@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.