From patchwork Wed Jun 8 13:30:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 69655 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2516072qgf; Wed, 8 Jun 2016 07:08:28 -0700 (PDT) X-Received: by 10.237.54.166 with SMTP id f35mr4893640qtb.78.1465394908477; Wed, 08 Jun 2016 07:08:28 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d3si764275qhd.33.2016.06.08.07.08.28 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Jun 2016 07:08:28 -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; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAe9k-00055q-10 for patch@linaro.org; Wed, 08 Jun 2016 10:08:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZV-0004OG-D3 for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAdZT-0005oA-Cx for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:31:00 -0400 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:36271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZS-0005nu-IO for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:30:59 -0400 Received: by mail-lf0-x229.google.com with SMTP id j5so5840539lfb.3 for ; Wed, 08 Jun 2016 06:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GaISs98mfVIjdLclH/huv88G9IzCe8d+JrdmOtCBatg=; b=eFeLKCu+2rjwplt0E7lpeQ56pAze+pBu9G28ANTj3mAQnODGq7wrTj+ee9TDMZctLE vDVHKnMIgqo0+Yz7tRthzMOh7wITKQQCOh+7qOKHfO9zLgUZyIkZhAl3fnvnuIAsavrs m979Fl+afzR5zRTgNldD68hevk+B+j71x5PF4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GaISs98mfVIjdLclH/huv88G9IzCe8d+JrdmOtCBatg=; b=EPS5YtYX840l/FSco94Fe//YC4/UNcv19w+i1D+S3AF0yiODdNIenID0hg+myGhpFo AHqtONNKENOTIpzDzCjih5zWW67WGde2SE9zWMUUP/rgyjlrWNWC5S3KylXcyD1RnBZp Do+WUYYdBP37YHx9CkL/HQQ04IOis/WsMH8fvM2LixT1rvrpvXKko2if7bsZAsRiCtvl o0KmXZSNJG5NDhlzfpRUI6VOeIfXJRS4rMyOxOq/l2oVobE/RHQ9QWJ64Kq9Lb9i+D+U dNzdEk0lzlFAuEiuj9XeYe4ep2sxMHcBfteIwFtZVYgaKU914wN4E0c0UbY5s1ldA6En npxA== X-Gm-Message-State: ALyK8tLmyE5oubyqV5hr6EdELkQ9aHHQ3Tc3sxumnZ9CG/pgxW2ihBsKCdm4rm0j4zDSpq2B X-Received: by 10.46.1.42 with SMTP id 42mr1390234ljb.27.1465392657816; Wed, 08 Jun 2016 06:30:57 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id 2sm139854lja.37.2016.06.08.06.30.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 06:30:56 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 8 Jun 2016 16:30:06 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::229 Subject: [Qemu-devel] [PULL 25/44] linux-user: Fix handling of arm_fadvise64_64 syscall X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell 32-bit ARM has an odd variant of the fadvise syscall which has rearranged arguments, which we try to implement. Unfortunately we got the rearrangement wrong. This is a six-argument syscall whose arguments are: * fd * advise parameter * offset high half * offset low half * len high half * len low half Stop trying to share code with the standard fadvise syscalls, and just implement the syscall with the correct argument order. Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/syscall.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.1.4 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index a2d591e..8c08e7c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9970,18 +9970,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_arm_fadvise64_64 case TARGET_NR_arm_fadvise64_64: - { - /* - * arm_fadvise64_64 looks like fadvise64_64 but - * with different argument order - */ - abi_long temp; - temp = arg3; - arg3 = arg4; - arg4 = temp; - } + /* arm_fadvise64_64 looks like fadvise64_64 but + * with different argument order: fd, advice, offset, len + * rather than the usual fd, offset, len, advice. + * Note that offset and len are both 64-bit so appear as + * pairs of 32-bit registers. + */ + ret = posix_fadvise(arg1, target_offset64(arg3, arg4), + target_offset64(arg5, arg6), arg2); + ret = -host_to_target_errno(ret); + break; #endif -#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_arm_fadvise64_64) || defined(TARGET_NR_fadvise64) +#if defined(TARGET_NR_fadvise64_64) || defined(TARGET_NR_fadvise64) #ifdef TARGET_NR_fadvise64_64 case TARGET_NR_fadvise64_64: #endif