qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user/syscall.c: Handle SH4's exceptional alignment for p{read, write}64
@ 2017-09-15  6:58 James Clarke
  2017-09-15  7:27 ` Laurent Vivier
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: James Clarke @ 2017-09-15  6:58 UTC (permalink / raw)
  To: QEMU Developers
  Cc: James Clarke, John Paul Adrian Glaubitz, Laurent Vivier,
	Peter Maydell

Fixes: https://bugs.launchpad.net/qemu/+bug/1716767
Signed-off-by: James Clarke <jrtc27@jrtc27.com>
---
 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_long 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 = arg5;
+        arg5 = arg6;
+#else
         if (regpairs_aligned(cpu_env)) {
             arg4 = arg5;
             arg5 = arg6;
         }
+#endif
         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 defined(TARGET_SH4)
+        /* SH4 doesn't align register pairs, except for p{read,write}64 */
+        arg4 = arg5;
+        arg5 = arg6;
+#else
         if (regpairs_aligned(cpu_env)) {
             arg4 = arg5;
             arg5 = arg6;
         }
+#endif
         if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1)))
             goto efault;
         ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5)));
--
2.13.2

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-11-06 20:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-15  6:58 [Qemu-devel] [PATCH] linux-user/syscall.c: Handle SH4's exceptional alignment for p{read, write}64 James Clarke
2017-09-15  7:27 ` Laurent Vivier
2017-09-15 15:07 ` John Paul Adrian Glaubitz
2017-09-15 15:41 ` Philippe Mathieu-Daudé
2017-09-15 15:43   ` John Paul Adrian Glaubitz
2017-09-15 17:13   ` Richard Henderson
2017-09-15 18:39   ` Laurent Vivier
2017-09-15 19:07   ` [Qemu-devel] [PATCH v2] " James Clarke
2017-09-15 19:24     ` no-reply
2017-09-15 19:33     ` [Qemu-devel] [PATCH v3] " James Clarke
2017-09-15 19:51       ` Eric Blake
2017-09-15 20:11       ` Laurent Vivier
2017-09-15 20:12       ` Richard Henderson
2017-09-15 20:41       ` John Paul Adrian Glaubitz
2017-09-15 20:45       ` John Paul Adrian Glaubitz
2017-09-15 21:10       ` Philippe Mathieu-Daudé
2017-10-04  8:38       ` John Paul Adrian Glaubitz
2017-11-04  7:30         ` [Qemu-devel] PING: " John Paul Adrian Glaubitz
2017-11-06 19:57         ` [Qemu-devel] " Riku Voipio
2017-11-06 20:00           ` James Clarke

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).