On Thu, Feb 05, 2026 at 08:57:56PM +0100, Ruslan Ruslichenko wrote: > From: Ruslan Ruslichenko <[email protected]> > > Introduce packet definition for Remote Port protocol. > > Remote Port is a socket based inter-simulation protocol > designed to connect QEMU to external simulator (such as > SystemC models, RTL simulators, etc) for hardware co- > simulation. > > The protocol supports bidirectional communication for: > - Connection setup, version negotiation (Hello/Cfg packets) > - Memory and MMIO transactions (Read/Write packets) > - Interrupts and GPIO signaling (Interrupt packets) > - Time synchronization (Sync packets) > > The patch introduces header file with packet definition > used by protocol. > > Signed-off-by: Edgar E. Iglesias <[email protected]> > Signed-off-by: Takahiro Nakata <[email protected]> > Signed-off-by: Ruslan Ruslichenko <[email protected]> > --- > include/hw/core/remote-port-proto.h | 305 ++++++++++++++++++++++++++++ > 1 file changed, 305 insertions(+) > create mode 100644 include/hw/core/remote-port-proto.h > > diff --git a/include/hw/core/remote-port-proto.h > b/include/hw/core/remote-port-proto.h > new file mode 100644 > index 0000000000..cbe1498df0 > --- /dev/null > +++ b/include/hw/core/remote-port-proto.h > @@ -0,0 +1,305 @@ > +// SPDX-License-Identifier: MIT
Preferrably stick this inside the comment block below instead of mixing C and C++ style comments. > +/* > + * QEMU remote port protocol parts. > + * > + * Copyright (c) 2013 Xilinx Inc > + * Written by Edgar E. Iglesias <[email protected]> > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > copy > + * of this software and associated documentation files (the "Software"), to > deal > + * in the Software without restriction, including without limitation the > rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be included in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN > + * THE SOFTWARE. Including this is OK, since IIUC in this case you're carrying on with someone else's code, and so aren't permitted to remove their license comment. If there are any files later in the series that you wrote yourself from scratch though, they can omit any license comments, only the SPDX is need. > + */ > +#ifndef REMOTE_PORT_PROTO_H__ > +#define REMOTE_PORT_PROTO_H__ > + > +/* > + * Remote-Port (RP) is an inter-simulator protocol. It assumes a reliable > + * point to point communcation with the remote simulation environment. > + * > + * Setup > + * In the SETUP phase a mandatory HELLO packet is exchanged with optional > + * CFG packets following. HELLO packets are useful to ensure that both > + * sides are speaking the same protocol and using compatible versions. > + * > + * CFG packets are used to negotiate configuration options. At the moment > + * these remain unimplemented. > + * > + * Once the session is up, communication can start through various other > + * commands. The list can be found further down this document. > + * Commands are carried over RP packets. Every RP packet contains a header > + * with length, flags and an ID to track potential responses. > + * The header is followed by a packet specific payload. You'll find the > + * details of the various commands packet layouts here. Some commands can > + * carry data/blobs in their payload. > + */ > + > + > +#define RP_VERSION_MAJOR 4 > +#define RP_VERSION_MINOR 3 > + > +#if defined(_WIN32) && defined(__MINGW32__) > +/* mingw GCC has a bug with packed attributes. */ > +#define PACKED __attribute__ ((gcc_struct, packed)) > +#else > +#define PACKED __attribute__ ((packed)) > +#endif Is this comment & conditional #define still relevant today ? For the rest of QEMU we just use QEMU_PACKED whose definition matches the #else clause. Ideally change the patch to use QEMU_PACKED, if not, mention in the commit message why it can't be used. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
