From patchwork Tue Aug 19 08:32:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 35563 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 583052136C for ; Tue, 19 Aug 2014 08:41:39 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id la4sf19192371vcb.6 for ; Tue, 19 Aug 2014 01:41:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=vHQSg+nupvOYCt+L8UW/dJH4d8L9yYdnHO5L8vdRCs0=; b=AHlX5yWGt/U+6AGIZZAFUm9HgyAVZ1yY6LdD5pgUPKBYOGKucVgwa4bms4KU99Fia2 VnTGfGunI5WSMPv4XIEUNJXAYTHE4goGL+2C+tB25sELBlkWEyVdDm+JalW5qv3UWn94 1DNC+8Q6PP8Via073fSsbMFMoSrHDKLlWqgFm8rtL5YCxE4efGThmcTKjHhNKrlE4WwL 9tWHTeRO8A+isg4uXcBUz+4mjW9f2xYJgHG7Kee1sK/zaKmmd/MnHwsjKh6eguigY4AB NU08bHej9YeWtC7euSVI85GYeky9k4xWEH42fK6ozoP9Jve2nzxWFKUYYpgJ6eMK3jFb Olcg== X-Gm-Message-State: ALoCoQmruDrQ3gUnIgQ3M1Puw7JLRh7xC7eQINWqeJGmQ7klJRXpB3x/470NE8Vd34+GJk4+5avp X-Received: by 10.236.207.164 with SMTP id n24mr19686750yho.5.1408437698979; Tue, 19 Aug 2014 01:41:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.102.23 with SMTP id v23ls2708338qge.51.gmail; Tue, 19 Aug 2014 01:41:38 -0700 (PDT) X-Received: by 10.221.64.142 with SMTP id xi14mr10014539vcb.31.1408437698886; Tue, 19 Aug 2014 01:41:38 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id id4si8327920vdb.100.2014.08.19.01.41.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 01:41:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf12so6996906vcb.40 for ; Tue, 19 Aug 2014 01:41:38 -0700 (PDT) X-Received: by 10.221.5.137 with SMTP id og9mr29235311vcb.18.1408437698798; Tue, 19 Aug 2014 01:41:38 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp220678vcb; Tue, 19 Aug 2014 01:41:38 -0700 (PDT) X-Received: by 10.229.140.70 with SMTP id h6mr64660041qcu.3.1408437697792; Tue, 19 Aug 2014 01:41:37 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d4si27994494qco.47.2014.08.19.01.41.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 19 Aug 2014 01:41:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:49136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJez3-0006Uh-D0 for patch@linaro.org; Tue, 19 Aug 2014 04:41:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJequ-00013Y-GU for qemu-devel@nongnu.org; Tue, 19 Aug 2014 04:33:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJeql-0001aM-Qk for qemu-devel@nongnu.org; Tue, 19 Aug 2014 04:33:12 -0400 Received: from afflict.kos.to ([92.243.29.197]:35171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJeql-0001ZE-Kf for qemu-devel@nongnu.org; Tue, 19 Aug 2014 04:33:03 -0400 Received: from afflict.kos.to (afflict [92.243.29.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 0DE7D26645; Tue, 19 Aug 2014 10:33:02 +0200 (CEST) From: riku.voipio@linaro.org To: Peter Maydell , qemu-devel@nongnu.org Date: Tue, 19 Aug 2014 11:32:48 +0300 Message-Id: X-Mailer: git-send-email 1.7.10.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Tom Musta Subject: [Qemu-devel] [PULL v2 13/23] linux-user: Make ipc syscall's third argument an abi_long 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Tom Musta For those target ABIs that use the ipc system call (e.g. POWER), the third argument is used in the shmat path as a pointer. It therefore must be declared as an abi_long (versus int) so that the address bits are not lost in truncation. In fact, all arguments to do_ipc should be declared as abit_long. In fact, it makes more sense for all of the arguments to be declaried as abi_long (except call). Signed-off-by: Tom Musta Signed-off-by: Riku Voipio --- linux-user/syscall.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ba9dfc5..db40829 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3130,8 +3130,8 @@ static inline abi_long do_shmdt(abi_ulong shmaddr) #ifdef TARGET_NR_ipc /* ??? This only works with linear mappings. */ /* do_ipc() must return target values and target errnos. */ -static abi_long do_ipc(unsigned int call, int first, - int second, int third, +static abi_long do_ipc(unsigned int call, abi_long first, + abi_long second, abi_long third, abi_long ptr, abi_long fifth) { int version; @@ -3153,9 +3153,9 @@ static abi_long do_ipc(unsigned int call, int first, /* The semun argument to semctl is passed by value, so dereference the * ptr argument. */ abi_ulong atptr; - get_user_ual(atptr, (abi_ulong)ptr); + get_user_ual(atptr, ptr); ret = do_semctl(first, second, third, - (union target_semun)(abi_ulong) atptr); + (union target_semun) atptr); break; }