From: Alexander Graf <agraf@suse.de>
To: qemu-devel qemu-devel <qemu-devel@nongnu.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Riku Voipio <riku.voipio@iki.fi>,
"qemu-ppc@nongnu.org List" <qemu-ppc@nongnu.org>
Subject: [Qemu-devel] [PATCH 2/2] linux-user: register align p{read, write}64
Date: Sun, 30 Sep 2012 03:32:39 +0200 [thread overview]
Message-ID: <1348968759-10913-2-git-send-email-agraf@suse.de> (raw)
In-Reply-To: <1348968759-10913-1-git-send-email-agraf@suse.de>
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 <abarcelo@ac.upc.edu>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
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
next prev parent reply other threads:[~2012-10-01 12:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-30 1:32 [Qemu-devel] [PATCH 1/2] linux-user: ppc: mark as long long aligned Alexander Graf
2012-09-30 1:32 ` Alexander Graf [this message]
2012-10-01 17:31 ` [Qemu-devel] [PATCH 2/2] linux-user: register align p{read, write}64 Alex Barcelo
2012-10-12 11:42 ` Peter Maydell
2012-10-01 13:04 ` [Qemu-devel] [PATCH 1/2] linux-user: ppc: mark as long long aligned Andreas Färber
2012-10-01 13:10 ` Alexander Graf
2012-10-01 17:27 ` malc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348968759-10913-2-git-send-email-agraf@suse.de \
--to=agraf@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).