From: "Dr. David Alan Gilbert" <dave@treblig.org>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, "Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"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>,
"Fabiano Rosas" <farosas@suse.de>,
"Laurent Vivier" <lvivier@redhat.com>
Subject: Re: [PATCH v3 11/18] target/i386: drop HMP $pc
Date: Fri, 23 Oct 2026 22:51:00 +0000 [thread overview]
Message-ID: <atvk1Moo4nA_w_pi@gallifrey> (raw)
In-Reply-To: <CAJ+F1CJvkXiBLWrRvWOeG7+qBLOovsZ8xOhoBtxd26CVor=DgQ@mail.gmail.com>
* Marc-André Lureau (marcandre.lureau@redhat.com) wrote:
> Hi
>
> On Fri, Oct 23, 2026 at 3:35 AM Dr. David Alan Gilbert <dave@treblig.org> wrote:
> >
> > * Marc-André Lureau (marcandre.lureau@redhat.com) wrote:
> > > The to be deprecated MonitorDef provided a synthetic $pc alias on
> > > x86 (which begin as an $eip alias). Preserving it requires x86-specific
> > > semantics (CPUClass::get_pc() omits the historical truncation).
> > > Use $eip or $rip instead, adding $cs.base as required.
> > >
> > > It was never a documented feature, HMP is not a stable API, x86-only,
> > > and the replacement ($rip/$eip + $cs.base) is arguably more correct.
> > > Nobody asked for a deprecation window on ML either.
> > >
> > > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > <snip>
> >
> > > diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
> > > index a523dbb446ce..b3f8fd58612d 100644
> > > --- a/tests/qtest/test-hmp.c
> > > +++ b/tests/qtest/test-hmp.c
> > > @@ -58,7 +58,6 @@ static const char *hmp_cmds[] = {
> > > "object_del mem1",
> > > "one-insn-per-tb on",
> > > "pmemsave 0 4096 \"/dev/null\"",
> > > - "p $pc + 8",
> >
> > That leaves us with no test of the 'p' command, and no test of reading
> > a register.
> > Given how much you're changing accessing the registers you
> > should still have a basic test by the end.
>
> The existing test doesn't really do much though, it just checks we
> don't crash basically. I can try addressing this as a followup
>
> >
> > How does this test work on S390 where 'info registers' shows
> > NIP but 'p $pc' works but 'p $nip' doesn't?
>
> I assume you are talking about gdb, since $pc doesn't work with HMP-S390.
Oh! It was that test I was worried about, so that 'p $pc + 8' fails
on s390 - with an 'unknown register'; so yes, removing the x86 one doesn't
make any difference then.
> > I assume gdb also has some concept of a 'pc' at it's end?
>
> GDB has extra synthetic pseudo-registers. We have a bunch in QEMU (and
> this series add more). We can add extra as necessary. But $pc for x86
> is currently ill-defined, so we decided to drop it earlier.
OK, it was just that loss of the test for reading $pc which worried me;
hmm it would be great if we could find a way to add a test back in the future
for register reading.
Given that it already silently fails on s390, you could actually leave
that test line in and when run on any non-(x86, s390) it would test the
reading still.
Dave
> > Dave
> >
> >
> > > "qom-list /",
> > > "qom-set /machine initrd test",
> > > "qom-get /machine initrd",
> > >
> > > --
> > > 2.56.0.116.g6de20f6092dc
> > >
> > --
> > -----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 |_______/
> >
--
-----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-23 22:52 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 10:56 [PATCH v3 00/18] monitor/hmp: replace MonitorDef with GDB registers Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 01/18] hmp: don't crash on invalid register Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 02/18] gdbstub: fix next register base after register gaps Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 03/18] gdbstub: set feature->base_reg for dynamic features Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 04/18] gdbstub: add gdb_register_internal_coprocessor() Marc-André Lureau
2026-10-22 21:51 ` Pierrick Bouvier
2026-10-22 10:56 ` [PATCH v3 05/18] MAINTAINERS: cover x86 GDB XML files Marc-André Lureau
2026-10-22 20:44 ` Pierrick Bouvier
2026-10-22 10:56 ` [PATCH v3 06/18] target/i386: expose segment limits register to monitors via gdbstub Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 07/18] target/i386: fix FPU tag word in GDB register read Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 08/18] target/i386: split SSE registers into separate GDB feature Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 09/18] target/i386: expose system registers to monitors via gdbstub Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 10/18] target/i386: expose AVX/AVX-512 registers to GDB Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 11/18] target/i386: drop HMP $pc Marc-André Lureau
2026-10-22 23:34 ` Dr. David Alan Gilbert
2026-10-23 20:45 ` Marc-André Lureau
2026-10-23 22:51 ` Dr. David Alan Gilbert [this message]
2026-10-22 10:56 ` [PATCH v3 12/18] MAINTAINERS: cover m68k GDB XML files Marc-André Lureau
2026-10-22 21:51 ` Pierrick Bouvier
2026-10-22 10:56 ` [PATCH v3 13/18] target/m68k: expose system registers to monitors via gdbstub Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 14/18] target/sparc64: " Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 15/18] target/riscv: bypass smstateen check in debugger mode Marc-André Lureau
2026-10-22 10:56 ` [PATCH v3 16/18] MAINTAINERS: cover riscv GDB XML files Marc-André Lureau
2026-10-22 21:51 ` Pierrick Bouvier
2026-10-22 10:56 ` [PATCH v3 17/18] target/riscv: expose register aliases to monitors via gdbstub Marc-André Lureau
2026-10-23 19:50 ` Daniel Henrique Barboza
2026-10-22 10:56 ` [PATCH v3 18/18] monitor/hmp: remove legacy MonitorDef infrastructure Marc-André Lureau
2026-10-22 21:52 ` Pierrick Bouvier
2026-10-24 15:51 ` [PATCH v3 00/18] monitor/hmp: replace MonitorDef with GDB registers Dr. David Alan Gilbert
2026-10-25 8:26 ` Marc-André Lureau
2026-10-25 16:06 ` Dr. David Alan Gilbert
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=atvk1Moo4nA_w_pi@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=farosas@suse.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=lvivier@redhat.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.