From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: [PATCH v3 4/9] kvmtool: add queue endianness initializer Date: Thu, 24 Apr 2014 19:17:18 +0100 Message-ID: <1398363443-3764-5-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 S1757520AbaDXSR2 (ORCPT ); Thu, 24 Apr 2014 14:17:28 -0400 In-Reply-To: <1398363443-3764-1-git-send-email-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: Add a utility function that transfers the endianness sampled at device reset time to a queue being set up. Signed-off-by: Marc Zyngier --- tools/kvm/include/kvm/virtio.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/kvm/include/kvm/virtio.h b/tools/kvm/include/kvm/virtio.h index 1180a3e..8a9eab5 100644 --- a/tools/kvm/include/kvm/virtio.h +++ b/tools/kvm/include/kvm/virtio.h @@ -28,6 +28,7 @@ struct virt_queue { It's where we assume the next request index is at. */ u16 last_avail_idx; u16 last_used_signalled; + u16 endian; }; /* @@ -165,4 +166,10 @@ static inline void *virtio_get_vq(struct kvm *kvm, u32 pfn, u32 page_size) return guest_flat_to_host(kvm, (u64)pfn * page_size); } +static inline void virtio_init_device_vq(struct virtio_device *vdev, + struct virt_queue *vq) +{ + vq->endian = vdev->endian; +} + #endif /* KVM__VIRTIO_H */ -- 1.8.3.4