Re: [PATCH v2] linux-user/syscall: fix target_msqid_ds time fields order
Michael Tokarev <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu.stable,gmane.comp.emulators.qemu |
|---|---|
| Message-ID | <[email protected]> |
On 3/30/24 01:36, Max Filippov wrote: > 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: [email protected] > Signed-off-by: Max Filippov <[email protected]> Just come across this old patch, is it not needed anymore or has it been lost? (I realize the current code uses target_time64_t instead of abi_ulong, so probably not needed now) Thanks, /mjt > 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;