From patchwork Mon Apr 4 14:32:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 89631 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DC666B6FB2 for ; Tue, 5 Apr 2011 00:35:37 +1000 (EST) Received: from localhost ([127.0.0.1]:60521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6ksQ-0004TA-3t for incoming@patchwork.ozlabs.org; Mon, 04 Apr 2011 10:35:34 -0400 Received: from [140.186.70.92] (port=58585 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6kpS-0003Wp-5Q for qemu-devel@nongnu.org; Mon, 04 Apr 2011 10:32:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6kpO-00036r-NS for qemu-devel@nongnu.org; Mon, 04 Apr 2011 10:32:28 -0400 Received: from cantor2.suse.de ([195.135.220.15]:37646 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6kpO-000365-Ej for qemu-devel@nongnu.org; Mon, 04 Apr 2011 10:32:26 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id D69FB5FC9F; Mon, 4 Apr 2011 16:32:24 +0200 (CEST) From: Alexander Graf To: QEMU-devel Developers Date: Mon, 4 Apr 2011 16:32:10 +0200 Message-Id: <1301927544-32767-2-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1301927544-32767-1-git-send-email-agraf@suse.de> References: <1301927544-32767-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 195.135.220.15 Cc: peter.maydell@linaro.org, Aurelien Jarno , Richard Henderson Subject: [Qemu-devel] [PATCH 01/15] s390x: fix virtio feature bitmap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The feature bitmap in the s390 virtio machine is little endian. To address for that, we need to bswap the values after reading them out. Signed-off-by: Alexander Graf --- hw/s390-virtio-bus.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c index 58af164..60e0135 100644 --- a/hw/s390-virtio-bus.c +++ b/hw/s390-virtio-bus.c @@ -223,7 +223,7 @@ void s390_virtio_device_sync(VirtIOS390Device *dev) cur_offs += num_vq * VIRTIO_VQCONFIG_LEN; /* Sync feature bitmap */ - stl_phys(cur_offs, dev->host_features); + stl_phys(cur_offs, bswap32(dev->host_features)); dev->feat_offs = cur_offs + dev->feat_len; cur_offs += dev->feat_len * 2; @@ -246,7 +246,7 @@ void s390_virtio_device_update_status(VirtIOS390Device *dev) /* Update guest supported feature bitmap */ - features = ldl_phys(dev->feat_offs); + features = bswap32(ldl_phys(dev->feat_offs)); if (vdev->set_features) { vdev->set_features(vdev, features); }