qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/20] Add Multi-Core Debug (MCD) API support
@ 2025-04-30  5:27 Mario Fleischmann
  2025-04-30  5:27 ` [PATCH v2 01/20] mcd: Introduce Multi-Core Debug (MCD) API Mario Fleischmann
                   ` (22 more replies)
  0 siblings, 23 replies; 47+ messages in thread
From: Mario Fleischmann @ 2025-04-30  5:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: alex.bennee, philmd, armbru, christian.boenig, Mario Fleischmann

This patch series introduces support for the Multi-Core Debug (MCD) API, a
commonly used debug interface by emulators. The MCD API, defined through a
header file, consists of 54 functions for implementing debug and trace.
However, since it is a header-file-only interface, MCD does not specify a
communication protocol.

To keep the overhead of a communication protocol on top of MCD minimal,
we follow a remote procedure call approach by using QAPI as an interface
definition and transport infrastructure. This way, we can use qapi-gen to
take care of generating the infrastructure to dispatch MCD functions and
to (un)marshal their arguments and results. Furthermore, qapi-doc and qtest
provide good integration into QEMU's documentation and test frameworks.

In v1 of this patch series, the MCD protocol was directly integrated in QMP
and the QMP monitor was responsible for dispatching MCD's server stub. This
introduced a dependency between QEMU's machine protocol and the MCD debug
protocol which is not to be expected. For this reason, v2 introduces a MCD
monitor which uses as much of the QMP monitor's framework as possible but
keeps the two protocols separate from each other.
Similarly, MCD's test suite uses as much of the qtest framework as is useful
for sending JSON commands to the QEMU under test but adds new code where
required to prevent dependencies to QMP.

To enable MCD, configure QEMU with `--enable-mcd`.

To start the MCD monitor, run QEMU with the `-mcd` option:
qemu-system-<arch> [options] -qmp tcp::1235,server=on,wait=off

To run the MCD test suite independently, start `mcd-test`:
V=1 QTEST_QEMU_BINARY="./qemu-system-<arch> [options]" tests/qtest/mcd-test

To connect from a MCD client, a client stub corresponding to this
patch series can be found at https://gitlab.com/lauterbach/mcdrefsrv

Mario Fleischmann (20):
  mcd: Introduce Multi-Core Debug (MCD) API
  meson: Add --enable-mcd option
  mcd: Introduce MCD server
  qapi: Introduce MCD schema
  mcd: Introduce MCD server stub
  qtest: Introduce MCD test suite
  mcd: Implement target initialization API
  mcd: Implement server connection API
  mcd: Implement target system query
  mcd: Implement core connection control
  mcd: Implement memory space query
  gdbstub: Expose GDBRegisterState
  mcd: Implement register query
  mcd: Implement runstate control
  mcd test: Implement core state query
  gdbstub: Expose gdb_write_register
  mcd: Implement register/memory access
  mcd: Implement single stepping
  mcd: Implement trigger control
  mcd: Implement reset control

 MAINTAINERS                   |    9 +
 docs/interop/index.rst        |    1 +
 docs/interop/mcd.rst          |   65 +
 gdbstub/gdbstub.c             |   15 +-
 include/exec/gdbstub.h        |   18 +-
 include/exec/mcdstub.h        |   18 +
 mcd/mcd_api.h                 | 3963 +++++++++++++++++++++++++++++++++
 mcd/mcd_monitor.c             |   90 +
 mcd/mcd_qapi.c                |  505 +++++
 mcd/mcd_qapi.h                |   81 +
 mcd/mcd_server.c              | 2274 +++++++++++++++++++
 mcd/mcd_stub.c                |  988 ++++++++
 mcd/meson.build               |   60 +
 meson.build                   |    5 +
 meson_options.txt             |    3 +
 qapi/mcd.json                 | 2366 ++++++++++++++++++++
 qemu-options.hx               |   11 +
 scripts/meson-buildoptions.sh |    3 +
 system/vl.c                   |   13 +
 tests/qtest/mcd-test.c        |  698 ++++++
 tests/qtest/mcd-util.c        |  389 ++++
 tests/qtest/mcd-util.h        |   73 +
 tests/qtest/meson.build       |    5 +
 23 files changed, 11643 insertions(+), 10 deletions(-)
 create mode 100644 docs/interop/mcd.rst
 create mode 100644 include/exec/mcdstub.h
 create mode 100644 mcd/mcd_api.h
 create mode 100644 mcd/mcd_monitor.c
 create mode 100644 mcd/mcd_qapi.c
 create mode 100644 mcd/mcd_qapi.h
 create mode 100644 mcd/mcd_server.c
 create mode 100644 mcd/mcd_stub.c
 create mode 100644 mcd/meson.build
 create mode 100644 qapi/mcd.json
 create mode 100644 tests/qtest/mcd-test.c
 create mode 100644 tests/qtest/mcd-util.c
 create mode 100644 tests/qtest/mcd-util.h

-- 
2.34.1



^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2025-07-24  5:31 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30  5:27 [PATCH v2 00/20] Add Multi-Core Debug (MCD) API support Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 01/20] mcd: Introduce Multi-Core Debug (MCD) API Mario Fleischmann
2025-04-30  8:19   ` Daniel P. Berrangé
2025-04-30 12:47     ` Mario Fleischmann
2025-04-30 12:55       ` Daniel P. Berrangé
2025-04-30 15:22         ` Mario Fleischmann
2025-04-30 16:00           ` Daniel P. Berrangé
2025-04-30  5:27 ` [PATCH v2 02/20] meson: Add --enable-mcd option Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 03/20] mcd: Introduce MCD server Mario Fleischmann
2025-05-15  9:46   ` Daniel P. Berrangé
2025-04-30  5:27 ` [PATCH v2 04/20] qapi: Introduce MCD schema Mario Fleischmann
2025-05-08 11:07   ` Markus Armbruster
2025-05-20  7:10     ` Markus Armbruster
2025-04-30  5:27 ` [PATCH v2 05/20] mcd: Introduce MCD server stub Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 06/20] qtest: Introduce MCD test suite Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 07/20] mcd: Implement target initialization API Mario Fleischmann
2025-05-08 12:03   ` Markus Armbruster
2025-05-14 13:59     ` Mario Fleischmann
2025-05-15  9:33       ` Markus Armbruster
2025-05-15 13:02   ` Markus Armbruster
2025-05-19 16:52     ` Mario Fleischmann
2025-05-20  7:13       ` Markus Armbruster
2025-04-30  5:27 ` [PATCH v2 08/20] mcd: Implement server connection API Mario Fleischmann
2025-05-15  9:58   ` Daniel P. Berrangé
2025-05-19 16:54     ` Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 09/20] mcd: Implement target system query Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 10/20] mcd: Implement core connection control Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 11/20] mcd: Implement memory space query Mario Fleischmann
2025-05-19  9:41   ` Manos Pitsidianakis
2025-05-19 18:24     ` Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 12/20] gdbstub: Expose GDBRegisterState Mario Fleischmann
2025-05-19  8:41   ` Manos Pitsidianakis
2025-05-19 18:26     ` Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 13/20] mcd: Implement register query Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 14/20] mcd: Implement runstate control Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 15/20] mcd test: Implement core state query Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 16/20] gdbstub: Expose gdb_write_register Mario Fleischmann
2025-05-19  8:38   ` Manos Pitsidianakis
2025-04-30  5:27 ` [PATCH v2 17/20] mcd: Implement register/memory access Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 18/20] mcd: Implement single stepping Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 19/20] mcd: Implement trigger control Mario Fleischmann
2025-04-30  5:27 ` [PATCH v2 20/20] mcd: Implement reset control Mario Fleischmann
2025-05-08 11:37 ` [PATCH v2 00/20] Add Multi-Core Debug (MCD) API support Markus Armbruster
2025-05-14 14:05   ` Mario Fleischmann
2025-05-20  7:35 ` Markus Armbruster
2025-05-20 14:16   ` Mario Fleischmann
2025-07-24  5:28 ` Markus Armbruster

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).