From: Markus Armbruster <armbru@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: Mario Fleischmann <mario.fleischmann@lauterbach.com>,
qemu-devel@nongnu.org, philmd@linaro.org,
christian.boenig@lauterbach.com
Subject: Re: [PATCH 00/16] Add Multi-Core Debug (MCD) API support
Date: Wed, 09 Apr 2025 13:37:06 +0200 [thread overview]
Message-ID: <8734ehbm71.fsf@pond.sub.org> (raw)
In-Reply-To: <875xjdheaj.fsf@draig.linaro.org> ("Alex Bennée"'s message of "Wed, 09 Apr 2025 10:31:16 +0100")
Alex Bennée <alex.bennee@linaro.org> writes:
> Mario Fleischmann <mario.fleischmann@lauterbach.com> 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
>>> monitor and the debugging interface separate even though both are based
>>> on QAPI/QMP.
>>>
>>> The monitor code is gnarly, I'm afraid. It supports multiple monitors,
>>> but they are not fully independent for historical reasons, chiefly
>>> implied mutual exclusion for commands. Adding a QAPI/QMP-based
>>> debugging interface without undue coupling to monitors may pose a few
>>> technical problems. One way to find out.
>>
>> If I understand you correctly, when QAPI-MCD runs on a separate socket
>> without using a monitor, it's still coupled to the monitor code
>> internally? Does this have an influence on the either the usage of a
>> monitor or the MCD interface or is it rather an implementation detail?
>
> An implementation detail - we should try and avoid needless coupling if
> we can though.
>
> AFAIK not all monitor commands map to QMP equivalents but I'm not sure
> if that's true the other way around - can you do everything you can over
> QMP under HMP? If you don't have to then that implies we can over a
> separate schema on a debug socket that doesn't need monitor bits tied
> in.
Ideally, HMP commands are human-friendly wrappers around QMP commands.
Such commands can't do anything that could be done with QMP.
Not all the functionality of QMP needs to be exposed in HMP. Some
functionality might only exist in QMP. How much to expose is a
pragmatic "is it worth the bother?" decision.
Certain HMP commands make no sense in QMP. Examples:
* HMP cpu sets the default CPU. The concept doesn't exist in QMP.
* Ad hoc debugging commands that are used only by humans, such as
sync-profile.
* The desk calculator[*]
My abstract mental model of MCD has it completely separate from monitors
(HMP and QMP). Just like gdbstub.
We're considering to use QAPI/QMP as interface definition and transport
infrastructure.
Mario's patches do that in a simple way: by "embedding" MCD in the QMP
monitor. This creates a coupling that doesn't exist in my abstract
mental model.
We could have a separate QAPI schema for interface definition, and a
separate socket for transport. This avoids coupling.
Obviously, we'd still want to reuse existing QMP infrastructure as much
as practical. Some of that that code is gnarly. If we're not careful,
we get some subtle coupling deep under the hood.
Here's one possible complication. While we can have any number of QMP
monitors, we still funnel most[**] commands to the main loop thread,
where they run one after the other. If we reuse all that machinery for
MCD, we end up forcing MCD commands through the same funnel to the main
loop thread. This coupling could be undesirable.
Before we contemplate how to press the existing QMP infrastructure into
service for MCD, we should first figure out how we'd want MCD to operate
if we started on a green field. Can we have more than one MCD
connection? Which thread should execure MCD commands? Any locking
requirements? Any need for asynchronous commands?
[*] Which arguably makes no sense in HMP either.
[**] Not out-of-band commands. You probably don't want to know more.
next prev parent reply other threads:[~2025-04-09 11:38 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-10 15:04 [PATCH 00/16] Add Multi-Core Debug (MCD) API support Mario Fleischmann
2025-03-10 15:04 ` [PATCH 01/16] mcd: Introduce Multi-Core Debug (MCD) API Mario Fleischmann
2025-03-10 15:04 ` [PATCH 02/16] mcd: Introduce MCD server Mario Fleischmann
2025-03-10 15:04 ` [PATCH 03/16] mcd: Implement target initialization API Mario Fleischmann
2025-03-10 15:04 ` [PATCH 04/16] mcd: Implement server connection API Mario Fleischmann
2025-03-10 15:04 ` [PATCH 05/16] mcd: Implement target system query Mario Fleischmann
2025-03-10 15:05 ` [PATCH 06/16] mcd: Implement core connection control Mario Fleischmann
2025-03-10 15:05 ` [PATCH 07/16] mcd: Implement memory space query Mario Fleischmann
2025-03-10 15:05 ` [PATCH 08/16] gdbstub: Expose GDBRegisterState Mario Fleischmann
2025-03-10 15:05 ` [PATCH 09/16] mcd: Implement register query Mario Fleischmann
2025-03-10 15:05 ` [PATCH 10/16] mcd: Implement runstate control Mario Fleischmann
2025-03-10 15:05 ` [PATCH 11/16] mcd test: Implement core state query Mario Fleischmann
2025-03-10 15:05 ` [PATCH 12/16] gdbstub: Expose gdb_write_register Mario Fleischmann
2025-03-10 15:05 ` [PATCH 13/16] mcd: Implement register/memory access Mario Fleischmann
2025-04-09 9:00 ` Mario Fleischmann
2025-03-10 15:05 ` [PATCH 14/16] mcd: Implement single stepping Mario Fleischmann
2025-03-10 15:05 ` [PATCH 15/16] mcd: Implement trigger control Mario Fleischmann
2025-03-10 15:05 ` [PATCH 16/16] mcd: Implement reset control Mario Fleischmann
2025-04-07 12:33 ` [PATCH 00/16] Add Multi-Core Debug (MCD) API support Markus Armbruster
2025-04-07 17:26 ` Mario Fleischmann
2025-04-08 7:00 ` Markus Armbruster
2025-04-08 8:09 ` Mario Fleischmann
2025-04-08 8:48 ` Markus Armbruster
2025-04-08 11:33 ` Alex Bennée
2025-04-08 11:58 ` Markus Armbruster
2025-04-08 14:16 ` Alex Bennée
2025-04-08 14:36 ` Markus Armbruster
2025-04-09 8:46 ` Mario Fleischmann
2025-04-09 9:31 ` Alex Bennée
2025-04-09 11:37 ` Markus Armbruster [this message]
2025-04-15 8:06 ` Mario Fleischmann
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=8734ehbm71.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=christian.boenig@lauterbach.com \
--cc=mario.fleischmann@lauterbach.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/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.