From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: [PATCH v3 6/9] kvmtool: convert 9p backend to support bi-endianness Date: Thu, 24 Apr 2014 19:17:20 +0100 Message-ID: <1398363443-3764-7-git-send-email-marc.zyngier@arm.com> References: <1398363443-3764-1-git-send-email-marc.zyngier@arm.com> Cc: Will Deacon , Pekka Enberg To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Return-path: Received: from fw-tnat.austin.arm.com ([217.140.110.23]:20279 "EHLO collaborate-mta1.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757520AbaDXSRa (ORCPT ); Thu, 24 Apr 2014 14:17:30 -0400 In-Reply-To: <1398363443-3764-1-git-send-email-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: Configure the queues to follow the guest endianness, and make sure the configuration space is doing the same. Signed-off-by: Marc Zyngier --- tools/kvm/virtio/9p.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/kvm/virtio/9p.c b/tools/kvm/virtio/9p.c index 847eddb..9073a1e 100644 --- a/tools/kvm/virtio/9p.c +++ b/tools/kvm/virtio/9p.c @@ -1252,8 +1252,10 @@ static u32 get_host_features(struct kvm *kvm, void *dev) 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 = virtio_host_to_guest_u16(&p9dev->vdev, conf->tag_len); } static int init_vq(struct kvm *kvm, void *dev, u32 vq, u32 page_size, u32 align, @@ -1272,6 +1274,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); + virtio_init_device_vq(&p9dev->vdev, queue); *job = (struct p9_dev_job) { .vq = queue, -- 1.8.3.4