From nobody Mon May 6 20:36:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1505458842204435.2677952351621; Fri, 15 Sep 2017 00:00:42 -0700 (PDT) Received: from localhost ([::1]:51662 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dskcD-0007Sp-5I for importer@patchew.org; Fri, 15 Sep 2017 03:00:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dskap-0005FK-59 for qemu-devel@nongnu.org; Fri, 15 Sep 2017 02:59:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dskal-00067S-AT for qemu-devel@nongnu.org; Fri, 15 Sep 2017 02:59:15 -0400 Received: from mail-wr0-x22e.google.com ([2a00:1450:400c:c0c::22e]:56889) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dskal-000676-3i for qemu-devel@nongnu.org; Fri, 15 Sep 2017 02:59:11 -0400 Received: by mail-wr0-x22e.google.com with SMTP id r74so997157wrb.13 for ; Thu, 14 Sep 2017 23:59:09 -0700 (PDT) Received: from Jamess-MacBook.local (global-184-8.nat-1.net.cam.ac.uk. [131.111.184.8]) by smtp.gmail.com with ESMTPSA id y48sm358891wrb.68.2017.09.14.23.59.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Sep 2017 23:59:07 -0700 (PDT) Received: by Jamess-MacBook.local (Postfix, from userid 501) id 37210254E221; Fri, 15 Sep 2017 07:59:06 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jrtc27.com; s=google; h=from:to:cc:subject:date:message-id; bh=W2/8HbYKEfPdKBqnsVdVFEBwDtDuoAmhS3s5nD2jxD0=; b=FqtR832tpSkhKN/U+W7o28fVUzfa7I4xEPipr6zx892YGSvM2TpRmTX30P2dJgkHQP yFoKNb1Fpc6TrE5d0gIO4cv6OSSxxX/w/5vwakGyr+UKRnCNbGEwmeVLlWo97wgRh3Mk U/x9vd0MmyLd+scLPazGWNPmIXAQeRP6Lz1mg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=W2/8HbYKEfPdKBqnsVdVFEBwDtDuoAmhS3s5nD2jxD0=; b=Zw3wcb6eqSDNwTsGI0d8utyUGevJS+0y48MJvd307LSFeEFprgz1tQNn/tCQHjV+GJ x3GxHM67yVeolYmOijX3Z3ceMDeuUhDgG2ZfLso/qRHZioAdRIvhLO8W+pMXjvMH2tvs 5+VR/947+udledD3Av0yFIjiQNyU3uXOiiBI1nb7or3u3pRXScGeCk6TQcjfYTqP4z6t 6g0i5XQoFomJ78DzLrMNuGbdfL0xwl5ITyzIYTulZmuIKW+qew478SKE0/whjSZYOPys VdKQQecbdwN85lXbDmuHxQjjZ1x+XLq/hxKLPUdiRFUTn5cmOIdpn4w1Wh1j2Uu7mv39 M5Jw== X-Gm-Message-State: AHPjjUiNfUmXhcuunE1B/OVRMR3xY9TiT6R3p0f83OBxcxQ0rwnSTrKy rCeU/CVytibEARlU X-Google-Smtp-Source: ADKCNb7eN1ns+kFtSYr4qzZ52ISQUm4zoqR27bGLxU3AXaVIrjqd0ZHdNz3fAmzWWR2gI9FCbCX+QA== X-Received: by 10.223.171.93 with SMTP id r29mr20330342wrc.217.1505458748609; Thu, 14 Sep 2017 23:59:08 -0700 (PDT) From: James Clarke To: QEMU Developers Date: Fri, 15 Sep 2017 07:58:21 +0100 Message-Id: <20170915065821.16600-1-jrtc27@jrtc27.com> X-Mailer: git-send-email 2.14.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::22e Subject: [Qemu-devel] [PATCH] linux-user/syscall.c: Handle SH4's exceptional alignment for p{read, write}64 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 , James Clarke , Laurent Vivier , John Paul Adrian Glaubitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Fixes: https://bugs.launchpad.net/qemu/+bug/1716767 Signed-off-by: James Clarke Reviewed-by: Laurent Vivier Tested-By: John Paul Adrian Glaubitz --- linux-user/syscall.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 9b6364a266..24d6a81c21 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -10495,20 +10495,32 @@ abi_long do_syscall(void *cpu_env, int num, abi_l= ong arg1, #endif #ifdef TARGET_NR_pread64 case TARGET_NR_pread64: +#if defined(TARGET_SH4) + /* SH4 doesn't align register pairs, except for p{read,write}64 */ + arg4 =3D arg5; + arg5 =3D arg6; +#else if (regpairs_aligned(cpu_env)) { arg4 =3D arg5; arg5 =3D arg6; } +#endif if (!(p =3D lock_user(VERIFY_WRITE, arg2, arg3, 0))) goto efault; ret =3D get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg= 5))); unlock_user(p, arg2, ret); break; case TARGET_NR_pwrite64: +#if defined(TARGET_SH4) + /* SH4 doesn't align register pairs, except for p{read,write}64 */ + arg4 =3D arg5; + arg5 =3D arg6; +#else if (regpairs_aligned(cpu_env)) { arg4 =3D arg5; arg5 =3D arg6; } +#endif if (!(p =3D lock_user(VERIFY_READ, arg2, arg3, 1))) goto efault; ret =3D get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, ar= g5))); -- 2.13.2