From patchwork Fri Aug 15 11:01:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 35445 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2329D203C5 for ; Fri, 15 Aug 2014 11:11:09 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f73sf7174434yha.3 for ; Fri, 15 Aug 2014 04:11:08 -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=WOKPRs3gNzV8aQjPMtQ8HwcZOFTKJcTvgitxNf4LouwcU8a5XgS6y5FERUNRlOyF6v hktEagZxyk3t0HtwM1194nJ7athVuggVpHndUAfX2SWt+LL4BO73FoYmlkV0Cgs4WXpw YrwN0sg0UorjSqfrNRiK8tr6z/LM4o36JzMW3FU1iLVMZmsEttoIfCNK1XVPWK9768xM tleU5nlbAZzn5SRK6fHQYONCir784Wx2NJE1A2RixO+f3nmlAs4Q+EquXJFdqBZJ3d9T r7hCJCL3U/9posSFUYNIHE5ZsQF7qyeFMJOakpXpSUScdylb6juE3g7O0wS+goiVZULm WIrg== X-Gm-Message-State: ALoCoQmK2d3qrqExWJATCOMBrL6sxzGyBYR2reqn3hm/lokyJ2RMaDYZhKPVP3gqHcaHa1Yjrc32 X-Received: by 10.236.159.198 with SMTP id s46mr5601532yhk.17.1408101068956; Fri, 15 Aug 2014 04:11:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.214 with SMTP id r80ls1380048qgd.44.gmail; Fri, 15 Aug 2014 04:11:08 -0700 (PDT) X-Received: by 10.224.16.138 with SMTP id o10mr1155334qaa.12.1408101068858; Fri, 15 Aug 2014 04:11:08 -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 r1si11347390qak.82.2014.08.15.04.11.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Aug 2014 04:11:08 -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 lf12so2715510vcb.26 for ; Fri, 15 Aug 2014 04:11:08 -0700 (PDT) X-Received: by 10.52.61.99 with SMTP id o3mr6157792vdr.46.1408101068583; Fri, 15 Aug 2014 04:11:08 -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 tc5csp104502vcb; Fri, 15 Aug 2014 04:11:08 -0700 (PDT) X-Received: by 10.224.26.12 with SMTP id b12mr25992945qac.92.1408101067887; Fri, 15 Aug 2014 04:11:07 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id b3si11353969qcq.24.2014.08.15.04.11.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 15 Aug 2014 04:11:07 -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]:58624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIFPX-0003T1-EB for patch@linaro.org; Fri, 15 Aug 2014 07:11:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIFGc-0004xA-L5 for qemu-devel@nongnu.org; Fri, 15 Aug 2014 07:02:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIFGU-00072R-Rd for qemu-devel@nongnu.org; Fri, 15 Aug 2014 07:01:54 -0400 Received: from afflict.kos.to ([92.243.29.197]:57591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIFGU-00071L-Lv for qemu-devel@nongnu.org; Fri, 15 Aug 2014 07:01:46 -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 0838026645; Fri, 15 Aug 2014 13:01:45 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Fri, 15 Aug 2014 14:01:32 +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: Peter Maydell , Tom Musta Subject: [Qemu-devel] [PULL 14/24] 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; }