Re: [PATCH v2 00/20] Add Multi-Core Debug (MCD) API support

2025-05-20 Thread Mario Fleischmann
On 20.05.2025 09:36, Markus Armbruster wrote: > Mario Fleischmann writes: > >> 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 function

Re: [PATCH v2 12/20] gdbstub: Expose GDBRegisterState

2025-05-19 Thread Mario Fleischmann
On 19.05.2025 10:42, Manos Pitsidianakis wrote: > On Wed, 30 Apr 2025 08:27, Mario Fleischmann > wrote: >> Signed-off-by: Mario Fleischmann >> --- >> gdbstub/gdbstub.c | 7 --- >> include/exec/gdbstub.h | 8 +++- >> 2 files changed, 7 insertions(+

Re: [PATCH v2 11/20] mcd: Implement memory space query

2025-05-19 Thread Mario Fleischmann
Thank you for taking the time to review this patch! On 19.05.2025 12:00, Manos Pitsidianakis wrote: > On Wed, 30 Apr 2025 08:27, Mario Fleischmann > wrote: >> Support three main memory space types: >> >> * Physical memory >> * Logical memory (MMU) >> * GDB Re

Re: [PATCH v2 08/20] mcd: Implement server connection API

2025-05-19 Thread Mario Fleischmann
On 15.05.2025 11:58, Daniel P. Berrangé wrote: > On Wed, Apr 30, 2025 at 07:27:29AM +0200, Mario Fleischmann wrote: >> This commit implements the necessary operations required to establish >> a connection with the MCD server: >> >> * query information about

Re: [PATCH v2 07/20] mcd: Implement target initialization API

2025-05-19 Thread Mario Fleischmann
On 15.05.2025 15:02, Markus Armbruster wrote: > Mario Fleischmann writes: > >> The target initialization API ensures that the requested and provided >> MCD versions are compatible. >> >> * implement mcd_initialize_f and mcd_qry_error_info_f in mcdserver >>

Re: [PATCH v2 07/20] mcd: Implement target initialization API

2025-05-14 Thread Mario Fleischmann
Thank you very much for the review! On 08.05.2025 14:04, Markus Armbruster wrote: > Mario Fleischmann writes: > >> The target initialization API ensures that the requested and provided >> MCD versions are compatible. >> >> * implement mcd_initialize_f and mcd

Re: [PATCH v2 00/20] Add Multi-Core Debug (MCD) API support

2025-05-14 Thread Mario Fleischmann
On 08.05.2025 13:38, Markus Armbruster wrote: > Mario Fleischmann writes: > >> 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 function

Re: [PATCH v2 01/20] mcd: Introduce Multi-Core Debug (MCD) API

2025-04-30 Thread Mario Fleischmann
On 30.04.2025 14:56, Daniel P. Berrangé wrote: > On Wed, Apr 30, 2025 at 02:47:07PM +0200, Mario Fleischmann wrote: >> On 30.04.2025 10:20, Daniel P. Berrangé wrote: >>> On Wed, Apr 30, 2025 at 07:27:22AM +0200, Mario Fleischmann wrote: [...] >>>> diff --git a

Re: [PATCH v2 01/20] mcd: Introduce Multi-Core Debug (MCD) API

2025-04-30 Thread Mario Fleischmann
On 30.04.2025 10:20, Daniel P. Berrangé wrote: > On Wed, Apr 30, 2025 at 07:27:22AM +0200, Mario Fleischmann wrote: >> Formatting changes to mcd_api.h to compily with QEMU's coding style >> guidelines: >> >> * limit line width to 80 >> * convert Dox

[PATCH v2 20/20] mcd: Implement reset control

2025-04-29 Thread Mario Fleischmann
found at https://gitlab.com/lauterbach/mcdrefsrv) Signed-off-by: Mario Fleischmann --- mcd/mcd_qapi.c | 12 + mcd/mcd_qapi.h | 2 + mcd/mcd_server.c | 98 +-- mcd/mcd_stub.c | 61 ++ qapi/mcd.json

[PATCH v2 14/20] mcd: Implement runstate control

2025-04-29 Thread Mario Fleischmann
Currently, only global stop is implemented Signed-off-by: Mario Fleischmann --- mcd/mcd_server.c | 74 +-- mcd/mcd_stub.c | 52 qapi/mcd.json| 100 +++ 3 files changed, 222 insertions

[PATCH v2 12/20] gdbstub: Expose GDBRegisterState

2025-04-29 Thread Mario Fleischmann
Signed-off-by: Mario Fleischmann --- gdbstub/gdbstub.c | 7 --- include/exec/gdbstub.h | 8 +++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 565f6b3..291ac55 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c

[PATCH v2 08/20] mcd: Implement server connection API

2025-04-29 Thread Mario Fleischmann
This commit implements the necessary operations required to establish a connection with the MCD server: * query information about the server * connect to " * disconnect from " Signed-off-by: Mario Fleischmann --- mcd/mcd_qapi.c | 13 +++ mcd/mcd_qapi.h |

[PATCH v2 10/20] mcd: Implement core connection control

2025-04-29 Thread Mario Fleischmann
In MCD, core-specific operations require an open connection to the core. This commit implements the necessary operations to open and close the connection to cores. Signed-off-by: Mario Fleischmann --- mcd/mcd_server.c | 176 +++--- mcd/mcd_stub.c | 129

[PATCH v2 15/20] mcd test: Implement core state query

2025-04-29 Thread Mario Fleischmann
Depending on the VM and CPU state, core states can be queried: * MCD_CORE_STATE_DEBUG: VM halted or CPU artifically stopped * MCD_CORE_STATE_RUNNING: VM and CPU running * MCD_CORE_STATE_HALTED: CPU suspended Signed-off-by: Mario Fleischmann --- mcd/mcd_qapi.c | 16 ++ mcd

[PATCH v2 06/20] qtest: Introduce MCD test suite

2025-04-29 Thread Mario Fleischmann
tocol. Signed-off-by: Mario Fleischmann --- MAINTAINERS | 1 + tests/qtest/mcd-test.c | 82 + tests/qtest/mcd-util.h | 21 +++ tests/qtest/meson.build | 5 +++ 4 files changed, 109 insertions(+) create mode 100644 tests/qtest/mcd-test.c c

[PATCH v2 09/20] mcd: Implement target system query

2025-04-29 Thread Mario Fleischmann
In MCD, the target system is divided into system, devices and cores: [ system ] 1-* [ devices ] 1-* [cores] This commit implements the necessary functions to query information about the target system. Signed-off-by: Mario Fleischmann --- mcd/mcd_qapi.c | 48 ++ mcd/mcd_qapi.h

[PATCH v2 04/20] qapi: Introduce MCD schema

2025-04-29 Thread Mario Fleischmann
The MCD implementation follows a remote procedure call approach: Each function from mcd_api.h will correspond to one command in mcd.json. Signed-off-by: Mario Fleischmann --- MAINTAINERS | 1 + docs/interop/mcd.rst | 13 + mcd/meson.build | 27

[PATCH v2 07/20] mcd: Implement target initialization API

2025-04-29 Thread Mario Fleischmann
)serialized automatically. Signed-off-by: Mario Fleischmann --- mcd/mcd_qapi.c | 66 +++ mcd/mcd_qapi.h | 26 ++ mcd/mcd_server.c| 44 +- mcd/mcd_stub.c | 35 mcd/meson.build | 49 +++ qapi/mcd.json

[PATCH v2 13/20] mcd: Implement register query

2025-04-29 Thread Mario Fleischmann
Directly map MCD register groups to GDB features lists Signed-off-by: Mario Fleischmann --- mcd/mcd_qapi.c | 48 +++ mcd/mcd_qapi.h | 8 ++ mcd/mcd_server.c | 237 +++-- mcd/mcd_stub.c | 93 + qapi/mcd.json

[PATCH v2 00/20] Add Multi-Core Debug (MCD) API support

2025-04-29 Thread Mario Fleischmann
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

[PATCH v2 19/20] mcd: Implement trigger control

2025-04-29 Thread Mario Fleischmann
-core * mcd_trig_complex_core_st: mcd-trig-complex-core Signed-off-by: Mario Fleischmann --- mcd/mcd_qapi.c | 152 mcd/mcd_qapi.h | 21 ++ mcd/mcd_server.c | 586 -- mcd/mcd_stub.c | 290 +++ qapi/mcd.json

[PATCH v2 03/20] mcd: Introduce MCD server

2025-04-29 Thread Mario Fleischmann
-off-by: Mario Fleischmann --- mcd/mcd_server.c | 431 +++ mcd/meson.build | 14 ++ meson.build | 4 + 3 files changed, 449 insertions(+) create mode 100644 mcd/mcd_server.c create mode 100644 mcd/meson.build diff --git a/mcd/mcd_server.c b

[PATCH v2 18/20] mcd: Implement single stepping

2025-04-29 Thread Mario Fleischmann
gdbstub: abort gdb_set_stop_cpu when step is issued by mcdserver Signed-off-by: Mario Fleischmann --- gdbstub/gdbstub.c | 6 ++- mcd/mcd_server.c | 115 ++ mcd/mcd_stub.c| 18 qapi/mcd.json | 38 ++- 4 files changed

[PATCH v2 05/20] mcd: Introduce MCD server stub

2025-04-29 Thread Mario Fleischmann
the corresponding server functions. To start the MCD monitor, configure QEMU with --enable-mcd and start it with the -mcd option. Signed-off-by: Mario Fleischmann --- MAINTAINERS| 1 + docs/interop/mcd.rst | 2 + include/exec/mcdstub.h | 17 mcd/mcd_monitor.c | 89

[PATCH v2 16/20] gdbstub: Expose gdb_write_register

2025-04-29 Thread Mario Fleischmann
Signed-off-by: Mario Fleischmann --- gdbstub/gdbstub.c | 2 +- include/exec/gdbstub.h | 10 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 291ac55..6ace944 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c

[PATCH v2 17/20] mcd: Implement register/memory access

2025-04-29 Thread Mario Fleischmann
ccess width for memory transactions. Signed-off-by: Mario Fleischmann --- mcd/mcd_qapi.c | 128 + mcd/mcd_qapi.h | 14 mcd/mcd_server.c | 207 ++- mcd/mcd_stub.c | 26 ++ qapi/mcd.json

[PATCH v2 11/20] mcd: Implement memory space query

2025-04-29 Thread Mario Fleischmann
Support three main memory space types: * Physical memory * Logical memory (MMU) * GDB Registers Use custom memory type to mark memory spaces as secure V=1 QTEST_QEMU_BINARY="./qemu-system-arm -M virt,secure=on -cpu cortex-a15" tests/qtest/mcd-test Signed-off-by: Mario Fleischmann

[PATCH v2 02/20] meson: Add --enable-mcd option

2025-04-29 Thread Mario Fleischmann
Signed-off-by: Mario Fleischmann --- docs/interop/mcd.rst | 6 ++ meson.build | 1 + meson_options.txt | 3 +++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 13 insertions(+) diff --git a/docs/interop/mcd.rst b/docs/interop/mcd.rst index

Re: [PATCH 00/16] Add Multi-Core Debug (MCD) API support

2025-04-15 Thread Mario Fleischmann
On 09.04.2025 13:37, Markus Armbruster wrote: > Alex Bennée writes: > >> Mario Fleischmann writes: >> >>> On 08.04.2025 16:37, Markus Armbruster wrote: > > [...] > >>>> Use of QAPI/QMP does not imply use of the QMP monitor. We can keep the &

Re: [PATCH 13/16] mcd: Implement register/memory access

2025-04-09 Thread Mario Fleischmann
se byte accesses, or not") and therefore the gdbstub couldn't make advantage of that. MCD does have the field tx->access_width, so a v2 of this patch will call the memory access functions repeatedly, with len = tx->access_width (if set) On 10.03.2025 16:11, Mario Fleischmann wrote:

Re: [PATCH 00/16] Add Multi-Core Debug (MCD) API support

2025-04-09 Thread Mario Fleischmann
On 08.04.2025 16:37, Markus Armbruster wrote: > Alex Bennée writes: > >> Markus Armbruster writes: >> >>> Alex Bennée writes: >>> >>>> Markus Armbruster writes: >>>> >>>>> Mario Fleischmann writes: >>

Re: [PATCH 00/16] Add Multi-Core Debug (MCD) API support

2025-04-08 Thread Mario Fleischmann
Apologies for the line wrapping in yesterday's answer. Should be fixed now. On 08.04.2025 09:00, Markus Armbruster wrote: > Mario Fleischmann writes: > >> Thanks a lot for the response, I really appreciate your time. >> >> On 07.04.2025 14:33, Markus Armbruster wr

Re: [PATCH 00/16] Add Multi-Core Debug (MCD) API support

2025-04-07 Thread Mario Fleischmann
Thanks a lot for the response, I really appreciate your time. On 07.04.2025 14:33, Markus Armbruster wrote: Mario Fleischmann writes: 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

[PATCH 00/16] Add Multi-Core Debug (MCD) API support

2025-03-15 Thread Mario Fleischmann
t;./qemu-system- [options]" tests/qtest/mcd-test * Architecture-specific tests can be found at the client stub Mario Fleischmann (16): mcd: Introduce Multi-Core Debug (MCD) API mcd: Introduce MCD server mcd: Implement target initialization API mcd: Implement server connection API m

[PATCH 11/16] mcd test: Implement core state query

2025-03-15 Thread Mario Fleischmann
Depending on the VM and CPU state, core states can be queried: * MCD_CORE_STATE_DEBUG: VM halted or CPU artifically stopped * MCD_CORE_STATE_RUNNING: VM and CPU running * MCD_CORE_STATE_HALTED: CPU suspended Signed-off-by: Mario Fleischmann --- mcd/libmcd_qapi.c | 16 + mcd

[PATCH 15/16] mcd: Implement trigger control

2025-03-15 Thread Mario Fleischmann
-core * mcd_trig_complex_core_st: mcd-trig-complex-core Signed-off-by: Mario Fleischmann --- mcd/libmcd_qapi.c | 155 +++- mcd/libmcd_qapi.h | 21 ++ mcd/mcdserver.c| 585 ++-- mcd/mcdstub_qapi.c | 290 ++ qapi/mcd

[PATCH 02/16] mcd: Introduce MCD server

2025-03-15 Thread Mario Fleischmann
/mcdrefsrv Signed-off-by: Mario Fleischmann --- MAINTAINERS | 1 + docs/interop/mcd.rst | 14 ++ mcd/mcdserver.c | 431 ++ mcd/mcdstub_qapi.c| 13 ++ mcd/meson.build | 12 ++ meson.build | 1 + qapi/mcd.json | 6

[PATCH 06/16] mcd: Implement core connection control

2025-03-11 Thread Mario Fleischmann
In MCD, core-specific operations require an open connection to the core. This commit implements the necessary operations to open and close the connection to cores. Signed-off-by: Mario Fleischmann --- mcd/mcdserver.c | 176 --- mcd/mcdstub_qapi.c

[PATCH 13/16] mcd: Implement register/memory access

2025-03-11 Thread Mario Fleischmann
In MCD, all accesses to register or memory are issued over transaction lists. This commit implements three types of transactions: * register access * logical memory access (with MMU) * physical memory access (no MMU) Signed-off-by: Mario Fleischmann --- mcd/libmcd_qapi.c | 128

[PATCH 08/16] gdbstub: Expose GDBRegisterState

2025-03-11 Thread Mario Fleischmann
Signed-off-by: Mario Fleischmann --- gdbstub/gdbstub.c | 7 --- include/exec/gdbstub.h | 8 +++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 282e13e163..8166510f06 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c

[PATCH 16/16] mcd: Implement reset control

2025-03-11 Thread Mario Fleischmann
found at https://gitlab.com/lauterbach/mcdrefsrv) Signed-off-by: Mario Fleischmann --- mcd/libmcd_qapi.c | 12 + mcd/libmcd_qapi.h | 2 + mcd/mcdserver.c| 98 -- mcd/mcdstub_qapi.c | 61 + qapi/mcd.json

[PATCH 07/16] mcd: Implement memory space query

2025-03-11 Thread Mario Fleischmann
Support three main memory space types: * Physical memory * Logical memory (MMU) * GDB Registers Use custom memory type to mark memory spaces as secure V=1 QTEST_QEMU_BINARY="./qemu-system-arm -M virt,secure=on -cpu cortex-a15" tests/qtest/mcd-test Signed-off-by: Mario Fleischmann

[PATCH 09/16] mcd: Implement register query

2025-03-11 Thread Mario Fleischmann
Directly map MCD register groups to GDB features lists Signed-off-by: Mario Fleischmann --- mcd/libmcd_qapi.c | 48 +++ mcd/libmcd_qapi.h | 8 ++ mcd/mcdserver.c | 237 -- mcd/mcdstub_qapi.c| 93 qapi/mcd.json

[PATCH 04/16] mcd: Implement server connection API

2025-03-11 Thread Mario Fleischmann
This commit implements the necessary operations required to establish a connection with the MCD server: * query information about the server * connect to " * disconnect from " Signed-off-by: Mario Fleischmann --- mcd/libmcd_qapi.c | 13 +++ mcd/libmcd_qapi.h |

[PATCH 03/16] mcd: Implement target initialization API

2025-03-10 Thread Mario Fleischmann
)serialized automatically. Signed-off-by: Mario Fleischmann --- MAINTAINERS | 2 + mcd/libmcd_qapi.c | 66 ++ mcd/libmcd_qapi.h | 26 ++ mcd/mcdserver.c | 44 - mcd/mcdstub_qapi.c| 35 mcd/meson.build

[PATCH 05/16] mcd: Implement target system query

2025-03-10 Thread Mario Fleischmann
In MCD, the target system is divided into system, devices and cores: [ system ] 1-* [ devices ] 1-* [cores] This commit implements the necessary functions to query information about the target system. Signed-off-by: Mario Fleischmann --- mcd/libmcd_qapi.c | 48 + mcd

[PATCH 10/16] mcd: Implement runstate control

2025-03-10 Thread Mario Fleischmann
Currently, only global stop is implemented Signed-off-by: Mario Fleischmann --- mcd/mcdserver.c| 74 +++-- mcd/mcdstub_qapi.c | 52 +++ qapi/mcd.json | 100 + 3 files changed, 222 insertions

[PATCH 12/16] gdbstub: Expose gdb_write_register

2025-03-10 Thread Mario Fleischmann
Signed-off-by: Mario Fleischmann --- gdbstub/gdbstub.c | 2 +- include/exec/gdbstub.h | 10 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 8166510f06..830854ef72 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c

[PATCH 14/16] mcd: Implement single stepping

2025-03-10 Thread Mario Fleischmann
gdbstub: abort gdb_set_stop_cpu when step is issued by mcdserver Signed-off-by: Mario Fleischmann --- gdbstub/gdbstub.c | 6 ++- mcd/mcdserver.c| 115 + mcd/mcdstub_qapi.c | 17 +++ qapi/mcd.json | 38 ++- 4 files changed

Re: [PATCH v4] riscv/gdbstub: add V bit to priv reg

2024-12-16 Thread Mario Fleischmann
On 15.12.2024 22:37, Yanfeng Liu wrote: This adds virtualization mode (V bit) as bit(2) of register `priv` per RiscV debug spec v1.0.0-rc4. Checked with gdb-multiarch v12.1. Note that GDB may display `INVALID` tag for `priv` reg when V bit is set, this doesn't affect actual access to the bit

Re: [PATCH v3] riscv/gdb: add V bit to priv register

2024-12-13 Thread Mario Fleischmann
Hi, apologies for the delayed review; I've just gotten to it now. On 06.12.2024 01:14, Yanfeng Liu wrote: This adds virtualization mode (V bit) as bit(2) of register `priv` per RiscV debug spec v1.0.0-rc3. Checked with gdb-multiarch v12.1. Note that GDB may display `INVALID` tag for the value

Re: [PATCH v2] riscv/gdb: add virt mode debug interface

2024-12-04 Thread Mario Fleischmann
Hi everyone, I'd like to chime in here because we are sitting on a similar patch which I wanted to send to the mailing list as soon as riscv-debug-spec v1.0.0 becomes ratified. For hypervisor support, `(qemu) info registers` isn't enough. We need to have both read and write access to the V-b