qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Changpeng Liu <changpeng.liu@intel.com>
Cc: qemu-devel@nongnu.org, stefanha@gmail.com, pbonzini@redhat.com,
	marcandre.lureau@redhat.com, felipe@nutanix.com,
	james.r.harris@intel.com
Subject: Re: [Qemu-devel] [PATCH v5 1/4] vhost-user: add new vhost user messages to support virtio config space
Date: Wed, 22 Nov 2017 16:49:15 +0200	[thread overview]
Message-ID: <20171122164101-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1510865080-32027-2-git-send-email-changpeng.liu@intel.com>

On Fri, Nov 17, 2017 at 04:44:37AM +0800, Changpeng Liu wrote:
> Add VHOST_USER_GET_CONFIG/VHOST_USER_SET_CONFIG messages which can be
> used for live migration of vhost user devices, also vhost user devices
> can benefit from the messages to get/set virtio config space from/to the
> I/O target. For the purpose to support virtio config space change,
> VHOST_USER_SET_CONFIG_FD message is added as the event notifier
> in case virtio config space change in the I/O target.
> 
> Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
> ---
>  docs/interop/vhost-user.txt       | 39 ++++++++++++++++
>  hw/virtio/vhost-user.c            | 98 +++++++++++++++++++++++++++++++++++++++
>  hw/virtio/vhost.c                 | 63 +++++++++++++++++++++++++
>  include/hw/virtio/vhost-backend.h |  8 ++++
>  include/hw/virtio/vhost.h         | 16 +++++++
>  5 files changed, 224 insertions(+)
> 
> diff --git a/docs/interop/vhost-user.txt b/docs/interop/vhost-user.txt
> index 954771d..1b98388 100644
> --- a/docs/interop/vhost-user.txt
> +++ b/docs/interop/vhost-user.txt
> @@ -116,6 +116,16 @@ Depending on the request type, payload can be:
>      - 3: IOTLB invalidate
>      - 4: IOTLB access fail
>  
> + * Virtio device config space
> +   ---------------------------
> +   | offset | size | payload |
> +   ---------------------------
> +
> +   Offset: a 32-bit offset of virtio device's configuration space
> +   Size: a 32-bit size of configuration space that master wanted to change

I guess only legal values here are 1-256? But also see below. Also, we
already know the structure size.

> +   Payload: a 256-bytes array holding the contents of the virtio
> +       device's configuration space
> +

Why not *size* bytes? These are not performance critical but still,
why waste cycles.

>  In QEMU the vhost-user message is implemented with the following struct:
>  
>  typedef struct VhostUserMsg {

Virtio spec says:
	For device configuration access, the driver MUST use 8-bit wide accesses for 8-bit wide fields, 16-bit wide
	and aligned accesses for 16-bit wide fields and 32-bit wide and aligned accesses for 32-bit and 64-bit wide
	fields. For 64-bit fields, the driver MAY access each of the high and low 32-bit parts of the field independently.

So if these commands mirror guest accesses, they are always 1,2,4 or 8 bytes,
and aligned.


-- 
MST

  parent reply	other threads:[~2017-11-22 14:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-16 20:44 [Qemu-devel] [PATCH v5 0/4] *** Introduce a new vhost-user-blk host device to Qemu *** Changpeng Liu
2017-11-16 20:44 ` [Qemu-devel] [PATCH v5 1/4] vhost-user: add new vhost user messages to support virtio config space Changpeng Liu
2017-11-20 16:26   ` Stefan Hajnoczi
2017-11-20 20:44     ` Michael S. Tsirkin
2017-11-21  0:16       ` Paolo Bonzini
2017-11-21  3:12         ` Michael S. Tsirkin
2017-11-22 14:36           ` Paolo Bonzini
2017-11-22  2:27         ` Liu, Changpeng
2017-11-22  2:28       ` Liu, Changpeng
2017-11-22  2:25     ` Liu, Changpeng
2017-11-22 14:49   ` Michael S. Tsirkin [this message]
2017-11-16 20:44 ` [Qemu-devel] [PATCH v5 2/4] vhost-user-blk: introduce a new vhost-user-blk host device Changpeng Liu
2017-11-16 20:44 ` [Qemu-devel] [PATCH v5 3/4] contrib/libvhost-user: enable virtio config space messages Changpeng Liu
2017-11-16 20:44 ` [Qemu-devel] [PATCH v5 4/4] contrib/vhost-user-blk: introduce a vhost-user-blk sample application Changpeng Liu

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=20171122164101-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=changpeng.liu@intel.com \
    --cc=felipe@nutanix.com \
    --cc=james.r.harris@intel.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).