From: Andreas Arnez Date: Wed, 5 Jan 2022 18:49:19 +0000 (+0100) Subject: Bug 444552 - s390x: Fix sys_ipc semtimedop syscall X-Git-Tag: VALGRIND_3_19_0~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03a8b24ae362f13c7f97746f72f40240aeb5aade;p=thirdparty%2Fvalgrind.git Bug 444552 - s390x: Fix sys_ipc semtimedop syscall On s390x Linux platforms the sys_ipc semtimedop call has four instead of five parameters, where the timeout is passed in the third instead of the fifth. Reflect this difference in the handling of VKI_SEMTIMEDOP. --- diff --git a/NEWS b/NEWS index 3151e560ed..e4f2b71411 100644 --- a/NEWS +++ b/NEWS @@ -46,6 +46,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. == 434283 444481 gdb_server test failures on s390x 444495 dhat/tests/copy fails on s390x +444552 memcheck/tests/sem fails on s390x with glibc 2.34 444571 PPC, fix the lxsibzx and lxsihzx so they only load their respective sized data. 444836 PPC, pstq instruction for R=1 is not storing to the correct address. diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 792589766b..b9d531de38 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -4774,10 +4774,20 @@ PRE(sys_ipc) break; } case VKI_SEMTIMEDOP: +#ifdef VGP_s390x_linux + /* On s390x Linux platforms the sys_ipc semtimedop call has four instead + of five parameters, where the timeout is passed in the third instead of + the fifth. */ + PRE_REG_READ5(int, "ipc", + vki_uint, call, int, first, int, second, long, third, + void *, ptr); + ML_(generic_PRE_sys_semtimedop)( tid, ARG2, ARG5, ARG3, ARG4 ); +#else PRE_REG_READ6(int, "ipc", vki_uint, call, int, first, int, second, int, third, void *, ptr, long, fifth); ML_(generic_PRE_sys_semtimedop)( tid, ARG2, ARG5, ARG3, ARG6 ); +#endif *flags |= SfMayBlock; break; case VKI_MSGSND: