Received: from eggs.gnu.org ([208.118.235.92]:37794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIehg-00083P-HM for qemu-devel@nongnu.org; Mon, 01 Oct 2012 08:02:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIehd-0007BQ-US for qemu-devel@nongnu.org; Mon, 01 Oct 2012 08:02:28 -0400 From: Alexander Graf Date: Sun, 30 Sep 2012 03:32:39 +0200 Message-Id: <1348968759-10913-2-git-send-email-agraf@suse.de> In-Reply-To: <1348968759-10913-1-git-send-email-agraf@suse.de> References: <1348968759-10913-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 2/2] linux-user: register align p{read, write}64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel qemu-devel Cc: Peter Maydell , Riku Voipio , "qemu-ppc@nongnu.org List" pread64 and pwrite64 pass 64bit parameters which for some architectures need to be aligned to special argument pairs, creating a gap argument. Handle this special case the same way we handle it in other places of the code. Reported-by: Alex Barcelo Signed-off-by: Alexander Graf --- linux-user/syscall.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 8cd56f2..7992b1b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -7423,12 +7423,20 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, #endif #ifdef TARGET_NR_pread64 case TARGET_NR_pread64: + if (regpairs_aligned(cpu_env)) { + arg4 = arg5; + arg5 = arg6; + } if (!(p = lock_user(VERIFY_WRITE, arg2, arg3, 0))) goto efault; ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5))); unlock_user(p, arg2, ret); break; case TARGET_NR_pwrite64: + if (regpairs_aligned(cpu_env)) { + arg4 = arg5; + arg5 = arg6; + } if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1))) goto efault; ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5))); -- 1.6.0.2