From: marc.zyngier@arm.com (Marc Zyngier)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] kvmtool: convert 9p backend to support bi-endianness
Date: Fri, 11 Oct 2013 15:36:32 +0100 [thread overview]
Message-ID: <1381502195-8263-5-git-send-email-marc.zyngier@arm.com> (raw)
In-Reply-To: <1381502195-8263-1-git-send-email-marc.zyngier@arm.com>
Advertise bi-endianness support in the feature flags, and provide
byte-swapping of the config structure depending on the guest selection.
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
tools/kvm/virtio/9p.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c
index 127b13a..b823306 100644
--- a/tools/kvm/virtio/9p.c
+++ b/tools/kvm/virtio/9p.c
@@ -1245,14 +1245,16 @@ static u8 *get_config(struct kvm *kvm, void *dev)
static u32 get_host_features(struct kvm *kvm, void *dev)
{
- return 1 << VIRTIO_9P_MOUNT_TAG;
+ return (1 << VIRTIO_9P_MOUNT_TAG) | VIRTIO_RING_ENDIAN;
}
static void set_guest_features(struct kvm *kvm, void *dev, u32 features)
{
struct p9_dev *p9dev = dev;
+ struct virtio_9p_config *conf = p9dev->config;
p9dev->features = features;
+ conf->tag_len = htole16(conf->tag_len);
}
static int init_vq(struct kvm *kvm, void *dev, u32 vq, u32 page_size, u32 align,
@@ -1271,6 +1273,7 @@ static int init_vq(struct kvm *kvm, void *dev, u32 vq, u32 page_size, u32 align,
job = &p9dev->jobs[vq];
vring_init(&queue->vring, VIRTQUEUE_NUM, p, align);
+ virt_queue__init(queue, p9dev->features);
*job = (struct p9_dev_job) {
.vq = queue,
--
1.8.2.3
next prev parent reply other threads:[~2013-10-11 14:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-11 14:36 [PATCH 0/7] kvmtool: handle guests of a different endianness Marc Zyngier
2013-10-11 14:36 ` [PATCH 1/7] kvmtool: virt_queue configuration based on endianness Marc Zyngier
2013-10-11 14:36 ` [PATCH 2/7] kvmtool: virt_queue: handle guest endianness Marc Zyngier
2013-10-11 14:50 ` Will Deacon
2013-10-11 16:54 ` Robin Murphy
2013-10-11 14:36 ` [PATCH 3/7] kvmtool: convert console backend to support bi-endianness Marc Zyngier
2013-10-11 14:36 ` Marc Zyngier [this message]
2013-10-11 14:36 ` [PATCH 5/7] kvmtool: convert blk " Marc Zyngier
2013-10-11 14:36 ` [PATCH 6/7] kvmtool: convert net " Marc Zyngier
2013-10-11 14:36 ` [PATCH 7/7] kvmtool: virtio: enable arm/arm64 support for bi-endianness Marc Zyngier
2013-10-14 13:05 ` Paolo Bonzini
2013-10-14 13:17 ` Marc Zyngier
2013-10-11 14:54 ` [PATCH 0/7] kvmtool: handle guests of a different endianness Will Deacon
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=1381502195-8263-5-git-send-email-marc.zyngier@arm.com \
--to=marc.zyngier@arm.com \
--cc=linux-arm-kernel@lists.infradead.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).