From patchwork Mon Jan 24 21:10:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 80259 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 4255BB710F for ; Tue, 25 Jan 2011 08:27:51 +1100 (EST) Received: from localhost ([127.0.0.1]:41310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhTwy-0000Q3-Ca for incoming@patchwork.ozlabs.org; Mon, 24 Jan 2011 16:27:48 -0500 Received: from [140.186.70.92] (port=60380 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhTfE-0000mm-7T for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:09:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhTfB-0007Ia-Kg for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:09:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhTfB-0007IE-Dt for qemu-devel@nongnu.org; Mon, 24 Jan 2011 16:09:25 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0OL9NKe021122 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Jan 2011 16:09:23 -0500 Received: from dhcp-5-188.str.redhat.com (vpn1-5-230.ams2.redhat.com [10.36.5.230]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0OL9I6w003712; Mon, 24 Jan 2011 16:09:21 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Mon, 24 Jan 2011 22:10:30 +0100 Message-Id: <1295903452-18017-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1295903452-18017-1-git-send-email-kwolf@redhat.com> References: <1295903452-18017-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 01/23] qcow2: fix unaligned access 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 From: Aurelien Jarno cpu_to_be64w() is called with an obviously non-aligned pointer. Use cpu_to_be64wu() instead. It fixes unaligned accesses errors on IA64 hosts. Cc: Kevin Wolf Signed-off-by: Aurelien Jarno Signed-off-by: Kevin Wolf --- block/qcow2-cluster.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index 6928c63..c3ef550 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -81,7 +81,7 @@ int qcow2_grow_l1_table(BlockDriverState *bs, int min_size, bool exact_size) /* set new table */ BLKDBG_EVENT(bs->file, BLKDBG_L1_GROW_ACTIVATE_TABLE); cpu_to_be32w((uint32_t*)data, new_l1_size); - cpu_to_be64w((uint64_t*)(data + 4), new_l1_table_offset); + cpu_to_be64wu((uint64_t*)(data + 4), new_l1_table_offset); ret = bdrv_pwrite_sync(bs->file, offsetof(QCowHeader, l1_size), data,sizeof(data)); if (ret < 0) { goto fail;