From: Fam Zheng <famz@redhat.com>
To: "Bryan D. Payne" <bdpayne@acm.org>
Cc: qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH] qmp: extend QMP to provide read/write access to physical memory
Date: Thu, 4 Dec 2014 12:57:33 +0800 [thread overview]
Message-ID: <20141204045733.GA25575@ad.nay.redhat.com> (raw)
In-Reply-To: <CAFpPvXDLHzS-BuNvrONhAqEy9khV-MeKFL_TXO3kG=GSm2bYog@mail.gmail.com>
On Wed, 12/03 19:37, Bryan D. Payne wrote:
> >
> > Out of curiosity, what are existing solutions?
> >
>
> Basically just attaching gdb and pulling memory out manually (or writing a
> program to do the same).
>
>
> > +struct request {
> > > + uint8_t type; /* 0 quit, 1 read, 2 write, ... rest reserved */
> > > + uint64_t address; /* address to read from OR write to */
> > > + uint64_t length; /* number of bytes to read OR write */
> > > +};
> >
> > Please add QEMU_PACKED to this structure, and probably name it
> > QEMUMARequest,
> > for name collision avoidance and CamelCase convension.
> >
>
> How critical is QEMU_PACKED? This changes the layout of the struct which
> means that existing clients (LibVMI) would need to change their code as
> well.
It is critical as a transport data structure. You have to define a byte-by-byte
layout (concerning endianness and padding) and use padding fields together with
QEMU_PACKED, so the representation is not dependent on alignment:
http://en.wikipedia.org/wiki/Data_structure_alignment
For example:
typedef struct {
union {
uint8_t type;
uint64_t padding;
};
uint64_t address;
uint64_t length;
} QEMU_PACKED QEMUMARequest;
It also means that client need to use the same endianness with us, but there is
no way to query it.
An alternative might be carry endianness information in the protocol
negotiation or in request.
Fam
next prev parent reply other threads:[~2014-12-04 4:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-26 8:41 [Qemu-devel] [PATCH 0/1] qmp: extend QMP to provide read/write access to physical memory Bryan D. Payne
2014-11-26 8:41 ` [Qemu-devel] [PATCH 1/1] " Bryan D. Payne
2014-11-26 15:16 ` Eric Blake
2014-11-26 20:27 ` [Qemu-devel] [PATCH v2] " Bryan D. Payne
2014-11-26 20:27 ` [Qemu-devel] [PATCH] " Bryan D. Payne
2014-11-27 2:04 ` Fam Zheng
2014-12-04 3:37 ` Bryan D. Payne
2014-12-04 4:57 ` Fam Zheng [this message]
2014-12-04 6:28 ` Bryan D. Payne
2014-12-04 7:38 ` Fam Zheng
2014-12-04 16:43 ` Bryan D. Payne
2014-12-05 1:20 ` Fam Zheng
2014-12-04 9:08 ` Markus Armbruster
2014-12-04 16:49 ` Bryan D. Payne
2014-12-05 8:44 ` Markus Armbruster
2014-12-05 21:25 ` Bryan D. Payne
2014-12-08 15:06 ` Markus Armbruster
2014-12-09 15:12 ` Bryan D. Payne
2014-12-11 3:33 ` Bryan D. Payne
2014-12-11 5:45 ` Fam Zheng
2014-12-11 6:07 ` Bryan D. Payne
2014-12-12 2:28 ` Bryan D. Payne
2014-12-12 3:29 ` Fam Zheng
2014-12-01 22:10 ` Eric Blake
2014-12-03 23:07 ` Bryan D. Payne
2014-12-04 15:08 ` Eric Blake
2014-12-04 16:50 ` Bryan D. Payne
2014-12-04 18:40 ` Bryan D. Payne
2014-12-04 22:43 ` Eric Blake
2014-12-01 22:12 ` [Qemu-devel] [PATCH v2] " Eric Blake
2014-12-02 4:36 ` Bryan D. Payne
2014-12-02 5:26 ` Fam Zheng
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=20141204045733.GA25575@ad.nay.redhat.com \
--to=famz@redhat.com \
--cc=bdpayne@acm.org \
--cc=lcapitulino@redhat.com \
--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 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).