All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Markus Armbruster <armbru@redhat.com>
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: Tue, 08 Apr 2025 12:33:25 +0100	[thread overview]
Message-ID: <87a58qj3ay.fsf@draig.linaro.org> (raw)
In-Reply-To: <87r023m422.fsf@pond.sub.org> (Markus Armbruster's message of "Tue, 08 Apr 2025 10:48:53 +0200")

Markus Armbruster <armbru@redhat.com> writes:

> Mario Fleischmann <mario.fleischmann@lauterbach.com> writes:
>
>> Apologies for the line wrapping in yesterday's answer. Should be fixed now.
>>
>> On 08.04.2025 09:00, Markus Armbruster wrote:
>>> Mario Fleischmann <mario.fleischmann@lauterbach.com> writes:
>>> 
>>>> Thanks a lot for the response, I really appreciate your time.
>>>>
>>>> On 07.04.2025 14:33, Markus Armbruster wrote:
>>>>
>>>>> Mario Fleischmann <mario.fleischmann@lauterbach.com> 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 functions for implementing debug and trace.
>>>>>> However, since it is a header-file-only interface, MCD does not specify a
>>>>>> communication protocol. We get around this limitation by following a remote
>>>>>> procedure call approach using QMP. The client stub corresponding to this
>>>>>> implementation can be found at https://gitlab.com/lauterbach/mcdrefsrv
>>>>>>
>>>>>> This series is the successor to:
>>>>>> "[PATCH v5 00/18] first version of mcdstub"
>>>>>> (https://patchew.org/QEMU/20231220162555.19545-1-nicolas.eder@lauterbach.com/)
>>>>>>
>>>>>> * Architecture-independent MCD implementation
>>>>>> * QMP instead of custom TCP protocol
>>>>>
>>>>> Rationale?  There must be pros and cons.
>>>>
>>>> Assuming you're referring to the protocol of the previous patch series:
>>>> The previous TCP protocol only supported a subset of MCD. As the 
>>>> implementation progresses, the protocol eventually needs to be extended, 
>>>> possibly resulting in backwards compatibility problems.
>>>> Following an RPC approach and keeping the communication layer as close 
>>>> to the MCD API as possible results in a larger protocol at first, but 
>>>> does not need to be changed afterwards.
>>>> By directly mapping MCD functions onto QMP commands, the complexity in 
>>>> the server and client stubs can be minimized.
>>>>
>>>> Assuming you're referring to the QMP choice:
>>>> QMP is being described as the "protocol which allows applications to 
>>>> control a QEMU instance".
>>>> It provides a RPC framework which automatically (de)serializes methods 
>>>> and their parameters, even inside QTests.
>>>> The whole interface is automatically documented.
>>> 
>>> Let's see whether I understand.
>>> 
>>> MCD is an established C interface.
>>> 
>>> Your goal is to provide remote MCD for QEMU, i.e. the client uses the
>>> MCD C interface, and the interface's implementation talks to an MCD
>>> server integrated into QEMU via some remote transport.
>>> 
>>> The previous version connects the two with a bespoke protocol via TCP.
>>> The client software translates between the C interface and this
>>> protocol.  QEMU implements the protocol's server side.  Designing and
>>> maintaining a protocol is expensive.
>>> 
>>> This versions makes two changes:
>>> 
>>> 1. Instead of layering a protocol on top of MCD, you use MCD directly.
>>> This eliminates protocol design and maintenance.  Moreover, translation
>>> becomes straightforward marshaling / unmarshaling for the transport.
>>> 
>>> 2. You use QMP as a transport.  This gets you marshaling / unmarshaling
>>> for free.  It also provides some useful infrastructure for tests,
>>> documentation and such.
>>> 
>>> Fair?
>>
>> Couldn't have put it better myself.
>>
<snip>
>>> What about providing the MCD interface as a separate QMP-like protocol?
>>> It gets its own QAPI schema, just like for qemu-ga.  Simplifies
>>> compiling it out when not needed.
>>>
>>> It gets its own socket, just like the GDB stub.  Might reduce
>>> interference between debugging and QMP.
>>> 
>>> Thoughts?  Alex, Philippe, care to chime in?
>>
>> Sound reasonable to me. Keeping in mind the size of generated QAPI code,
>> an option to `./configure [...] --enable-mcd` is definitely advisable.
>
> Alex, Philippe?

When I spoke to Mario at DVCon last year I liked the idea of re-using
QMP instead of inventing yet another RPC interface for QEMU. QMP
certainly has nicer properties than the gdbstub which has a very
"organic" and "serial" feel to it.

Are you suggesting we re-use the machinery but use an entirely separate
socket with just the MCD namespace in it? I don't see that being a
problem as long as we can test it properly in the CI.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2025-04-08 11:34 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 [this message]
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
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=87a58qj3ay.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --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.