From patchwork Mon Nov 10 16:46:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 409009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C20FA14017B for ; Tue, 11 Nov 2014 03:46:59 +1100 (AEDT) Received: from localhost ([::1]:44072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xns7D-0006A6-VE for incoming@patchwork.ozlabs.org; Mon, 10 Nov 2014 11:46:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xns6b-0005Jk-DL for qemu-devel@nongnu.org; Mon, 10 Nov 2014 11:46:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xns6V-0003oo-7M for qemu-devel@nongnu.org; Mon, 10 Nov 2014 11:46:17 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41299 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xns6V-0003oa-0U for qemu-devel@nongnu.org; Mon, 10 Nov 2014 11:46:11 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 40C76ABA3; Mon, 10 Nov 2014 16:46:10 +0000 (UTC) From: Alexander Graf To: qemu-devel@nongnu.org Date: Mon, 10 Nov 2014 17:46:08 +0100 Message-Id: <1415637969-47244-2-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1415637969-47244-1-git-send-email-agraf@suse.de> References: <1415637969-47244-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: tommusta@gmail.com, riku.voipio@iki.fi Subject: [Qemu-devel] [PATCH 2.2 1/2] linux-user: Fix timer creation tswap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The timer pointer field we're writing a new timer ID into is of field abi_ulong which means we need to swab 64bits on 64bit ABI targets. Change the tswap from 32 to l to give us correct foreign-endian results. Signed-off-by: Alexander Graf --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a175cc1..f3e22c8 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9604,7 +9604,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, if (!lock_user_struct(VERIFY_WRITE, ptarget_timer, arg3, 1)) { goto efault; } - ptarget_timer->ptr = tswap32(0xcafe0000 | timer_index); + ptarget_timer->ptr = tswapl(0xcafe0000 | timer_index); unlock_user_struct(ptarget_timer, arg3, 1); } }