From patchwork Fri Aug 22 13:24:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 35810 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A090720540 for ; Fri, 22 Aug 2014 13:33:31 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id ij19sf31573983vcb.4 for ; Fri, 22 Aug 2014 06:33:31 -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=Y1SzRRaRlE1GRmtdf4Zj/OFVkNmSQIoVWJmwZUXZQcM=; b=laFIxW5GmG6FjBmDvakvv07Nl1LVjMCZ2WJeTCI6SG3z+eXVTZJZVLh5Td+wEfR0S2 JS05NVrNLdMr9uoqUvKSR8NKITSChFScw4cw+vMLEh/UW35//ZMYmnfvnPJLVmp3wUgs 9cULwxrw3+g3wPquiSz3gG+vrxliKTs4X/AEGZFX9QUtTQr6mIeFxV3oeIf84Tb/TnvF j0m2J6zp4oLoAl9LLxMEHc/VOx6U8bR4qtmem6RwKuB35hurOcu/SWEg9qeA82Dms8oM AP5iCw7GZAqvFj15YPWYvfIAvCJxCyzCRbAX3yo0WWq4fjZWN9eIaOeUleUmbSz5FcNL Lq3g== X-Gm-Message-State: ALoCoQmob17VhcY2N1fcVV0ln0++cldkxwGvq/3F2yJ7MMDcgFxfdRvlHOPz0ZuMbBHBS2EqHQiC X-Received: by 10.236.38.9 with SMTP id z9mr3936792yha.23.1408714411175; Fri, 22 Aug 2014 06:33:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.16.232 with SMTP id 95ls1178903qgb.94.gmail; Fri, 22 Aug 2014 06:33:31 -0700 (PDT) X-Received: by 10.52.234.228 with SMTP id uh4mr725955vdc.34.1408714411103; Fri, 22 Aug 2014 06:33:31 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id tb18si13563435vdb.72.2014.08.22.06.33.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:33:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id im17so12414858vcb.3 for ; Fri, 22 Aug 2014 06:33:30 -0700 (PDT) X-Received: by 10.52.165.129 with SMTP id yy1mr143307vdb.57.1408714410960; Fri, 22 Aug 2014 06:33:30 -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.45.67 with SMTP id uj3csp17241vcb; Fri, 22 Aug 2014 06:33:30 -0700 (PDT) X-Received: by 10.140.81.51 with SMTP id e48mr7558055qgd.31.1408714410344; Fri, 22 Aug 2014 06:33:30 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g2si42233076qab.124.2014.08.22.06.33.30 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 22 Aug 2014 06:33:30 -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]:37143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKoy9-0000T8-Uc for patch@linaro.org; Fri, 22 Aug 2014 09:33:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKopo-0006Wn-70 for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKopg-0002Bp-Ne for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:52 -0400 Received: from afflict.kos.to ([92.243.29.197]:39336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKopg-0002BY-GX for qemu-devel@nongnu.org; Fri, 22 Aug 2014 09:24:44 -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 F2AC926587; Fri, 22 Aug 2014 15:24:42 +0200 (CEST) From: riku.voipio@linaro.org To: Peter Maydell , qemu-devel@nongnu.org Date: Fri, 22 Aug 2014 16:24:30 +0300 Message-Id: <37ed09560c51465c3b8a659b9d18d43e75726c04.1408712881.git.riku.voipio@linaro.org> 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 v3 12/22] 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.172 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 39ab4c7..fa8ba8f 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; }