From patchwork Tue Dec 6 03:42:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Evans X-Patchwork-Id: 129519 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EB97FB6FA0 for ; Tue, 6 Dec 2011 14:41:45 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754606Ab1LFDlo (ORCPT ); Mon, 5 Dec 2011 22:41:44 -0500 Received: from ozlabs.org ([203.10.76.45]:52913 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756393Ab1LFDlo (ORCPT ); Mon, 5 Dec 2011 22:41:44 -0500 Received: from [10.61.2.183] (ibmaus65.lnk.telstra.net [165.228.126.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPSA id 3E65DB6F9F; Tue, 6 Dec 2011 14:41:39 +1100 (EST) Message-ID: <4EDD8F25.7080106@ozlabs.org> Date: Tue, 06 Dec 2011 14:42:29 +1100 From: Matt Evans User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15 MIME-Version: 1.0 To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Subject: [PATCH 24/28] kvm tools: Fix virtio-pci endian bug when reading VIRTIO_PCI_QUEUE_NUM References: In-Reply-To: Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org The field size is currently wrong, read into a 32bit word instead of 16. This casues trouble when BE. Signed-off-by: Matt Evans --- tools/kvm/virtio/pci.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c index 0ae93fb..6b27ff8 100644 --- a/tools/kvm/virtio/pci.c +++ b/tools/kvm/virtio/pci.c @@ -116,8 +116,7 @@ static bool virtio_pci__io_in(struct ioport *ioport, struct kvm *kvm, u16 port, break; case VIRTIO_PCI_QUEUE_NUM: val = vtrans->virtio_ops->get_size_vq(kvm, vpci->dev, vpci->queue_selector); - ioport__write32(data, val); - break; + ioport__write16(data, val); break; case VIRTIO_PCI_STATUS: ioport__write8(data, vpci->status);