monitor/hmp: replace MonitorDef with GDB registers
Get series with b4
b4 am [email protected] change-id 20260910-query-reg-80cd59cf4707Versions newest first
- v3 Latest18 patches 13 repliesIn review
- v210 patches 5 repliesSuperseded
- v110 patches 12 repliesSuperseded
Changes in v3 from the cover letter
- added x86 GDB register patches
- fix the x87 FPU tag word returned by the GDB stub
- split SSE registers into a separate org.gnu.gdb.i386.sse feature
- expose AVX/AVX-512 registers (ymm/zmm upper halves and opmask)
- expose more system registers to HMP
- renamed i386-segments.xml to i386-system.xml and registered it as an
internal feature, like the other targets
- moved the HMP $pc removal to its own patch and documented it in removed-features.rst
- moved each target's MonitorDef removal into its target patch; the final
patch now only removes the generic MonitorDef infrastructure
- added MAINTAINERS entries
- rebased onto current master
- Link to v2: https://lore.kernel.org/qemu-devel/[email protected]
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | hmp: don't crash on invalid registermonitor/ | +1 | 0 replies | |
| 2/18 | gdbstub: fix next register base after register gapsgdbstub/ include/ target/ +4 more | +28 | 0 replies | |
| 3/18 | gdbstub: set feature->base_reg for dynamic featuresgdbstub/ | +1 | 0 replies | |
| 4/18 | gdbstub: add gdb_register_internal_coprocessor()gdbstub/ include/ | +84 | 1 reply | |
| 5/18 | MAINTAINERS: cover x86 GDB XML filesMAINTAINERS | +1 | 1 reply | |
| 6/18 | target/i386: expose segment limits register to monitors via gdbstubconfigs/ configs/ gdbstub/ +2 more | +41 | 0 replies | |
| 7/18 | target/i386: fix FPU tag word in GDB register readtarget/ target/ target/ +1 more | +40 | 0 replies | |
| 8/18 | target/i386: split SSE registers into separate GDB featureconfigs/ configs/ configs/ +8 more | +172 | 0 replies | |
| 9/18 | target/i386: expose system registers to monitors via gdbstubgdbstub/ target/ target/ +1 more | +181 | 0 replies | |
| 10/18 | target/i386: expose AVX/AVX-512 registers to GDBconfigs/ configs/ configs/ +8 more | +346 | 0 replies | |
| 11/18 | target/i386: drop HMP $pcdocs/ target/ tests/ | +8 | 3 replies | |
| 12/18 | MAINTAINERS: cover m68k GDB XML filesMAINTAINERS | +2 | 1 reply | |
| 13/18 | target/m68k: expose system registers to monitors via gdbstubconfigs/ gdbstub/ target/ +1 more | +81 | 1 reply | |
| 14/18 | target/sparc64: expose system registers to monitors via gdbstubconfigs/ gdbstub/ target/ +1 more | +61 | 0 replies | |
| 15/18 | target/riscv: bypass smstateen check in debugger modetarget/ | +2 | 0 replies | |
| 16/18 | MAINTAINERS: cover riscv GDB XML filesMAINTAINERS | +1 | 1 reply | |
| 17/18 | target/riscv: expose register aliases to monitors via gdbstubconfigs/ configs/ configs/ +10 more | +349 | 1 reply | |
| 18/18 | monitor/hmp: remove legacy MonitorDef infrastructureinclude/ include/ include/ +1 more | +1 | 1 reply |
Reviews trailers per patch
10 of 18 patches have a Reviewed-by or Acked-by.
| Patch | Alex Bennée | Philippe Mathieu-Daudé | Daniel Henrique Barboza | Chao Liu | Pierrick Bouvier |
|---|---|---|---|---|---|
| 1/18 | R-b | ||||
| 2/18 | A-b | ||||
| 3/18 | R-b | ||||
| 4/18 | R-b | ||||
| 5/18 | R-b | ||||
| 6/18 | |||||
| 7/18 | |||||
| 8/18 | |||||
| 9/18 | |||||
| 10/18 | |||||
| 11/18 | |||||
| 12/18 | R-b | ||||
| 13/18 | |||||
| 14/18 | |||||
| 15/18 | R-b | R-b | |||
| 16/18 | R-b | ||||
| 17/18 | R-b | ||||
| 18/18 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.
Cover letter [PATCH v3 00/18] monitor/hmp: replace MonitorDef with GDB registers
Hi,
HMP monitor supports printing $register expression. The lookup was done via GDB stub registers, and supplementary MonitorDef HMP-specific tables.
Migrate HMP registers to use the GDB infrastructure and remove the legacy HMP MonitorDef. Internal registers aren't exposed to GDB. This also drops HMP $pc x86 fallback (use $eip/$rip instead).
Known behavioural changes on RISC-V: CSR lookup is now case-sensitive and vector registers now report "unkown register" instead of a target-specific message ("Unable to print the value of vector vreg 'v0' from this API")
---
Changes in v3:
- added x86 GDB register patches
- fix the x87 FPU tag word returned by the GDB stub
- split SSE registers into a separate org.gnu.gdb.i386.sse feature
- expose AVX/AVX-512 registers (ymm/zmm upper halves and opmask)
- expose more system registers to HMP
- renamed i386-segments.xml to i386-system.xml and registered it as an
internal feature, like the other targets
- moved the HMP $pc removal to its own patch and documented it in removed-features.rst
- moved each target's MonitorDef removal into its target patch; the final
patch now only removes the generic MonitorDef infrastructure
- added MAINTAINERS entries
- rebased onto current master
- Link to v2: https://lore.kernel.org/qemu-devel/[email protected]
Changes in v2:
- dropped v1 patch 5 (CPUClass::get_pc fallback for $pc)
- new patch gdb_register_internal_coprocessor() to hide registers from GDB
- SPARC64, m68k, RISC-V aliases now use internal registration
- pickup trailer tags
- Link to v1: https://lore.kernel.org/qemu-devel/[email protected]
---
Marc-André Lureau (18):
hmp: don't crash on invalid register
gdbstub: fix next register base after register gaps
gdbstub: set feature->base_reg for dynamic features
gdbstub: add gdb_register_internal_coprocessor()
MAINTAINERS: cover x86 GDB XML files
target/i386: expose segment limits register to monitors via gdbstub target/i386: fix FPU tag word in GDB register read target/i386: split SSE registers into separate GDB feature target/i386: expose system registers to monitors via gdbstub target/i386: expose AVX/AVX-512 registers to GDB target/i386: drop HMP $pc
MAINTAINERS: cover m68k GDB XML files
target/m68k: expose system registers to monitors via gdbstub target/sparc64: expose system registers to monitors via gdbstub target/riscv: bypass smstateen check in debugger mode
MAINTAINERS: cover riscv GDB XML files
target/riscv: expose register aliases to monitors via gdbstub monitor/hmp: remove legacy MonitorDef infrastructure
MAINTAINERS | 4 + configs/targets/i386-bsd-user.mak | 2 +- configs/targets/i386-linux-user.mak | 2 +- configs/targets/i386-softmmu.mak | 2 +- configs/targets/m68k-softmmu.mak | 2 +- configs/targets/riscv32-linux-user.mak | 2 +- configs/targets/riscv32-softmmu.mak | 2 +- configs/targets/riscv64-bsd-user.mak | 2 +- configs/targets/riscv64-linux-user.mak | 2 +- configs/targets/riscv64-softmmu.mak | 2 +- configs/targets/sparc64-softmmu.mak | 2 +- configs/targets/x86_64-bsd-user.mak | 2 +- configs/targets/x86_64-linux-user.mak | 2 +- configs/targets/x86_64-softmmu.mak | 2 +- docs/about/removed-features.rst | 8 + gdbstub/gdb-xml/i386-32bit-avx.xml | 20 ++ gdbstub/gdb-xml/i386-32bit-avx512.xml | 31 +++ gdbstub/gdb-xml/i386-32bit-sse.xml | 54 +++++ gdbstub/gdb-xml/i386-32bit.xml | 46 +--- gdbstub/gdb-xml/i386-64bit-avx.xml | 28 +++ gdbstub/gdb-xml/i386-64bit-avx512.xml | 108 +++++++++ gdbstub/gdb-xml/i386-64bit-sse.xml | 62 +++++ gdbstub/gdb-xml/i386-64bit.xml | 50 ---- gdbstub/gdb-xml/i386-system.xml | 53 +++++ gdbstub/gdb-xml/m68k-system.xml | 32 +++ gdbstub/gdb-xml/riscv-32bit-alias.xml | 105 +++++++++ gdbstub/gdb-xml/riscv-32bit-fpu-alias.xml | 40 ++++ gdbstub/gdb-xml/riscv-64bit-alias.xml | 105 +++++++++ gdbstub/gdb-xml/riscv-64bit-fpu-alias.xml | 46 ++++ gdbstub/gdb-xml/sparc64-system.xml | 22 ++ gdbstub/gdbstub.c | 85 +++++-- include/exec/gdbstub.h | 21 ++ include/hw/core/cpu.h | 5 +- include/hw/core/sysemu-cpu-ops.h | 16 -- include/monitor/hmp.h | 6 - include/qemu/typedefs.h | 1 - monitor/hmp.c | 45 +--- target/arm/gdbstub.c | 8 +- target/arm/gdbstub64.c | 10 +- target/i386/cpu-dump.c | 5 +- target/i386/cpu.c | 60 +++-- target/i386/cpu.h | 25 ++ target/i386/gdbstub.c | 373 +++++++++++++++++++++++++++--- target/i386/tcg/fpu_helper.c | 24 +- target/m68k/cpu.c | 22 -- target/m68k/helper.c | 49 +++- target/ppc/gdbstub.c | 2 +- target/riscv/cpu.c | 1 - target/riscv/gdbstub.c | 57 ++++- target/riscv/internals.h | 3 - target/riscv/monitor.c | 140 ----------- target/riscv/tcg/csr.c | 3 +- target/sparc/cpu.c | 19 -- target/sparc/gdbstub.c | 38 +++ target/xtensa/cpu.c | 2 +- tests/qtest/test-hmp.c | 1 - 56 files changed, 1383 insertions(+), 478 deletions(-)
---
base-commit: 8967b2fe1b2aaae3c29e207d85fab901d580a2dc
change-id: 20260910-query-reg-80cd59cf4707
Best regards,
Signature · 1 line
Marc-André Lureau <[email protected]>