From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Laurent Vivier" <laurent@vivier.eu>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Max Filippov" <jcmvbkbc@gmail.com>,
qemu-stable@nongnu.org
Subject: [PATCH v2] linux-user/syscall: fix target_msqid_ds time fields order
Date: Fri, 29 Mar 2024 15:36:53 -0700 [thread overview]
Message-ID: <20240329223653.155786-1-jcmvbkbc@gmail.com> (raw)
target_msqid_ds::msg_*time field pairs are reversed on 32-bit TARGET_PPC
and TARGET_SPARC and on big-endian TARGET_MIPS and TARGET_XTENSA.
Fix the order to match the kernel definitions.
The issue is spotted by the libc-test http://nsz.repo.hu/git/?p=libc-test
on big-endian xtensa core.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
Changes v1->v2:
- split into a separate patch
- add PPC, SPARC and big-endian MIPS
linux-user/syscall.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d9bfd31c1cad..781ed14bc613 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -4113,17 +4113,27 @@ static inline abi_long do_semtimedop(int semid,
struct target_msqid_ds
{
struct target_ipc_perm msg_perm;
- abi_ulong msg_stime;
#if TARGET_ABI_BITS == 32
+#if defined(TARGET_PPC) || defined(TARGET_SPARC) || \
+ (TARGET_BIG_ENDIAN && (defined(TARGET_MIPS) || defined(TARGET_XTENSA)))
+ abi_ulong __unused1;
+ abi_ulong msg_stime;
+ abi_ulong __unused2;
+ abi_ulong msg_rtime;
+ abi_ulong __unused3;
+ abi_ulong msg_ctime;
+#else
+ abi_ulong msg_stime;
abi_ulong __unused1;
-#endif
abi_ulong msg_rtime;
-#if TARGET_ABI_BITS == 32
abi_ulong __unused2;
-#endif
abi_ulong msg_ctime;
-#if TARGET_ABI_BITS == 32
abi_ulong __unused3;
+#endif
+#else
+ abi_ulong msg_stime;
+ abi_ulong msg_rtime;
+ abi_ulong msg_ctime;
#endif
abi_ulong __msg_cbytes;
abi_ulong msg_qnum;
--
2.39.2
reply other threads:[~2024-03-29 22:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20240329223653.155786-1-jcmvbkbc@gmail.com \
--to=jcmvbkbc@gmail.com \
--cc=laurent@vivier.eu \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/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).