You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
(1) |
3
|
|
4
|
5
(1) |
6
(2) |
7
(1) |
8
(1) |
9
(2) |
10
|
|
11
|
12
|
13
(6) |
14
(4) |
15
(1) |
16
(4) |
17
(2) |
|
18
(1) |
19
(8) |
20
(8) |
21
(2) |
22
(3) |
23
(3) |
24
|
|
25
|
26
|
27
(1) |
28
|
29
|
30
|
31
(2) |
|
From: Petar J. <pe...@so...> - 2019-08-19 14:39:19
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4fbfffd8c8ece988b24cd2d349421f49d445c60b commit 4fbfffd8c8ece988b24cd2d349421f49d445c60b Author: Petar Jovanovic <mip...@gm...> Date: Mon Aug 19 14:38:34 2019 +0000 update NEWS with fix for #400593 The KDE issue #400593 has been fixed in commit c6a6cf929f3e2a9bf5d7f09f334ed4d67f2d6e18 Use statx rather than other stat system calls Diff: --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index 6d55d76..e4fdd94 100644 --- a/NEWS +++ b/NEWS @@ -47,6 +47,7 @@ To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX where XXXXXX is the bug number as listed below. +400593 In Coregrind, use statx for some internal syscalls if [f]stat[64] fail 406561 mcinfcallWSRU gdbserver_test fails on ppc64 406824 Unsupported baseline 407218 Add support for the copy_file_range syscall |
|
From: Julian S. <se...@so...> - 2019-08-19 14:05:38
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e7dde4bc20bf57b4c1e25801f8462d1519c4fa41 commit e7dde4bc20bf57b4c1e25801f8462d1519c4fa41 Author: Julian Seward <js...@ac...> Date: Mon Aug 19 16:03:01 2019 +0200 Bug 400538 - vex amd64->IR: unhandled instruction bytes: 0x48 0xCF (IRETQ). Patch from Daniel Lehman <dle...@gm...>. Diff: --- VEX/priv/guest_amd64_toIR.c | 81 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index 96dee38..4bba03c 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -21050,6 +21050,87 @@ Long dis_ESC_NONE ( } goto decode_failure; + case 0xCF: /* IRET */ + /* Note, this is an extremely kludgey and limited implementation of iret + based on the extremely kludgey and limited implementation of iret for x86 + popq %RIP; popl %CS; popq %RFLAGS; popq %RSP; popl %SS + %CS and %SS are ignored */ + if (sz != 8 || have66orF2orF3(pfx)) goto decode_failure; + + t1 = newTemp(Ity_I64); /* RSP */ + t2 = newTemp(Ity_I64); /* new RIP */ + /* t3 = newTemp(Ity_I32); new CS */ + t4 = newTemp(Ity_I64); /* new RFLAGS */ + t5 = newTemp(Ity_I64); /* new RSP */ + /* t6 = newTemp(Ity_I32); new SS */ + + assign(t1, getIReg64(R_RSP)); + assign(t2, loadLE(Ity_I64, binop(Iop_Add64,mkexpr(t1),mkU64(0)))); + /* assign(t3, loadLE(Ity_I32, binop(Iop_Add64,mkexpr(t1),mkU64(8)))); */ + assign(t4, loadLE(Ity_I64, binop(Iop_Add64,mkexpr(t1),mkU64(16)))); + assign(t5, loadLE(Ity_I64, binop(Iop_Add64,mkexpr(t1),mkU64(24)))); + /* assign(t6, loadLE(Ity_I32, binop(Iop_Add64,mkexpr(t1),mkU64(32)))); */ + + /* set %RFLAGS */ + stmt( IRStmt_Put( OFFB_CC_OP, mkU64(AMD64G_CC_OP_COPY) )); + stmt( IRStmt_Put( OFFB_CC_NDEP, mkU64(0) )); + stmt( IRStmt_Put( OFFB_CC_DEP2, mkU64(0) )); + stmt( IRStmt_Put( OFFB_CC_DEP1, + binop(Iop_And64, + mkexpr(t4), + mkU64( AMD64G_CC_MASK_C | AMD64G_CC_MASK_P + | AMD64G_CC_MASK_A | AMD64G_CC_MASK_Z + | AMD64G_CC_MASK_S| AMD64G_CC_MASK_O ) + ) + ) + ); + + /* Also need to set the D flag, which is held in bit 10 of t4. + If zero, put 1 in OFFB_DFLAG, else -1 in OFFB_DFLAG. */ + stmt( IRStmt_Put( + OFFB_DFLAG, + IRExpr_ITE( + unop(Iop_64to1, + binop(Iop_And64, + binop(Iop_Shr64, mkexpr(t4), mkU8(10)), + mkU64(1))), + mkU64(0xFFFFFFFFFFFFFFFFULL), + mkU64(1))) + ); + + /* And set the ID flag */ + stmt( IRStmt_Put( + OFFB_IDFLAG, + IRExpr_ITE( + unop(Iop_64to1, + binop(Iop_And64, + binop(Iop_Shr64, mkexpr(t4), mkU8(21)), + mkU64(1))), + mkU64(1), + mkU64(0))) + ); + + /* And set the AC flag too */ + stmt( IRStmt_Put( + OFFB_ACFLAG, + IRExpr_ITE( + unop(Iop_64to1, + binop(Iop_And64, + binop(Iop_Shr64, mkexpr(t4), mkU8(18)), + mkU64(1))), + mkU64(1), + mkU64(0))) + ); + + + /* set new stack */ + putIReg64(R_RSP, mkexpr(t5)); + + /* goto new RIP value */ + jmp_treg(dres, Ijk_Ret, t2); + DIP("iret (very kludgey)\n"); + return delta; + case 0xD0: { /* Grp2 1,Eb */ Bool decode_OK = True; if (haveF2orF3(pfx)) goto decode_failure; |
|
From: Philippe W. <phi...@so...> - 2019-08-18 22:27:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5aeb970dc247c7573aca7f62bcca54328d9e6464 commit 5aeb970dc247c7573aca7f62bcca54328d9e6464 Author: Philippe Waroquiers <phi...@sk...> Date: Mon Aug 19 00:26:18 2019 +0200 Fix README_DEVELOPERS tool executable in debugging instruction examples. Diff: --- README_DEVELOPERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README_DEVELOPERS b/README_DEVELOPERS index 3a36fc4..97f2329 100644 --- a/README_DEVELOPERS +++ b/README_DEVELOPERS @@ -99,11 +99,11 @@ without too much problem by following these steps: (2) Run gdb on the tool executable. Eg: - gdb /usr/local/lib/valgrind/ppc32-linux/lackey + gdb /usr/local/lib/valgrind/lackey-ppc32-linux or - gdb $DIR/.in_place/x86-linux/memcheck + gdb $DIR/.in_place/memcheck-x86-linux (3) Do "handle SIGSEGV SIGILL nostop noprint" in GDB to prevent GDB from stopping on a SIGSEGV or SIGILL: |
|
From: Philippe W. <phi...@so...> - 2019-08-17 16:28:33
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4b39d3343762c53419cf16118c74e0004f900e32 commit 4b39d3343762c53419cf16118c74e0004f900e32 Author: Philippe Waroquiers <phi...@sk...> Date: Sat Aug 17 18:27:22 2019 +0200 Fix compilation problem when __NR_preadv2 __NR_pwritev2 are undefined check_preadv2_pwritev2.c: In function âmainâ: check_preadv2_pwritev2.c:12:12: error: â__NR_preadv2â undeclared (first use in this function) syscall(__NR_preadv2, 0, NULL, 0, 0, 0); ^ check_preadv2_pwritev2.c:12:12: note: each undeclared identifier is reported only once for each function it appears in check_preadv2_pwritev2.c:15:12: error: â__NR_pwritev2â undeclared (first use in this function) syscall(__NR_pwritev2, 0, NULL, 0, 0, 0); Diff: --- memcheck/tests/linux/check_preadv2_pwritev2.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/memcheck/tests/linux/check_preadv2_pwritev2.c b/memcheck/tests/linux/check_preadv2_pwritev2.c index 5333679..a91caa6 100644 --- a/memcheck/tests/linux/check_preadv2_pwritev2.c +++ b/memcheck/tests/linux/check_preadv2_pwritev2.c @@ -5,15 +5,23 @@ int main(int argc, char **argv) { - errno = 0; int has_preadv2 = 0; int has_pwritev2 = 0; - +#if defined(__NR_preadv2) + errno = 0; syscall(__NR_preadv2, 0, NULL, 0, 0, 0); has_preadv2 = errno != ENOSYS; +#else + has_preadv2 = 0; +#endif +#if defined(__NR_pwritev2) + errno = 0; syscall(__NR_pwritev2, 0, NULL, 0, 0, 0); has_pwritev2 = errno != ENOSYS; +#else + has_pwritev2 = 0; +#endif return !(has_preadv2 && has_pwritev2); } |
|
From: Bart V. A. <bva...@so...> - 2019-08-17 01:11:12
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0f7483d1d8a8ade23123b498dfbd61d1c41d9f45 commit 0f7483d1d8a8ade23123b498dfbd61d1c41d9f45 Author: Stefan Maksimovic <ste...@rt...> Date: Fri Aug 16 16:23:21 2019 -0700 memcheck/tests/sys-preadv2_pwritev2: Check whether these syscalls are supported [ bvanassche: changed the order of check_PROGRAMS ] Diff: --- .gitignore | 1 + memcheck/tests/linux/Makefile.am | 1 + memcheck/tests/linux/check_preadv2_pwritev2.c | 19 +++++++++++++++++++ memcheck/tests/linux/sys-preadv2_pwritev2.vgtest | 1 + 4 files changed, 22 insertions(+) diff --git a/.gitignore b/.gitignore index 9ba42ee..7c3d304 100644 --- a/.gitignore +++ b/.gitignore @@ -1093,6 +1093,7 @@ /memcheck/tests/linux/.deps /memcheck/tests/linux/brk /memcheck/tests/linux/capget +/memcheck/tests/linux/check_preadv2_pwritev2 /memcheck/tests/linux/dlclose_leak /memcheck/tests/linux/dlclose_leak_so.so /memcheck/tests/linux/getregset diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am index e133258..14d4a07 100644 --- a/memcheck/tests/linux/Makefile.am +++ b/memcheck/tests/linux/Makefile.am @@ -33,6 +33,7 @@ EXTRA_DIST = \ check_PROGRAMS = \ brk \ capget \ + check_preadv2_pwritev2 \ dlclose_leak dlclose_leak_so.so \ ioctl-tiocsig \ getregset \ diff --git a/memcheck/tests/linux/check_preadv2_pwritev2.c b/memcheck/tests/linux/check_preadv2_pwritev2.c new file mode 100644 index 0000000..5333679 --- /dev/null +++ b/memcheck/tests/linux/check_preadv2_pwritev2.c @@ -0,0 +1,19 @@ +#include <sys/syscall.h> +#include <errno.h> +#include <unistd.h> +#include <stddef.h> + +int main(int argc, char **argv) +{ + errno = 0; + int has_preadv2 = 0; + int has_pwritev2 = 0; + + syscall(__NR_preadv2, 0, NULL, 0, 0, 0); + has_preadv2 = errno != ENOSYS; + + syscall(__NR_pwritev2, 0, NULL, 0, 0, 0); + has_pwritev2 = errno != ENOSYS; + + return !(has_preadv2 && has_pwritev2); +} diff --git a/memcheck/tests/linux/sys-preadv2_pwritev2.vgtest b/memcheck/tests/linux/sys-preadv2_pwritev2.vgtest index 5cd23aa..33e3252 100644 --- a/memcheck/tests/linux/sys-preadv2_pwritev2.vgtest +++ b/memcheck/tests/linux/sys-preadv2_pwritev2.vgtest @@ -1,3 +1,4 @@ prereq: test -e sys-preadv2_pwritev2 +prereq: ./check_preadv2_pwritev2 prog: sys-preadv2_pwritev2 vgopts: -q |
|
From: John R. <jr...@bi...> - 2019-08-16 23:17:25
|
>> Is Valgrind now able to load programs with really large BSS and data segments (4 GB)? >> I have asked this before: https://www.mail-archive.com/search?l=val...@li...&q=subject:%22Re%5C%3A+%5C%5BValgrind%5C-users%5C%5D+failed+in+UME+with+error+22%22&o=newest > Is this possible now, or can this be an improvement? > > Can anyone clarify? It is likely that there will be no progress until: 1) Create a bug report. Start at http://valgrind.org/ and follow the "Bug Reports" link in the left column. Publish here (on the mailing list) a link to the bug report. 2) Attach to the bug report the source code of a short stand-alone program in C language which triggers the complaint. Give the build recipe to create the executable file, and the invocation command line for valgrind. If there is no bug report, then the issue likely will be forgotten. The mailing list is not a substitute for the bug report. If there is no reproducible test case, then likely no one will work on it. |
|
From: João M. S. S. <joa...@gm...> - 2019-08-16 21:51:48
|
On 8/5/19 9:47 PM, João M. S. Silva wrote: > Hi, > > Is Valgrind now able to load programs with really large BSS and data > segments (4 GB)? > > I have asked this before: > https://www.mail-archive.com/search?l=val...@li...&q=subject:%22Re%5C%3A+%5C%5BValgrind%5C-users%5C%5D+failed+in+UME+with+error+22%22&o=newest > > > But now I was wondering if anything changed that allows me to run > Valgrind on this program. Changing the configuration and building > Valgrind (as suggested in the archive thread) does not work for such > large segments (only for ~1,5 GB, the program has grown to 4 GB). > > Thanks. > Is this possible now, or can this be an improvement? Can anyone clarify? Thanks. João M. S. Silva |
|
From: Andreas A. <ar...@so...> - 2019-08-16 18:14:16
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7cca96dba291cf8b9bef80f472665f15ab00ec61 commit 7cca96dba291cf8b9bef80f472665f15ab00ec61 Author: Andreas Arnez <ar...@li...> Date: Fri Aug 16 20:06:53 2019 +0200 Update s390x maintainership in AUTHORS I have taken over maintainership of the s390x support some time ago. Update the AUTHORS file to reflect that. Diff: --- AUTHORS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4c03a66..84c47b4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -57,9 +57,9 @@ use in Valgrind. David Woodhouse has helped out with test and build machines over the course of many releases. -Florian Krohm and Christian Borntraeger wrote and maintain the -S390X/Linux port. Florian improved and ruggedised the regression test -system during 2011. +Florian Krohm and Christian Borntraeger wrote the initial S390X/Linux +port. Andreas Arnez is the current maintainer and developer of it. +Florian improved and ruggedised the regression test system during 2011. Philippe Waroquiers wrote and maintains the embedded GDB server. He also made a bunch of performance and memory-reduction fixes across |
|
From: Petar J. <pe...@so...> - 2019-08-16 16:00:13
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c6a6cf929f3e2a9bf5d7f09f334ed4d67f2d6e18 commit c6a6cf929f3e2a9bf5d7f09f334ed4d67f2d6e18 Author: Petar Jovanovic <mip...@gm...> Date: Fri Aug 16 15:57:50 2019 +0000 Use statx rather than other stat system calls *STAT* system calls other than statx are becoming deprecated. Coregrind should use statx as the first candidate in order to achieve "stat" functionality. There are also systems that do not even support older "stats". This fixes KDE #400593. Patch by Aleksandar Rikalo. Diff: --- coregrind/m_aspacemgr/aspacemgr-common.c | 19 ++++++++- coregrind/m_libcfile.c | 69 +++++++++++++++++++++++++++++--- include/pub_tool_libcbase.h | 12 ++++++ include/vki/vki-linux.h | 4 ++ 4 files changed, 96 insertions(+), 8 deletions(-) diff --git a/coregrind/m_aspacemgr/aspacemgr-common.c b/coregrind/m_aspacemgr/aspacemgr-common.c index 79f5252..789cc9b 100644 --- a/coregrind/m_aspacemgr/aspacemgr-common.c +++ b/coregrind/m_aspacemgr/aspacemgr-common.c @@ -314,9 +314,21 @@ Bool ML_(am_get_fd_d_i_m)( Int fd, { # if defined(VGO_linux) || defined(VGO_darwin) SysRes res; - struct vki_stat buf; +# if defined(VGO_linux) + /* First try with statx. */ + struct vki_statx bufx; + const char* file_name = ""; + res = VG_(do_syscall5)(__NR_statx, fd, (RegWord)file_name, + VKI_AT_EMPTY_PATH, VKI_STATX_ALL, (RegWord)&bufx); + if (!sr_isError(res)) { + *dev = VG_MAKEDEV(bufx.stx_dev_major, bufx.stx_dev_minor); + *ino = (ULong)bufx.stx_ino; + *mode = (UInt)bufx.stx_mode; + return True; + } +# endif # if defined(VGO_linux) && defined(__NR_fstat64) - /* Try fstat64 first as it can cope with minor and major device + /* fstat64 is second candidate as it can cope with minor and major device numbers outside the 0-255 range and it works properly for x86 binaries on amd64 systems where fstat seems to be broken. */ struct vki_stat64 buf64; @@ -328,6 +340,8 @@ Bool ML_(am_get_fd_d_i_m)( Int fd, return True; } # endif +# if defined(__NR_fstat) + struct vki_stat buf; res = VG_(do_syscall2)(__NR_fstat, fd, (UWord)&buf); if (!sr_isError(res)) { *dev = (ULong)buf.st_dev; @@ -335,6 +349,7 @@ Bool ML_(am_get_fd_d_i_m)( Int fd, *mode = (UInt) buf.st_mode; return True; } +# endif return False; # elif defined(VGO_solaris) # if defined(VGP_x86_solaris) diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index c65551a..5c356ad 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -337,14 +337,51 @@ Off64T VG_(lseek) ( Int fd, Off64T offset, Int whence ) (_p_vgstat)->ctime_nsec = (ULong)( (_p_vkistat)->st_ctime_nsec ); \ } while (0) +#define TRANSLATE_statx_TO_vg_stat(_p_vgstat, _p_vkistat) \ + do { \ + (_p_vgstat)->dev = VG_MAKEDEV( (_p_vkistat)->stx_dev_major, \ + (_p_vkistat)->stx_dev_minor ); \ + (_p_vgstat)->ino = (ULong)( (_p_vkistat)->stx_ino ); \ + (_p_vgstat)->nlink = (ULong)( (_p_vkistat)->stx_nlink ); \ + (_p_vgstat)->mode = (UInt) ( (_p_vkistat)->stx_mode ); \ + (_p_vgstat)->uid = (UInt) ( (_p_vkistat)->stx_uid ); \ + (_p_vgstat)->gid = (UInt) ( (_p_vkistat)->stx_gid ); \ + (_p_vgstat)->rdev = VG_MAKEDEV( (_p_vkistat)->stx_rdev_major, \ + (_p_vkistat)->stx_rdev_minor ); \ + (_p_vgstat)->size = (Long) ( (_p_vkistat)->stx_size ); \ + (_p_vgstat)->blksize = (ULong)( (_p_vkistat)->stx_blksize ); \ + (_p_vgstat)->blocks = (ULong)( (_p_vkistat)->stx_blocks ); \ + (_p_vgstat)->atime = (ULong)( (_p_vkistat)->stx_atime.tv_sec ); \ + (_p_vgstat)->atime_nsec = (ULong)( (_p_vkistat)->stx_atime.tv_nsec ); \ + (_p_vgstat)->mtime = (ULong)( (_p_vkistat)->stx_mtime.tv_sec ); \ + (_p_vgstat)->mtime_nsec = (ULong)( (_p_vkistat)->stx_mtime.tv_nsec ); \ + (_p_vgstat)->ctime = (ULong)( (_p_vkistat)->stx_ctime.tv_sec ); \ + (_p_vgstat)->ctime_nsec = (ULong)( (_p_vkistat)->stx_ctime.tv_nsec ); \ + } while (0) + SysRes VG_(stat) ( const HChar* file_name, struct vg_stat* vgbuf ) { SysRes res; VG_(memset)(vgbuf, 0, sizeof(*vgbuf)); +# if defined(VGO_linux) + /* On Linux, first try with statx. If that doesn't work out, fall back to + the stat64 or vanilla version. */ + { struct vki_statx buf; + res = VG_(do_syscall5)(__NR_statx, VKI_AT_FDCWD, (UWord)file_name, 0, + VKI_STATX_ALL, (UWord)&buf); + if (!(sr_isError(res) && sr_Err(res) == VKI_ENOSYS)) { + /* Success, or any failure except ENOSYS */ + if (!sr_isError(res)) + TRANSLATE_statx_TO_vg_stat(vgbuf, &buf); + return res; + } + } +# endif # if defined(VGO_linux) || defined(VGO_darwin) - /* First try with stat64. If that doesn't work out, fall back to - the vanilla version. */ + /* Try with stat64. This is the second candidate on Linux, and the first + one on Darwin. If that doesn't work out, fall back to vanilla version. + */ # if defined(__NR_stat64) { struct vki_stat64 buf64; res = VG_(do_syscall2)(__NR_stat64, (UWord)file_name, (UWord)&buf64); @@ -356,6 +393,7 @@ SysRes VG_(stat) ( const HChar* file_name, struct vg_stat* vgbuf ) } } # endif /* defined(__NR_stat64) */ +# if defined(__NR_stat) /* This is the fallback ("vanilla version"). */ { struct vki_stat buf; # if defined(VGP_arm64_linux) @@ -368,6 +406,7 @@ SysRes VG_(stat) ( const HChar* file_name, struct vg_stat* vgbuf ) TRANSLATE_TO_vg_stat(vgbuf, &buf); return res; } +# endif # elif defined(VGO_solaris) { # if defined(VGP_x86_solaris) @@ -395,9 +434,25 @@ Int VG_(fstat) ( Int fd, struct vg_stat* vgbuf ) SysRes res; VG_(memset)(vgbuf, 0, sizeof(*vgbuf)); +# if defined(VGO_linux) + /* On Linux, first try with statx. If that doesn't work out, fall back to + the fstat64 or vanilla version. */ + { struct vki_statx buf; + const char* file_name = ""; + res = VG_(do_syscall5)(__NR_statx, fd, (RegWord)file_name, + VKI_AT_EMPTY_PATH, VKI_STATX_ALL, (RegWord)&buf); + if (!(sr_isError(res) && sr_Err(res) == VKI_ENOSYS)) { + /* Success, or any failure except ENOSYS */ + if (!sr_isError(res)) + TRANSLATE_statx_TO_vg_stat(vgbuf, &buf); + return sr_isError(res) ? (-1) : 0; + } + } +#endif # if defined(VGO_linux) || defined(VGO_darwin) - /* First try with fstat64. If that doesn't work out, fall back to - the vanilla version. */ + /* Try with fstat64. This is the second candidate on Linux, and the first + one on Darwin. If that doesn't work out, fall back to vanilla version. + */ # if defined(__NR_fstat64) { struct vki_stat64 buf64; res = VG_(do_syscall2)(__NR_fstat64, (UWord)fd, (UWord)&buf64); @@ -408,13 +463,15 @@ Int VG_(fstat) ( Int fd, struct vg_stat* vgbuf ) return sr_isError(res) ? (-1) : 0; } } -# endif /* if defined(__NR_fstat64) */ +# endif /* defined(__NR_fstat64) */ +# if defined(__NR_fstat) { struct vki_stat buf; res = VG_(do_syscall2)(__NR_fstat, (RegWord)fd, (RegWord)(Addr)&buf); if (!sr_isError(res)) TRANSLATE_TO_vg_stat(vgbuf, &buf); return sr_isError(res) ? (-1) : 0; } +# endif # elif defined(VGO_solaris) { # if defined(VGP_x86_solaris) @@ -436,7 +493,7 @@ Int VG_(fstat) ( Int fd, struct vg_stat* vgbuf ) } #undef TRANSLATE_TO_vg_stat - +#undef TRANSLATE_statx_TO_vg_stat Long VG_(fsize) ( Int fd ) { diff --git a/include/pub_tool_libcbase.h b/include/pub_tool_libcbase.h index 33444ac..b71066e 100644 --- a/include/pub_tool_libcbase.h +++ b/include/pub_tool_libcbase.h @@ -202,6 +202,18 @@ static void VG_(bzero_inline) ( void* s, SizeT sz ) #define VG_PGROUNDDN(p) VG_ROUNDDN(p, VKI_PAGE_SIZE) #define VG_PGROUNDUP(p) VG_ROUNDUP(p, VKI_PAGE_SIZE) +/* Converts `Device ID` given as pair of 32-bit values (dev_major, dev_minor) + * to 64-bit dev_t using MMMM Mmmm mmmM MMmm encoding. This is + * downward compatible with legacy systems where dev_t is 16 bits wide, + * encoded as MMmm. It is also downward compatible with the Linux kernel, + * which uses 32-bit dev_t, encoded as mmmM MMmm. + * Original macro can be found in bits/sysmacros.h. */ +#define VG_MAKEDEV(__major, __minor) \ + ((((ULong) (__major & 0x00000fffu)) << 8) | \ + (((ULong) (__major & 0xfffff000u)) << 32) | \ + (((ULong) (__minor & 0x000000ffu)) << 0) | \ + (((ULong) (__minor & 0xffffff00u)) << 12)) + /* --------------------------------------------------------------------- Misc useful functions ------------------------------------------------------------------ */ diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index 76bc783..6024f21 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -1385,6 +1385,8 @@ struct vki_robust_list_head { #define VKI_S_IWOTH 00002 #define VKI_S_IXOTH 00001 +#define VKI_STATX_ALL 0x00000FFFU + struct vki_statx_timestamp { __vki_s64 tv_sec; __vki_u32 tv_nsec; @@ -1476,6 +1478,8 @@ struct vki_flock64 { __vki_kernel_pid_t l_pid; }; +#define VKI_AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */ + //---------------------------------------------------------------------- // From linux-2.6.8.1/include/linux/sysctl.h //---------------------------------------------------------------------- |
|
From: Philippe W. <phi...@so...> - 2019-08-15 14:55:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=597c8875df3c49655886ba1d4f4c026488f08c92 commit 597c8875df3c49655886ba1d4f4c026488f08c92 Author: Philippe Waroquiers <phi...@sk...> Date: Thu Aug 15 16:54:05 2019 +0200 Make references from README_DEVELOPERS/README.solaris to README for build/install If someone wants to build/install and starts in these 2 files, a reference to the README instructions is helpful. Diff: --- README.solaris | 3 ++- README_DEVELOPERS | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.solaris b/README.solaris index 7493642..42adb0b 100644 --- a/README.solaris +++ b/README.solaris @@ -23,7 +23,8 @@ Requirements Compilation ----------- -Please follow the generic instructions in the README file. +Please follow the generic instructions in the README file, +in the section 'Building and installing it'. The configure script detects a canonical host to determine which version of Valgrind should be built. If the system compiler by default produces 32-bit diff --git a/README_DEVELOPERS b/README_DEVELOPERS index 07a48c4..3a36fc4 100644 --- a/README_DEVELOPERS +++ b/README_DEVELOPERS @@ -1,3 +1,7 @@ +Building and installing it +~~~~~~~~~~~~~~~~~~~~~~~~~~ +To build/install from the GIT repository or from a distribution +tarball, refer to the section with the same name in README. Building and not installing it ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
From: Petar J. <pe...@so...> - 2019-08-14 15:45:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=803bf32f4ca3719d6cb50368237414eb564e90f1 commit 803bf32f4ca3719d6cb50368237414eb564e90f1 Author: Petar Jovanovic <mip...@gm...> Date: Wed Aug 14 15:43:10 2019 +0000 mips32: hook up sched_rr_get_interval syscall Hook up sched_rr_get_interval syscall for mips32. This fixes sched_rr_get_interval01 and several other tests in the LTP test suite. Diff: --- coregrind/m_syswrap/syswrap-mips32-linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index c745550..f32e02d 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -927,7 +927,7 @@ static SyscallTableEntry syscall_main_table[] = { LINX_ (__NR_sched_yield, sys_sched_yield), // 162 LINX_ (__NR_sched_get_priority_max, sys_sched_get_priority_max), // 163 LINX_ (__NR_sched_get_priority_min, sys_sched_get_priority_min), // 164 - //.. //LINX?(__NR_sched_rr_get_interval, sys_sched_rr_get_interval), // 165 + LINXY (__NR_sched_rr_get_interval, sys_sched_rr_get_interval), // 165 GENXY (__NR_nanosleep, sys_nanosleep), // 166 GENX_ (__NR_mremap, sys_mremap), // 167 LINXY (__NR_accept, sys_accept), // 168 |
|
From: Petar J. <pe...@so...> - 2019-08-14 15:45:51
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a03ca6eef8a5be700ffa4fedf63fc00761230d73 commit a03ca6eef8a5be700ffa4fedf63fc00761230d73 Author: Petar Jovanovic <mip...@gm...> Date: Wed Aug 14 15:36:07 2019 +0000 mips32: hook up sched_setparam syscall Hook up sched_setparam syscall for mips32. This fixes sched_setparam01 and several other tests in the LTP test suite. Diff: --- coregrind/m_syswrap/syswrap-mips32-linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index 606b9e2..c745550 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -920,7 +920,7 @@ static SyscallTableEntry syscall_main_table[] = { GENX_ (__NR_munlock, sys_munlock), // 155 GENX_ (__NR_mlockall, sys_mlockall), // 156 LINX_ (__NR_munlockall, sys_munlockall), // 157 - //.. LINXY(__NR_sched_setparam, sys_sched_setparam), // 158 + LINXY (__NR_sched_setparam, sys_sched_setparam), // 158 LINXY (__NR_sched_getparam, sys_sched_getparam), // 159 LINX_ (__NR_sched_setscheduler, sys_sched_setscheduler), // 160 LINX_ (__NR_sched_getscheduler, sys_sched_getscheduler), // 161 |
|
From: Petar J. <pe...@so...> - 2019-08-14 15:45:44
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=04614dae3b3e9d0ba25ed8f12fd930f758a98119 commit 04614dae3b3e9d0ba25ed8f12fd930f758a98119 Author: Petar Jovanovic <mip...@gm...> Date: Wed Aug 14 15:27:25 2019 +0000 mips: hook up tee syscall correctly Hook up sys_tee for mips32 and mips64 correctly. For mips64, it is just a simplification to use generic linux implementation. This fixes tee01 test in the LTP test suite for mips32. Diff: --- coregrind/m_syswrap/syswrap-mips32-linux.c | 1 + coregrind/m_syswrap/syswrap-mips64-linux.c | 11 +---------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index fe58d09..606b9e2 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -1062,6 +1062,7 @@ static SyscallTableEntry syscall_main_table[] = { //.. LINX_ (__NR_splice, sys_splice), // 304 PLAX_ (__NR_sync_file_range, sys_sync_file_range), // 305 + LINX_ (__NR_tee, sys_tee), // 306 //.. LINX_ (__NR_set_robust_list, sys_set_robust_list), // 309 LINXY (__NR_get_robust_list, sys_get_robust_list), // 310 diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index 0af43a7..d0bb3cd 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -216,7 +216,6 @@ SysRes sys_set_tls ( ThreadId tid, Addr tlsptr ) file, but that requires even more macro magic. */ DECL_TEMPLATE (mips_linux, sys_set_thread_area); -DECL_TEMPLATE (mips_linux, sys_tee); DECL_TEMPLATE (mips_linux, sys_vmsplice); DECL_TEMPLATE (mips_linux, sys_ustat); DECL_TEMPLATE (mips_linux, sys_sysfs); @@ -235,14 +234,6 @@ DECL_TEMPLATE (mips_linux, sys_rt_sigreturn); DECL_TEMPLATE (mips_linux, sys_pipe); DECL_TEMPLATE (mips_linux, sys_fadvise64); -PRE(sys_tee) -{ - PRINT("sys_tee ( %ld, %ld, %" FMT_REGWORD "u, %#" FMT_REGWORD "x )", - SARG1, SARG2, ARG3, ARG4); - PRE_REG_READ4(long, "sys_tee", int, fdin, int, fdout, vki_size_t, len, - int, flags); -} - PRE(sys_vmsplice) { PRINT("sys_vmsplice ( %ld, %#" FMT_REGWORD "x, %" FMT_REGWORD "u, %ld )", @@ -796,7 +787,7 @@ static SyscallTableEntry syscall_main_table[] = { PLAX_ (__NR_unshare, sys_unshare), LINX_ (__NR_splice, sys_splice), LINX_ (__NR_sync_file_range, sys_sync_file_range), - PLAX_ (__NR_tee, sys_tee), + LINX_ (__NR_tee, sys_tee), PLAX_ (__NR_vmsplice, sys_vmsplice), LINX_ (__NR_set_robust_list, sys_set_robust_list), LINXY (__NR_get_robust_list, sys_get_robust_list), |
|
From: Petar J. <pe...@so...> - 2019-08-14 15:45:42
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b9841d959205bf790f3bd80dadba6d23837ce2db commit b9841d959205bf790f3bd80dadba6d23837ce2db Author: Petar Jovanovic <mip...@gm...> Date: Wed Aug 14 15:18:13 2019 +0000 update .gitignore with memcheck/tests/linux/sys-preadv* files Add memcheck/tests/linux/sys-preadv2_pwritev2 memcheck/tests/linux/sys-preadv_pwritev to .gitignore. Diff: --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index a0dedb8..9ba42ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1107,6 +1107,8 @@ /memcheck/tests/linux/stack_switch /memcheck/tests/linux/syscalls-2007 /memcheck/tests/linux/sys-copy_file_range +/memcheck/tests/linux/sys-preadv2_pwritev2 +/memcheck/tests/linux/sys-preadv_pwritev /memcheck/tests/linux/sys-statx /memcheck/tests/linux/syslog-syscall /memcheck/tests/linux/timerfd-syscall |
|
From: Petar J. <mip...@gm...> - 2019-08-13 15:00:16
|
Can you check the latest development tree and see if you are seeing the issue with it? There have been some changes related to syscall routines, so there is a (small) chance it could help your issue. Give it a try. Petar |
|
From: Petar J. <pe...@so...> - 2019-08-13 14:55:56
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=14911f7d6cc92df110c5987549bfcd84279009a5 commit 14911f7d6cc92df110c5987549bfcd84279009a5 Author: Petar Jovanovic <mip...@gm...> Date: Tue Aug 13 14:51:37 2019 +0000 make pth_self_kill_15_other test deterministic Modify the pth_self_kill_15_other test to make its behaviour deterministic by introducing a pthread_join call. Do so by modifying the signal handler for SIGTERM for the spawned thread which would issue the pthread_join call prior to exiting. This fixes KDE #410599. Patch by Stefan Maksimovic. Diff: --- NEWS | 1 + none/tests/pth_self_kill.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/NEWS b/NEWS index 7217164..6d55d76 100644 --- a/NEWS +++ b/NEWS @@ -58,6 +58,7 @@ where XXXXXX is the bug number as listed below. 404406 s390x: z14 miscellaneous instructions not implemented 409141 Valgrind hangs when SIGKILLed 409367 exit_group() after signal to thread waiting in futex() causes hangs +410599 Non-deterministic behaviour of pth_self_kill_15_other test n-i-bz Fix minor one time leaks in dhat. n-i-bz Add --run-cxx-freeres=no in outer args to avoid inner crashes. diff --git a/none/tests/pth_self_kill.c b/none/tests/pth_self_kill.c index 98adbad..3ad675f 100644 --- a/none/tests/pth_self_kill.c +++ b/none/tests/pth_self_kill.c @@ -10,6 +10,8 @@ valgrind ./pth_self_kill 15 killotherthread was looping. */ +pthread_t parent_thr; + void *t(void *p) { sleep (200); @@ -18,10 +20,28 @@ void *t(void *p) return NULL; } +void handler_15(int signum) +{ + pthread_join(parent_thr, NULL); + exit(2); +} + int main(int argc, char **argv) { pthread_t thr; + parent_thr = pthread_self(); + + struct sigaction sa_old; + struct sigaction sa_new; + + sigaction(15, NULL, &sa_old); + sa_new.sa_mask = sa_old.sa_mask; + sa_new.sa_flags = sa_old.sa_flags; + sa_new.sa_handler = &handler_15; + sigaction(15, &sa_new, NULL); + + if (argc <= 1) { printf @@ -41,4 +61,5 @@ int main(int argc, char **argv) } else raise(s); + sigaction(15, &sa_old, NULL); } |
|
From: Petar J. <pe...@so...> - 2019-08-13 14:32:25
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=f605da3ef5f8b8573043fd1abae59722b8d37cee commit f605da3ef5f8b8573043fd1abae59722b8d37cee Author: Petar Jovanovic <mip...@gm...> Date: Tue Aug 13 14:30:30 2019 +0000 mips32: add sync_file_range syscall support Hook up sync_file_range for mips32. Along with the change for passing 7th argument in syscalls, this will fix sync_file_range01 failure within LTP test suite. Patch by Nikola Milutinovic. Diff: --- coregrind/m_syswrap/syswrap-mips32-linux.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index 7905547..fe58d09 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -410,6 +410,7 @@ DECL_TEMPLATE (mips_linux, sys_set_thread_area); DECL_TEMPLATE (mips_linux, sys_pipe); DECL_TEMPLATE (mips_linux, sys_prctl); DECL_TEMPLATE (mips_linux, sys_ptrace); +DECL_TEMPLATE (mips_linux, sys_sync_file_range); PRE(sys_mmap2) { @@ -724,6 +725,28 @@ POST(sys_prctl) WRAPPER_POST_NAME(linux, sys_prctl)(tid, arrghs, status); } +PRE(sys_sync_file_range) +{ + *flags |= SfMayBlock; + + PRINT("sys_sync_file_range ( %ld, %llu, %llu, %ld )", + SARG1, MERGE64(ARG3,ARG4), MERGE64(ARG5, ARG6), SARG7); + + if (VG_(tdict).track_pre_reg_read) { + PRRSN; + PRA1("sync_file_range", int, fd); + PRA3("sync_file_range", vki_u32, MERGE64_FIRST(offset)); + PRA4("sync_file_range", vki_u32, MERGE64_SECOND(offset)); + PRA5("sync_file_range", vki_u32, MERGE64_FIRST(nbytes)); + PRA6("sync_file_range", vki_u32, MERGE64_SECOND(nbytes)); + PRA7("sync_file_range", int, flags); + } + + if (!ML_(fd_allowed)(ARG1, "sync_file_range", tid, False)){ + SET_STATUS_Failure( VKI_EBADF ); + } +} + #undef PRE #undef POST @@ -1038,6 +1061,7 @@ static SyscallTableEntry syscall_main_table[] = { LINXY (__NR_ppoll, sys_ppoll), // 302 //.. LINX_ (__NR_splice, sys_splice), // 304 + PLAX_ (__NR_sync_file_range, sys_sync_file_range), // 305 //.. LINX_ (__NR_set_robust_list, sys_set_robust_list), // 309 LINXY (__NR_get_robust_list, sys_get_robust_list), // 310 |
|
From: Petar J. <pe...@so...> - 2019-08-13 14:32:21
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9d1b64dd4d5da843fe7a74caa4f86bc672b0eb33 commit 9d1b64dd4d5da843fe7a74caa4f86bc672b0eb33 Author: Petar Jovanovic <mip...@gm...> Date: Tue Aug 13 12:19:30 2019 +0000 mips: pass 7th argument in syscalls Only arg1 to arg6 have been passed down to kernel for syscalls. This patch ensures that arg7 is also passed down for syscalls. In addition to this, ensure that we have 16-byte aligned stack during mips64 syscall. Along with the change for sync_file_range, this will fix sync_file_range01 failure within LTP test suite. Patch by Nikola Milutinovic. Diff: --- coregrind/m_syscall.c | 37 ++++++++++++++---------------- coregrind/m_syswrap/priv_types_n_macros.h | 11 ++++++++- coregrind/m_syswrap/syscall-mips32-linux.S | 6 +++-- coregrind/m_syswrap/syscall-mips64-linux.S | 2 ++ coregrind/m_syswrap/syswrap-main.c | 11 +++++++-- 5 files changed, 42 insertions(+), 25 deletions(-) diff --git a/coregrind/m_syscall.c b/coregrind/m_syscall.c index cbc491b..a3461e8 100644 --- a/coregrind/m_syscall.c +++ b/coregrind/m_syscall.c @@ -774,7 +774,7 @@ static UWord do_syscall_WRK ( */ extern int do_syscall_WRK ( int a1, int a2, int a3, - int a4, int a5, int a6, int syscall_no, UWord *err, + int a4, int a5, int a6, int a7, int syscall_no, UWord *err, UWord *valHi, UWord* valLo ); asm ( @@ -784,15 +784,15 @@ asm ( ".set push \n\t" ".set noreorder \n\t" "do_syscall_WRK: \n\t" - " lw $2, 24($29) \n\t" - " syscall \n\t" - " lw $8, 28($29) \n\t" - " sw $7, ($8) \n\t" - " lw $8, 32($29) \n\t" - " sw $3, ($8) \n\t" /* store valHi */ - " lw $8, 36($29) \n\t" - " jr $31 \n\t" - " sw $2, ($8) \n\t" /* store valLo */ + " lw $2, 28($29) \n\t" + " syscall \n\t" + " lw $8, 32($29) \n\t" + " sw $7, ($8) \n\t" + " lw $8, 36($29) \n\t" + " sw $3, ($8) \n\t" /* store valHi */ + " lw $8, 40($29) \n\t" + " jr $31 \n\t" + " sw $2, ($8) \n\t" /* store valLo */ ".size do_syscall_WRK, .-do_syscall_WRK \n\t" ".set pop \n\t" ".previous \n\t" @@ -800,7 +800,7 @@ asm ( #elif defined(VGP_mips64_linux) extern RegWord do_syscall_WRK ( RegWord a1, RegWord a2, RegWord a3, RegWord a4, - RegWord a5, RegWord a6, RegWord syscall_no, + RegWord a5, RegWord a6, RegWord a7, RegWord syscall_no, RegWord* V1_A3_val ); asm ( ".text \n\t" @@ -809,15 +809,12 @@ asm ( ".set push \n\t" ".set noreorder \n\t" "do_syscall_WRK: \n\t" - " daddiu $29, $29, -8 \n\t" - " sd $11, 0($29) \n\t" - " move $2, $10 \n\t" + " move $2, $11 \n\t" " syscall \n\t" - " ld $11, 0($29) \n\t" - " daddiu $29, $29, 8 \n\t" - " sd $3, 0($11) \n\t" /* store v1 in last param */ + " ld $12, 0($29) \n\t" + " sd $3, 0($12) \n\t" /* store v1 in V1_A3_val */ " jr $31 \n\t" - " sd $7, 8($11) \n\t" /* store a3 in last param */ + " sd $7, 8($12) \n\t" /* store a3 in V1_A3_val */ ".size do_syscall_WRK, .-do_syscall_WRK \n\t" ".set pop \n\t" ".previous \n\t" @@ -1026,14 +1023,14 @@ SysRes VG_(do_syscall) ( UWord sysno, RegWord a1, RegWord a2, RegWord a3, UWord err = 0; UWord valHi = 0; UWord valLo = 0; - (void) do_syscall_WRK(a1,a2,a3,a4,a5,a6, sysno,&err,&valHi,&valLo); + (void) do_syscall_WRK(a1, a2, a3, a4, a5, a6, a7, sysno, &err, &valHi, &valLo); return VG_(mk_SysRes_mips32_linux)( valLo, valHi, (ULong)err ); #elif defined(VGP_mips64_linux) RegWord v1_a3[2]; v1_a3[0] = 0xFF00; v1_a3[1] = 0xFF00; - RegWord V0 = do_syscall_WRK(a1,a2,a3,a4,a5,a6,sysno,v1_a3); + RegWord V0 = do_syscall_WRK(a1, a2, a3, a4, a5, a6, a7, sysno, v1_a3); RegWord V1 = (RegWord)v1_a3[0]; RegWord A3 = (RegWord)v1_a3[1]; return VG_(mk_SysRes_mips64_linux)( V0, V1, A3 ); diff --git a/coregrind/m_syswrap/priv_types_n_macros.h b/coregrind/m_syswrap/priv_types_n_macros.h index 32165fd..bd9176c 100644 --- a/coregrind/m_syswrap/priv_types_n_macros.h +++ b/coregrind/m_syswrap/priv_types_n_macros.h @@ -91,7 +91,7 @@ typedef || defined(VGP_ppc32_linux) \ || defined(VGP_ppc64be_linux) || defined(VGP_ppc64le_linux) \ || defined(VGP_arm_linux) || defined(VGP_s390x_linux) \ - || defined(VGP_mips64_linux) || defined(VGP_arm64_linux) + || defined(VGP_arm64_linux) Int o_arg1; Int o_arg2; Int o_arg3; @@ -127,6 +127,15 @@ typedef Int o_arg6; Int s_arg7; Int s_arg8; +# elif defined(VGP_mips64_linux) + Int o_arg1; + Int o_arg2; + Int o_arg3; + Int o_arg4; + Int o_arg5; + Int o_arg6; + Int o_arg7; + Int o_arg8; # else # error "Unknown platform" # endif diff --git a/coregrind/m_syswrap/syscall-mips32-linux.S b/coregrind/m_syswrap/syscall-mips32-linux.S index 286cea3..8a99f93 100644 --- a/coregrind/m_syswrap/syscall-mips32-linux.S +++ b/coregrind/m_syswrap/syscall-mips32-linux.S @@ -115,16 +115,18 @@ ML_(do_syscall_for_client_WRK): lw $5, OFFSET_mips32_r5($8) lw $6, OFFSET_mips32_r6($8) lw $7, OFFSET_mips32_r7($8) - subu $29, $29, 24 #set up the steck frame, + subu $29, $29, 32 #set up the steck frame, lw $9, OFFSET_mips32_r29($8) lw $10, 16($9) sw $10, 16($29) lw $10, 20($9) sw $10, 20($29) + lw $10, 24($9) + sw $10, 24($29) 2: syscall -3: addu $29, $29, 24 #set up the steck frame, +3: addu $29, $29, 32 #set up the steck frame, lw $8, 48($29) /* t0 == ThreadState */ sw $2, OFFSET_mips32_r2($8) diff --git a/coregrind/m_syswrap/syscall-mips64-linux.S b/coregrind/m_syswrap/syscall-mips64-linux.S index 569dee9..9fbd0b6 100644 --- a/coregrind/m_syswrap/syscall-mips64-linux.S +++ b/coregrind/m_syswrap/syscall-mips64-linux.S @@ -96,6 +96,8 @@ ML_(do_syscall_for_client_WRK): ld $7, OFFSET_mips64_r7($5) /* a3 */ ld $8, OFFSET_mips64_r8($5) /* a4 */ ld $9, OFFSET_mips64_r9($5) /* a5 */ + ld $10, OFFSET_mips64_r10($5) /* a6 */ + ld $11, OFFSET_mips64_r11($5) /* a7 */ ld $5, OFFSET_mips64_r5($5) /* a1 */ ld $2, 0($29) /* syscallno */ diff --git a/coregrind/m_syswrap/syswrap-main.c b/coregrind/m_syswrap/syswrap-main.c index 49a4234..3bff7a9 100644 --- a/coregrind/m_syswrap/syswrap-main.c +++ b/coregrind/m_syswrap/syswrap-main.c @@ -560,6 +560,7 @@ void getSyscallArgsFromGuestState ( /*OUT*/SyscallArgs* canonical, canonical->arg4 = *((UInt*) (gst->guest_r29 + 16)); // 16(guest_SP/sp) canonical->arg5 = *((UInt*) (gst->guest_r29 + 20)); // 20(guest_SP/sp) canonical->arg6 = *((UInt*) (gst->guest_r29 + 24)); // 24(guest_SP/sp) + canonical->arg7 = *((UInt*) (gst->guest_r29 + 28)); // 28(guest_SP/sp) canonical->arg8 = __NR_syscall; } @@ -572,6 +573,8 @@ void getSyscallArgsFromGuestState ( /*OUT*/SyscallArgs* canonical, canonical->arg4 = gst->guest_r7; // a3 canonical->arg5 = gst->guest_r8; // a4 canonical->arg6 = gst->guest_r9; // a5 + canonical->arg7 = gst->guest_r10; // a6 + canonical->arg8 = gst->guest_r11; // a7 #elif defined(VGP_x86_darwin) VexGuestX86State* gst = (VexGuestX86State*)gst_vanilla; @@ -890,6 +893,7 @@ void putSyscallArgsIntoGuestState ( /*IN*/ SyscallArgs* canonical, gst->guest_r7 = canonical->arg4; *((UInt*) (gst->guest_r29 + 16)) = canonical->arg5; // 16(guest_GPR29/sp) *((UInt*) (gst->guest_r29 + 20)) = canonical->arg6; // 20(sp) + *((UInt*) (gst->guest_r29 + 24)) = canonical->arg7; // 24(sp) } else { canonical->arg8 = 0; gst->guest_r2 = __NR_syscall; @@ -900,6 +904,7 @@ void putSyscallArgsIntoGuestState ( /*IN*/ SyscallArgs* canonical, *((UInt*) (gst->guest_r29 + 16)) = canonical->arg4; // 16(guest_GPR29/sp) *((UInt*) (gst->guest_r29 + 20)) = canonical->arg5; // 20(sp) *((UInt*) (gst->guest_r29 + 24)) = canonical->arg6; // 24(sp) + *((UInt*) (gst->guest_r29 + 28)) = canonical->arg7; // 28(sp) } #elif defined(VGP_mips64_linux) @@ -911,6 +916,8 @@ void putSyscallArgsIntoGuestState ( /*IN*/ SyscallArgs* canonical, gst->guest_r7 = canonical->arg4; gst->guest_r8 = canonical->arg5; gst->guest_r9 = canonical->arg6; + gst->guest_r10 = canonical->arg7; + gst->guest_r11 = canonical->arg8; #elif defined(VGP_x86_solaris) VexGuestX86State* gst = (VexGuestX86State*)gst_vanilla; @@ -1461,8 +1468,8 @@ void getSyscallArgLayout ( /*OUT*/SyscallArgLayout* layout ) layout->o_arg4 = OFFSET_mips64_r7; layout->o_arg5 = OFFSET_mips64_r8; layout->o_arg6 = OFFSET_mips64_r9; - layout->uu_arg7 = -1; /* impossible value */ - layout->uu_arg8 = -1; /* impossible value */ + layout->o_arg7 = OFFSET_mips64_r10; + layout->o_arg8 = OFFSET_mips64_r11; #elif defined(VGP_x86_darwin) layout->o_sysno = OFFSET_x86_EAX; |
|
From: Petar J. <pe...@so...> - 2019-08-13 14:32:15
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=d830990cd9391f2e4f995d01d00e3d75d09ea238 commit d830990cd9391f2e4f995d01d00e3d75d09ea238 Author: Petar Jovanovic <mip...@gm...> Date: Mon Aug 5 16:28:48 2019 +0000 mips: hook up splice syscall correctly Hook up splice syscall for mips32 and mips64 correctly. This fixes splice01 and several other tests in the LTP test suite. Diff: --- coregrind/m_syswrap/syswrap-mips32-linux.c | 2 ++ coregrind/m_syswrap/syswrap-mips64-linux.c | 13 +------------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index d9e3a04..7905547 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -1037,6 +1037,8 @@ static SyscallTableEntry syscall_main_table[] = { LINXY (__NR_pselect6, sys_pselect6), // 301 LINXY (__NR_ppoll, sys_ppoll), // 302 //.. + LINX_ (__NR_splice, sys_splice), // 304 + //.. LINX_ (__NR_set_robust_list, sys_set_robust_list), // 309 LINXY (__NR_get_robust_list, sys_get_robust_list), // 310 //.. diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index 9b5c07f..0af43a7 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -217,7 +217,6 @@ SysRes sys_set_tls ( ThreadId tid, Addr tlsptr ) DECL_TEMPLATE (mips_linux, sys_set_thread_area); DECL_TEMPLATE (mips_linux, sys_tee); -DECL_TEMPLATE (mips_linux, sys_splice); DECL_TEMPLATE (mips_linux, sys_vmsplice); DECL_TEMPLATE (mips_linux, sys_ustat); DECL_TEMPLATE (mips_linux, sys_sysfs); @@ -244,16 +243,6 @@ PRE(sys_tee) int, flags); } -PRE(sys_splice) -{ - PRINT("sys_splice ( %ld, %#" FMT_REGWORD "x, %ld, %#" FMT_REGWORD - "x, %" FMT_REGWORD "u, %#" FMT_REGWORD "x )", - SARG1, ARG2, SARG3, ARG4, ARG5, ARG6); - - PRE_REG_READ6(long, "sys_splice", int, fdin, vki_loff_t, sizein, int, - fdout, vki_loff_t, sizeout, vki_size_t, len, int, flags); -} - PRE(sys_vmsplice) { PRINT("sys_vmsplice ( %ld, %#" FMT_REGWORD "x, %" FMT_REGWORD "u, %ld )", @@ -805,7 +794,7 @@ static SyscallTableEntry syscall_main_table[] = { LINXY (__NR_pselect6, sys_pselect6), LINXY (__NR_ppoll, sys_ppoll), PLAX_ (__NR_unshare, sys_unshare), - PLAX_ (__NR_splice, sys_splice), + LINX_ (__NR_splice, sys_splice), LINX_ (__NR_sync_file_range, sys_sync_file_range), PLAX_ (__NR_tee, sys_tee), PLAX_ (__NR_vmsplice, sys_vmsplice), |
|
From: Petar J. <pe...@so...> - 2019-08-13 14:32:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=60b477684ccfd0ef6d7904d31328a0344e79daaa commit 60b477684ccfd0ef6d7904d31328a0344e79daaa Author: Petar Jovanovic <mip...@gm...> Date: Mon Aug 5 16:00:45 2019 +0000 mips32: hook up lsetxattr syscall Hook up lsetxattr syscall for mips32. This fixes llistxattr01 and several other tests in the LTP test suite. Diff: --- coregrind/m_syswrap/syswrap-mips32-linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index 544deab..d9e3a04 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -964,7 +964,7 @@ static SyscallTableEntry syscall_main_table[] = { LINX_ (__NR_gettid, sys_gettid), // 222 //.. LINX_ (__NR_setxattr, sys_setxattr), // 224 - //.. + LINX_ (__NR_lsetxattr, sys_lsetxattr), // 225 LINX_ (__NR_fsetxattr, sys_fsetxattr), // 226 LINXY (__NR_getxattr, sys_getxattr), // 227 LINXY (__NR_lgetxattr, sys_lgetxattr), // 228 |
|
From: Andreas A. <ar...@li...> - 2019-08-09 18:17:16
|
On Thu, Aug 08 2019, Mark Wielaard wrote: > Hi Andreas, > > On Wed, 2019-08-07 at 12:52 +0200, Andreas Arnez wrote: >> On Tue, Aug 06 2019, Mark Wielaard wrote: >> > The issue doesn't seem to be with this patch. But with the specific >> > setup of the machine, it is a RHEL7 based setup, where it seems the >> > kernel doesn't setup the vector capability, but the machine does >> > have the vx facility. >> > >> > That seems to cause our tests prereq to think it can run the vector >> > instructions, but when the actual vector* tests run the >> > instructions fail because the kernel hasn't enabled them. >> >> Right. That kind of discrepancy is specific to certain hardware >> features that need support by the hypervisor and OS. VX is one of >> those, because it requires additional registers to be maintained. >> >> > So it seems we need to make tests/s390x_features s390x-vx smarter. >> >> Yes, we should. I suggest the patch below. Instead of relying on >> the CPU facility list, the patch checks the HWCAP, where the kernel >> officially indicates full VX support. Any thoughts? > > Checking AT_HWCAP seems like a good idea. But is glibc 2.16 universal > enough? Since this is just for adding a vgtest prereq you could also do > what tests/check_ppc64_auxv_cap with a shell script. There are only 4 > vgtests that use the s390x-vx prereq, which would then have to be > changed to use the new script. Well, I thought about that and decided against it for a few reasons. One is that the s390x feature test logic is contained in one file so far, and I prefer to keep it that way. Also, I'm hesitant to rely on LD_SHOW_AUXV, since it seems more like a debug feature and has been broken at times. And yes, glibc 2.16 should be sufficient, because systems with an older glibc almost certainly have a kernel that doesn't support VX. Considering the low impact of not detecting VX, I think that's a fair tradeoff. > It might be that glibc 2.16/getauxval is just fine to use though. > Systems that have an older glibc might just not have the vx capability > in the first place. If so then just use what you have. But do please > add a comment on this line: > >> match = GET_HWCAP() & 0x800; OK. With this and another small adjustment I pushed this as: 161d22f0a -- s390x: Fix vector facility (vx) check in test suite Thanks, Andreas |
|
From: Andreas A. <ar...@so...> - 2019-08-09 18:15:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=161d22f0af2c8ee9817df4334572a1a298e1df8a commit 161d22f0af2c8ee9817df4334572a1a298e1df8a Author: Andreas Arnez <ar...@li...> Date: Tue Aug 6 18:29:46 2019 +0200 s390x: Fix vector facility (vx) check in test suite When checking the prereqisuites of running a vector test case, it is not sufficient to check for the appropriate CPU facility bit. It must also be verified that the kernel and hypervisor(s) have actually enabled the vector facility. There are various ways of checking this. E.g., we could try executing a vector instruction and handle any signals. Or we can check the HWCAP for the appropriate bit. This patch does the latter. Diff: --- tests/s390x_features.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/s390x_features.c b/tests/s390x_features.c index ce6c4ab..16f9220 100644 --- a/tests/s390x_features.c +++ b/tests/s390x_features.c @@ -10,6 +10,7 @@ #include <fcntl.h> // open #include <unistd.h> // lseek #include <sys/stat.h> // S_IRUSR +#include <features.h> // __GLIBC_PREREQ // This file determines s390x features a processor supports. // @@ -39,6 +40,17 @@ jmp_buf env; #if defined(VGA_s390x) +// Features that require kernel support should be checked against HWCAP instead +// of the CPU facility list. To read the HWCAP, use 'getauxval' if available -- +// which should be the case with glibc versions >= 2.16. A system with an older +// glibc is unlikely to support any of these features anyhow. +#if __GLIBC_PREREQ(2, 16) +#include <sys/auxv.h> +#define GET_HWCAP() getauxval(AT_HWCAP) +#else +#define GET_HWCAP() 0UL +#endif + /* Number of double words needed to store all facility bits. */ #define S390_NUM_FACILITY_DW 3 @@ -246,7 +258,8 @@ static int go(char *feature, char *cpu) } else if (strcmp(feature, "s390x-highw") == 0 ) { match = facilities[0] & FAC_BIT(45); } else if (strcmp(feature, "s390x-vx") == 0 ) { - match = facilities[2] & FAC_BIT(0); + /* VX needs kernel support; thus check the appropriate HWCAP bit. */ + match = GET_HWCAP() & 0x800; } else if (strcmp(feature, "s390x-msa5") == 0 ) { match = facilities[0] & FAC_BIT(57); /* message security assist 5 facility */ } else if (strcmp(feature, "s390x-mi2") == 0 ) { |
|
From: Mark W. <ma...@kl...> - 2019-08-08 21:54:37
|
Hi Andreas, On Wed, 2019-08-07 at 12:52 +0200, Andreas Arnez wrote: > On Tue, Aug 06 2019, Mark Wielaard wrote: > > The issue doesn't seem to be with this patch. But with the specific > > setup of the machine, it is a RHEL7 based setup, where it seems the > > kernel doesn't setup the vector capability, but the machine does > > have the vx facility. > > > > That seems to cause our tests prereq to think it can run the vector > > instructions, but when the actual vector* tests run the > > instructions fail because the kernel hasn't enabled them. > > Right. That kind of discrepancy is specific to certain hardware > features that need support by the hypervisor and OS. VX is one of > those, because it requires additional registers to be maintained. > > > So it seems we need to make tests/s390x_features s390x-vx smarter. > > Yes, we should. I suggest the patch below. Instead of relying on > the CPU facility list, the patch checks the HWCAP, where the kernel > officially indicates full VX support. Any thoughts? Checking AT_HWCAP seems like a good idea. But is glibc 2.16 universal enough? Since this is just for adding a vgtest prereq you could also do what tests/check_ppc64_auxv_cap with a shell script. There are only 4 vgtests that use the s390x-vx prereq, which would then have to be changed to use the new script. It might be that glibc 2.16/getauxval is just fine to use though. Systems that have an older glibc might just not have the vx capability in the first place. If so then just use what you have. But do please add a comment on this line: > match = GET_HWCAP() & 0x800; Thanks, Mark |
|
From: Andreas A. <ar...@li...> - 2019-08-07 10:54:09
|
On Tue, Aug 06 2019, Mark Wielaard wrote:
> Hi,
>
> On Tue, 2019-08-06 at 11:54 +0200, Mark Wielaard wrote:
>> Sorry, this is a bit old, but I am finally testing this and on a z13
>> setup (no z14) this part causes trouble [...]
>
> We discussed this a bit on irc and it seems I got confused a bit by the
> precise s390x facilities available on the machine I am using (which is
> a remote build machine to which I don't have direct access).
>
> The issue doesn't seem to be with this patch. But with the specific
> setup of the machine, it is a RHEL7 based setup, where it seems the
> kernel doesn't setup the vector capability, but the machine does have
> the vx facility.
>
> That seems to cause our tests prereq to think it can run the vector
> instructions, but when the actual vector* tests run the instructions
> fail because the kernel hasn't enabled them.
Right. That kind of discrepancy is specific to certain hardware
features that need support by the hypervisor and OS. VX is one of
those, because it requires additional registers to be maintained.
> So it seems we need to make tests/s390x_features s390x-vx smarter.
Yes, we should. I suggest the patch below. Instead of relying on the
CPU facility list, the patch checks the HWCAP, where the kernel
officially indicates full VX support. Any thoughts?
--
Andreas
-- >8 --
Subject: [PATCH] s390x: Fix vector facility (vx) check in test suite
When checking the prereqisuites of running a vector test case, it is not
sufficient to check for the appropriate CPU facility bit. It must also be
verified that the kernel and hypervisor(s) have actually enabled the
vector facility. There are various ways of checking this. E.g., we could
try executing a vector instruction and handle any signals. Or we can
check the HWCAP for the appropriate bit. This patch does the latter.
---
tests/s390x_features.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tests/s390x_features.c b/tests/s390x_features.c
index ce6c4ab26..c17331839 100644
--- a/tests/s390x_features.c
+++ b/tests/s390x_features.c
@@ -10,6 +10,17 @@
#include <fcntl.h> // open
#include <unistd.h> // lseek
#include <sys/stat.h> // S_IRUSR
+#include <features.h>
+
+// Features that need kernel support should be checked against HWCAP instead of
+// the CPU facility list. In this case we use 'getauxval' if available -- which
+// should be the case with glibc versions >= 2.16.
+#if __GLIBC_PREREQ(2, 16)
+#include <sys/auxv.h>
+#define GET_HWCAP() getauxval(AT_HWCAP)
+#else
+#define GET_HWCAP() 0UL
+#endif
// This file determines s390x features a processor supports.
//
@@ -246,7 +257,7 @@ static int go(char *feature, char *cpu)
} else if (strcmp(feature, "s390x-highw") == 0 ) {
match = facilities[0] & FAC_BIT(45);
} else if (strcmp(feature, "s390x-vx") == 0 ) {
- match = facilities[2] & FAC_BIT(0);
+ match = GET_HWCAP() & 0x800;
} else if (strcmp(feature, "s390x-msa5") == 0 ) {
match = facilities[0] & FAC_BIT(57); /* message security assist 5 facility */
} else if (strcmp(feature, "s390x-mi2") == 0 ) {
--
2.17.0
|
|
From: Mark W. <ma...@kl...> - 2019-08-06 16:54:33
|
Hi, On Tue, 2019-08-06 at 11:54 +0200, Mark Wielaard wrote: > Sorry, this is a bit old, but I am finally testing this and on a z13 > setup (no z14) this part causes trouble [...] We discussed this a bit on irc and it seems I got confused a bit by the precise s390x facilities available on the machine I am using (which is a remote build machine to which I don't have direct access). The issue doesn't seem to be with this patch. But with the specific setup of the machine, it is a RHEL7 based setup, where it seems the kernel doesn't setup the vector capability, but the machine does have the vx facility. That seems to cause our tests prereq to think it can run the vector instructions, but when the actual vector* tests run the instructions fail because the kernel hasn't enabled them. So it seems we need to make tests/s390x_features s390x-vx smarter. Cheers, Mark |