From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: "Cédric Le Goater" <clg@fr.ibm.com>
Cc: mst@redhat.com, aik@ozlabs.ru, agraf@suse.de,
qemu-devel@nongnu.org, qemu-ppc@nongnu.org, paulus@samba.org
Subject: Re: [Qemu-devel] [RFC PATCH 1/2] vhost: add VHOST_VRING_F_BYTESWAP flag
Date: Mon, 3 Nov 2014 16:29:31 +0100 [thread overview]
Message-ID: <20141103162931.4edbed1f.cornelia.huck@de.ibm.com> (raw)
In-Reply-To: <1414572130-17014-2-git-send-email-clg@fr.ibm.com>
On Wed, 29 Oct 2014 09:42:09 +0100
Cédric Le Goater <clg@fr.ibm.com> wrote:
> When the guest and the host have a different endian order, the data
> being accessed in the vring queues needs to be byteswapped.
>
> This patch adds a VHOST_VRING_F_BYTESWAP flag to inform the vhost
> kernel backend to byteswap vring data.
>
> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
> ---
> hw/virtio/vhost.c | 25 ++++++++++++++++++++++++-
> include/hw/virtio/vhost.h | 1 +
> linux-headers/linux/vhost.h | 3 +++
> 3 files changed, 28 insertions(+), 1 deletion(-)
> +static bool vhost_virtqueue_needs_byteswap(VirtIODevice *vdev)
> +{
> +#ifdef TARGET_IS_BIENDIAN
> +#ifdef HOST_WORDS_BIGENDIAN
> + return !virtio_is_big_endian(vdev);
> +#else
> + return virtio_is_big_endian(vdev);
> +#endif
> +
> +#else
> + return false;
> +#endif
> +}
*thinks aloud*
We call this function after features have been negotiated, so we should
be able to reuse this interface for virtio-1 by checking for
VIRTIO_F_VERSION_1, right?
next prev parent reply other threads:[~2014-11-03 15:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-29 8:42 [Qemu-devel] [RFC PATCH 0/2] vhost: support for cross endian Cédric Le Goater
2014-10-29 8:42 ` [Qemu-devel] [RFC PATCH 1/2] vhost: add VHOST_VRING_F_BYTESWAP flag Cédric Le Goater
2014-11-03 15:29 ` Cornelia Huck [this message]
2014-11-03 17:33 ` [Qemu-devel] [Qemu-ppc] " Greg Kurz
2014-10-29 8:42 ` [Qemu-devel] [RFC PATCH 2/2] vhost_net: re-enable when cross endian Cédric Le Goater
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=20141103162931.4edbed1f.cornelia.huck@de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=clg@fr.ibm.com \
--cc=mst@redhat.com \
--cc=paulus@samba.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).