]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
7 weeks agos390x: Follow-up to 558f5e9517
Florian Krohm [Sun, 4 May 2025 22:30:25 +0000 (22:30 +0000)] 
s390x: Follow-up to 558f5e9517

Said patch removes the resteering machinery which allowed chasing through
unconditional jumps/calls during IR generation.
There were two fixme's related to this which are now removed.
Also eliminate functions 'call_function_and_chase' and
'always_goto_and_chase' which no longer are meaningful. Use
'call_function' and 'always_goto' instead.

7 weeks agos390x: Add disassembly for special insns
Florian Krohm [Sun, 4 May 2025 21:29:34 +0000 (21:29 +0000)] 
s390x: Add disassembly for special insns

Surely we want to see this when tracing the frintend.
Also: new function s390_irgen_inject_ir to wrap the handling of
the special insn for IR injection.

7 weeks agoltp-excludes: Add fork14, futex_cmp_requeue and pidfd_send_signal
Mark Wielaard [Sun, 4 May 2025 18:16:26 +0000 (20:16 +0200)] 
ltp-excludes: Add fork14, futex_cmp_requeue and pidfd_send_signal

There are a few more linux test project syscall tests that seem to
cause some trouble for some buildbots. The fork14 test uses a lot of
memory, as do the futex_cmp_requeue tests (at least on ppc64le). And
the pidfd_send_signal tests, when run inside a container, seem to kill
the test wrapper (and the container it runs in).

7 weeks agoFreeBSD regtest: cleanup test warnings when building with GCC
Paul Floyd [Sun, 4 May 2025 08:38:50 +0000 (10:38 +0200)] 
FreeBSD regtest: cleanup test warnings when building with GCC

7 weeks agoBug 503677 - duplicated-cond compiler warning in dis_RV64M
Paul Floyd [Sun, 4 May 2025 06:55:45 +0000 (08:55 +0200)] 
Bug 503677 - duplicated-cond compiler warning in dis_RV64M

7 weeks agoBug 503641 - close_range syscalls started failing with 3.25.0
Paul Floyd [Fri, 2 May 2025 16:53:09 +0000 (18:53 +0200)] 
Bug 503641 - close_range syscalls started failing with 3.25.0

7 weeks agoFreeBSD close_range syscall
Paul Floyd [Fri, 2 May 2025 14:59:58 +0000 (16:59 +0200)] 
FreeBSD close_range syscall

Simplify the checking. No ned to test for reserved fds,
and just split the close_range if debug output is enabled.

Add a call to close_range with an upper bound of ~0U in the
testcase.

These changes will probably be the basis for fixing
https://bugs.kde.org/show_bug.cgi?id=503641

7 weeks agoillumos regtest: filter a gdb warning
Paul Floyd [Fri, 2 May 2025 10:19:11 +0000 (12:19 +0200)] 
illumos regtest: filter a gdb warning

I only get it when running make test from oi-userland components,
not when running make regtest from a shell. Possibly a locale or
similar issue.

2 months ago-> 3.25.0 final VALGRIND_3_25_0
Mark Wielaard [Fri, 25 Apr 2025 12:38:05 +0000 (14:38 +0200)] 
-> 3.25.0 final

2 months agoRegtest: fix an arm64 Linux warning
Paul Floyd [Thu, 24 Apr 2025 10:52:52 +0000 (12:52 +0200)] 
Regtest: fix an arm64 Linux warning

Just a gcc warning for the deliberate use of an uninitialised
variable in arm64-linux/scalar.

2 months agoSet version to 3.25.0-RC2
Mark Wielaard [Thu, 24 Apr 2025 01:30:58 +0000 (03:30 +0200)] 
Set version to 3.25.0-RC2

2 months agonone/tests/riscv64/testinst.h: Use lla instead of la in JMP_RANGE
Mark Wielaard [Thu, 24 Apr 2025 01:11:26 +0000 (03:11 +0200)] 
none/tests/riscv64/testinst.h: Use lla instead of la in JMP_RANGE

la was fine when using binutils ld >= 2.43. But older (2.41 and 2.42)
binutils ld produced:

none/tests/riscv64/integer.c:81:(.text+0x22cd8): dangerous relocation:
The addend isn't allowed for R_RISCV_GOT_HI20

Using lla makes integer and compressed link with all binutils ld
versions.

2 months agoriscv64: Drop the not-needed type for FpCSEL
Petr Pavlu [Tue, 2 Jul 2024 21:55:57 +0000 (21:55 +0000)] 
riscv64: Drop the not-needed type for FpCSEL

2 months agoriscv64: Add missing floating-point ITE/CSEL support in VEX backend
zhaomingxin [Thu, 13 Apr 2023 07:11:46 +0000 (15:11 +0800)] 
riscv64: Add missing floating-point ITE/CSEL support in VEX backend

2 months agoriscv64: Add support for csrrc
Petr Pavlu [Tue, 2 Jul 2024 21:12:22 +0000 (21:12 +0000)] 
riscv64: Add support for csrrc

2 months agoriscv64: Merge decoding of csrrw and csrrs
Petr Pavlu [Tue, 2 Jul 2024 20:56:46 +0000 (20:56 +0000)] 
riscv64: Merge decoding of csrrw and csrrs

2 months agoriscv64: Fix tests compilation with newer GNU as
Petr Pavlu [Wed, 15 May 2024 20:55:08 +0000 (20:55 +0000)] 
riscv64: Fix tests compilation with newer GNU as

Simplify the test macro JMP_COND() and avoid its use of 'la zero,0'
which is newly rejected by GNU as.

2 months agoUpdate NEWS for RISCV64/Linux and --modify-fds=[no|high] option
Mark Wielaard [Wed, 23 Apr 2025 17:33:26 +0000 (19:33 +0200)] 
Update NEWS for RISCV64/Linux and --modify-fds=[no|high] option

As a little description plus the two bugs (468575 and 493433) to the
bug list.

2 months agos390x only: Clean up unused Ijk_... values
Florian Krohm [Wed, 23 Apr 2025 12:49:20 +0000 (12:49 +0000)] 
s390x only: Clean up unused Ijk_... values

The following jump kinds were never assigned to any variable but were
checked for in various contexts:

- Ijk_MapFail
- Ijk_SigTRAP
- Ijk_SigSEGV
- Ijk_SigBUS

Tighten that up.

2 months agos390x: Fix a comment
Florian Krohm [Wed, 23 Apr 2025 11:37:40 +0000 (11:37 +0000)] 
s390x: Fix a comment

2 months agoauxprogs/Makefile.am (EXTRA_DIST): Add ltpchecks helper files
Mark Wielaard [Tue, 22 Apr 2025 16:24:31 +0000 (18:24 +0200)] 
auxprogs/Makefile.am (EXTRA_DIST): Add ltpchecks helper files

ltp-tester.sh, ltp-excludes.txt and ltp-error-patterns.txt, breaking
make ltpchecks.

2 months agoRegtest: clean up warning and compilation of bug290061.c
Paul Floyd [Tue, 22 Apr 2025 05:22:42 +0000 (07:22 +0200)] 
Regtest: clean up warning and compilation of bug290061.c

On some platforms there was a 'defined but not used' warning.
When I fixed that I got a link error from clang. Using a
_LDFLAGS option causes automake to split building the test into
separate compile and link commands and clang was optimizing away
the unused static 'meh' symbol.

2 months agoIllumos regtest: add an expected for none/tests/fdleak_socketpair_xml.stderr
Paul Floyd [Mon, 21 Apr 2025 18:44:31 +0000 (20:44 +0200)] 
Illumos regtest: add an expected for none/tests/fdleak_socketpair_xml.stderr

illumos socketpair doesn't get the next two fds (3 and 4), instead it
gets 4 and 5. That looks like it's because this is done in two steps in libc.
so_socket gets called twice returnning fds 3 and 4 the so_socketpair takes
those and does some rebinding(?) resulting in fds 4 and 5.

2 months agoIllumos suppression and regtest
Paul Floyd [Sun, 20 Apr 2025 20:14:44 +0000 (22:14 +0200)] 
Illumos suppression and regtest

Broaden the printf suppression
Add an expected for helgrind/tests/bar_bad

2 months agoFreeBSD regtest: add auxv_script to dist_noinst_SCRIPTS
Paul Floyd [Sat, 19 Apr 2025 10:01:26 +0000 (12:01 +0200)] 
FreeBSD regtest: add auxv_script to dist_noinst_SCRIPTS

2 months agoHelgrind regtest: use --check-cond-signal-mutex=yes in tc20_verifywrap
Paul Floyd [Fri, 18 Apr 2025 20:14:54 +0000 (22:14 +0200)] 
Helgrind regtest: use --check-cond-signal-mutex=yes in tc20_verifywrap

2 months agoDoc: add description of cond signal without mutex lock.
Paul Floyd [Fri, 18 Apr 2025 18:37:12 +0000 (20:37 +0200)] 
Doc: add description of cond signal without mutex lock.

2 months agoAdd 3.25 highlights to NEWS for FreeBSD.
Paul Floyd [Fri, 18 Apr 2025 17:32:05 +0000 (19:32 +0200)] 
Add 3.25 highlights to NEWS for FreeBSD.

2 months agoBug 502871 - Make Helgrind "pthread_cond_{signal,broadcast}: dubious: associated...
Paul Floyd [Fri, 18 Apr 2025 11:35:45 +0000 (13:35 +0200)] 
Bug 502871 - Make Helgrind "pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread" optional

2 months agoSet version to 3.25.0-RC1
Mark Wielaard [Fri, 18 Apr 2025 12:22:31 +0000 (14:22 +0200)] 
Set version to 3.25.0-RC1

Also update vg-lifespan which is used for documentation copyright years.

2 months agoUpdate libiberty demangler
Mark Wielaard [Fri, 18 Apr 2025 12:53:44 +0000 (14:53 +0200)] 
Update libiberty demangler

Update the libiberty demangler using the auxprogs/update-demangler
script to gcc git commit 94bea5dd6c9a06ddb6244be1e5196ff5fbe2b186.

This update includes:

    * libiberty: Restore build with CP_DEMANGLE_DEBUG defined
    * non-gcc: Remove trailing whitespace
    * libiberty: Fix comment typos

2 months agoAdd a platform note for Illumos to NEWS.
Paul Floyd [Fri, 18 Apr 2025 11:24:44 +0000 (13:24 +0200)] 
Add a platform note for Illumos to NEWS.

2 months agoRegtest: gdbserver filter another auto-load warning
Paul Floyd [Fri, 18 Apr 2025 10:42:55 +0000 (12:42 +0200)] 
Regtest: gdbserver filter another auto-load warning

Seen on arm64 with GDB 16

2 months agoAdd auxprogs/ltp-excludes.txt
Mark Wielaard [Fri, 18 Apr 2025 10:22:29 +0000 (12:22 +0200)] 
Add auxprogs/ltp-excludes.txt

There are a couple of ltp testcases that take a very long time to run
(under valgrind). Add a file auxprogs/ltp-excludes.txt that is used to
exclude them from a make ltpchecks run, containing 10 tests:

bind06
epoll-ltp
inotify09
msgstress01
sendmsg03
setsockopt06
setsockopt07
signal05
signal06
timerfd_settime02

Excluding these 10 tests brings the execution time of make ltpchecks
down to ~45 minutes.

2 months agoUse LTP for testing valgrind
Martin Cermak [Thu, 17 Apr 2025 14:14:19 +0000 (16:14 +0200)] 
Use LTP for testing valgrind

Add a new top level make target ltpchecks which will fetch the latest
linux test project (ltp) release as defined by the LTP_VERSION and
LTP_SHA256 variables in auxprogs/Makefile.am (update those when a new
version of ltp is released). If the ltp tar.xz has already been
downloaded, or it has already been unpacked and build, the (cached)
file and build will be reused.

The actual testing is done through the auxprogs/ltp-tester.sh script.
It takes all executable tests from the ltp testcases under
kernel/syscalls and runs them 3 times. Once directly, not under
valgrind, once with -q --tool=none and once with -q
--tool=memcheck. It then checks that valgrind didn't produce any
messages with the none tool, that there were no fatal errors produced
(as defined in auxprogs/ltp-error-patterns.txt) and that the ltp
results are the same with and without valgrind.

Currently there are 1472 test binaries and running them all (serially)
takes more than three hours and detects various missing or incomplete
syscall handlers in valgrind, plus various crashers.

https://bugs.kde.org/show_bug.cgi?id=502679

2 months agoFreeBSD: increase coverage of --modify-mds syscalls
Paul Floyd [Thu, 17 Apr 2025 19:54:43 +0000 (21:54 +0200)] 
FreeBSD: increase coverage of --modify-mds syscalls

As illumos, still missing a couple.

2 months agoIllumos: increase coverage of --modify-fds syscalls
Paul Floyd [Thu, 17 Apr 2025 19:26:24 +0000 (21:26 +0200)] 
Illumos: increase coverage of --modify-fds syscalls

It looks like Solaris/Illumos is missing some F_DUP* coverage
and we aren't handling syscalls that reaturn 2 fds (pipe, socketpair).
Otherwise this should cover most Illumos cases at least.

2 months agoLinux regtest 32bit: remove track_new.stderr.exp.debian32
Paul Floyd [Thu, 17 Apr 2025 12:00:49 +0000 (13:00 +0100)] 
Linux regtest 32bit: remove track_new.stderr.exp.debian32

Not needed after switching from dprintf to write to trigger
the error.

2 months agoIllumos regtest: update none/tests/track_new
Paul Floyd [Thu, 17 Apr 2025 11:22:34 +0000 (13:22 +0200)] 
Illumos regtest: update none/tests/track_new

Not sure why I get file/line with Illumos but not
Linux or FreeBSD.

2 months agoFreeBSD: changes for --modify-fds
Paul Floyd [Thu, 17 Apr 2025 11:00:04 +0000 (13:00 +0200)] 
FreeBSD: changes for --modify-fds

Again this is just the minumum to get the track_new test to pass.
Other syscalls later.

2 months agoIllumos: changes for --modify-fds
Paul Floyd [Wed, 16 Apr 2025 18:31:38 +0000 (20:31 +0200)] 
Illumos: changes for --modify-fds

This is the minumum just to get the new testcase to build and pass.
Need to go through the other fd related syscalls later.

2 months agoAdd --modify-fds=[no|high] option
Alexandra Hájková [Wed, 20 Nov 2024 17:00:47 +0000 (12:00 -0500)] 
Add --modify-fds=[no|high] option

Normally a newly recreated file descriptor gets the lowest number
available. This might cause old file descriptor numbers to be reused
and hides bad file descriptor accesses (because the old number is
new again).

When enabled, when the program opens a new file descriptor,
the highest available file descriptor is returned instead of the
lowest one.

Add the none/tests/track_new.stderr.exp test to test this new option.

Adjust none/tests/filter_fdleak to filter the track_new.vgtest,
removing some internal glibc functions from the backtraces and remove
symbol versioning. The output of the use_after_close test also had to
be adjusted. Also adjust the none/tests/cmdline1 and
none/tests/cmdline2 output as the new --modify-fds=no|high is
displayed.

https://bugs.kde.org/show_bug.cgi?id=493433

2 months agoIllumos regtest: update expected for memcheck/tests/amd64-solaris/context_fpu
Paul Floyd [Tue, 15 Apr 2025 19:18:33 +0000 (21:18 +0200)] 
Illumos regtest: update expected for memcheck/tests/amd64-solaris/context_fpu

The expected contains 8 errors for

   if (inhandler[1] || inhandler[3] || inhandler[5] || inhandler[7])
      assert(0);

whilst I would expect 4 (the 4 array elements are uninitialised).

It is also failing on Solaris 11.4.

2 months agoFlush stack overflow / failure to grow stack messages.
Paul Floyd [Tue, 15 Apr 2025 18:52:59 +0000 (20:52 +0200)] 
Flush stack overflow / failure to grow stack messages.

These messages were missing for the test

none/tests/solaris/stack_overflow

on Illumos. The test now passes.

2 months agonightly: fix check for Illumos libc
Paul Floyd [Tue, 15 Apr 2025 18:39:22 +0000 (20:39 +0200)] 
nightly: fix check for Illumos libc

On Illumos `uname -o` outputs "illumos". We weren't testing for
that so it fell through to the Linux block which runs libc.so to
get the version string. On Illumos that outputs

usage: ld.so.1 [-e option,...] dynamic-object [object args,...]

2 months agoIllumos readelf: patch for detection of DTrace .data sections
Paul Floyd [Mon, 14 Apr 2025 20:05:57 +0000 (22:05 +0200)] 
Illumos readelf: patch for detection of DTrace .data sections

Taken from
    https://github.com/oracle/solaris-userland/blob/master/components/valgrind/patches/03-dtrace-section.patch

2 months agoAdd 'scripts' directory to dirs_to_ignore in check_headers_and_includes
Paul Floyd [Mon, 14 Apr 2025 19:06:45 +0000 (21:06 +0200)] 
Add 'scripts' directory to dirs_to_ignore in check_headers_and_includes

2 months agoIllumos regtest: fix threadname vgtest files
Paul Floyd [Mon, 14 Apr 2025 18:43:20 +0000 (20:43 +0200)] 
Illumos regtest: fix threadname vgtest files

I missed one level of ../ and didn't see that there was already
a prereq: in each of these two files.

2 months agoIllumos nightly: enable sending results to valgrind-testresults
Paul Floyd [Mon, 14 Apr 2025 17:38:03 +0000 (19:38 +0200)] 
Illumos nightly: enable sending results to valgrind-testresults

2 months agoIllumos nightly: add conf files for Illumos
Paul Floyd [Mon, 14 Apr 2025 10:30:52 +0000 (12:30 +0200)] 
Illumos nightly: add conf files for Illumos

2 months agos390x: Regtest integration of none/tests/s390x/disasm-test
Florian Krohm [Sun, 13 Apr 2025 12:06:33 +0000 (12:06 +0000)] 
s390x: Regtest integration of none/tests/s390x/disasm-test

The checker requires objdump --version >= 2.44
Add command line flag --check-prereq to disasm-test and use it in
disasm-test.vgtest.
New file none/tests/s390x/disasm-test/disasm-test.post.exp as the
checker is run in the "post" hook.

2 months agos390x: Final change to fix BZ 495817
Florian Krohm [Sun, 13 Apr 2025 11:05:08 +0000 (11:05 +0000)] 
s390x: Final change to fix BZ 495817

This patch makes VEX disassembly match objdump disassembly for
objdump versions >= 2.44. Prior objdump versions did not handle the
nuances of the "rotate and ..." set of opcodes and there was also a
bug disassembling BC insns.

Fixes https://bugs.kde.org/show_bug.cgi?id=495817

2 months agoIllumos regtest: use LC_ALL=C for execx test
Paul Floyd [Sat, 12 Apr 2025 21:57:58 +0000 (23:57 +0200)] 
Illumos regtest: use LC_ALL=C for execx test

There's an uninitialized read in /usr/bin/printf when using the
default en_US.UTF-8 locale. This isn't a printf test, and using
the C locale makes the error go away.

2 months agos390x: Fix IR generation for SRNMB
Florian Krohm [Sat, 12 Apr 2025 21:45:22 +0000 (21:45 +0000)] 
s390x: Fix IR generation for SRNMB

disasm-test generated this test:

  asm volatile("srnmb 4095(%r0)");

which was disassembled in VEX to

  srnmb 0

causing a mismatch with what objdump does.

4095 is not a valid bfp rounding mode and the old implementation of
s390_irgen_SRNMB let it slide by with a warning. However, POP calls for a
specification exception in this case. This is what this patch changes.i
It also eliminates the s390_irgen_srnmb_wrapper function along the way.

While adjusting none/tests/s390x/srnmb.* I noticed that the line
number shown in the specification exception is incorrect. This
is not a regression. It has been incorrect before as well.

I have opened https://bugs.kde.org/show_bug.cgi?id=502729 fro the line
number issue.

2 months agoIllumos regtest: add 'illumos' to os_test and turn off a few tests
Paul Floyd [Sat, 12 Apr 2025 16:27:06 +0000 (18:27 +0200)] 
Illumos regtest: add 'illumos' to os_test and turn off a few tests

The threadname tests fail on Illumos. Solaris has a syscall,
sys_lwp_name, which we intercept and record. Illumos doesn't
have that, with the pthread name functions looking ofr the name in /proc
That's not implemented in Valgrind so I'm turning those 2 tests off.

The other 3 are all based on none faultstatus. This test checks 4 things,
one of which is reading from a 32k mmap that is PRIVATE and READ but is
only backed by a 16k file. All other OSes generate a SIGBUS. Illumos
just reads 0 from the address.

2 months agoFreeBSD nightly: automatically use all CPUs
Paul Floyd [Sat, 12 Apr 2025 06:34:13 +0000 (08:34 +0200)] 
FreeBSD nightly: automatically use all CPUs

2 months agoFix typo: segement -> segment
Philippe Waroquiers [Fri, 11 Apr 2025 19:37:18 +0000 (21:37 +0200)] 
Fix typo:  segement -> segment

No impact, typo in a comment.

2 months agoRegtest: use FLAG_PIE for bug290061
Paul Floyd [Fri, 11 Apr 2025 18:29:58 +0000 (20:29 +0200)] 
Regtest: use FLAG_PIE for bug290061

Illumos GCC doesn't have -pie. Also use it for the link command.

2 months agos390x: Implement VTM without dirty helper
Andreas Arnez [Thu, 10 Apr 2025 15:27:30 +0000 (17:27 +0200)] 
s390x: Implement VTM without dirty helper

The VTM instruction is currently translated to a dirty helper call, which
comes with the usual drawbacks.

Replace its implementation and remove the dirty helper.

2 months agos390x: disasm-test - minor tweak
Florian Krohm [Fri, 11 Apr 2025 12:00:11 +0000 (12:00 +0000)] 
s390x: disasm-test - minor tweak

2 months agos390x: In s390_disasm_aux - simplify control flow a bit.
Florian Krohm [Fri, 11 Apr 2025 11:55:24 +0000 (11:55 +0000)] 
s390x: In s390_disasm_aux - simplify control flow a bit.

2 months agoBug 290061 - pie elf always loaded at 0x108000
Paul Floyd [Sun, 19 May 2024 09:55:30 +0000 (11:55 +0200)] 
Bug 290061 - pie elf always loaded at 0x108000

Initial patch from Amir Szekely <kichik@gmail.com

2 months agoHelgrind: Fixes for ETIMEDOUT
Paul Floyd [Wed, 9 Apr 2025 06:49:52 +0000 (08:49 +0200)] 
Helgrind: Fixes for ETIMEDOUT

pthread_rwlock_timedrdlock and pthread_rwlock_clockrdlock were
generating API errors if they timed out. This fixes that and
only generates API errors for non-zero and non-ETIMEDOUT
return codes.

2 months agoIllumos helgrind: redir, filter and suppresions
Paul Floyd [Sun, 6 Apr 2025 18:47:39 +0000 (20:47 +0200)] 
Illumos helgrind: redir, filter and suppresions

Add a redir for sem_timedwait (Solaris redirects sema_timedwait
which seems to have been replaced on Illumos).

Filter the arena size for the free_is_write test

Use the Illumos expected for gone_abrt_xml

Add Helgrind suppressions for printf, pthread_barrier_init and
pthread_barrier_destroy.

2 months agoIllumos resgtest: revert previous change to filter_libc and update expected instead
Paul Floyd [Sat, 5 Apr 2025 06:16:54 +0000 (08:16 +0200)] 
Illumos resgtest: revert previous change to filter_libc and update expected instead

2 months agoIllumos regtest: one filter and one pre script fix
Paul Floyd [Fri, 4 Apr 2025 20:00:38 +0000 (22:00 +0200)] 
Illumos regtest: one filter and one pre script fix

filter a change for the bottom of thread stacks and
add use the same pre check as Linux for DRD OpenMP tests.

2 months agoIllumos helgrind: fix for pthread_rwlock_timedrdlock and pthread_rwlock_timedrwlock
Paul Floyd [Thu, 3 Apr 2025 17:56:51 +0000 (19:56 +0200)] 
Illumos helgrind: fix for pthread_rwlock_timedrdlock and pthread_rwlock_timedrwlock

On Illumos these two functions are implemented by calling
pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock respectively.
Since we intercept both it was appearing as though the lock was being
taken recursively when it wasn't. Fixed it by using a static flag for each
and not callinng the client requests if already in a call to the timed
functions.

I think that musl also does this but, ho-hum, Helgrind has never worked on musl.

2 months agos390x: Support the PPA instruction
Andreas Arnez [Thu, 3 Apr 2025 15:40:03 +0000 (17:40 +0200)] 
s390x: Support the PPA instruction

The perform processor assist (PPA) instruction provides the CPU with
special execution hints.  It belongs to the processor-assist facility,
which shares facility bit 49 with the execution-hint and load-and-trap
facilities and with the miscellaneous-instruction-extensions facility 1.

Implementing PPA enables setting facility bit 49 to one.  Similar to other
execution hint instructions, implement PPA as a no-op for now.

2 months agos390x: Reflect renaming of DFP insns in opcode checker
Andreas Arnez [Thu, 3 Apr 2025 17:07:32 +0000 (19:07 +0200)] 
s390x: Reflect renaming of DFP insns in opcode checker

After renaming various DFP instructions to their new name, reflect this in
s390-check-opcodes.pl by ignoring their old names, so the checker doesn't
complain about mismatches.

Also, add the missing documentation in s390-opcodes.csv about the fact
that the "with rounding mode" instruction versions cgdtra, cgxtra, and
cxgtra are implemented.

2 months agos390x: Add missing s390_insn_assert for non-vector opcodes
Florian Krohm [Thu, 3 Apr 2025 13:00:19 +0000 (13:00 +0000)] 
s390x: Add missing s390_insn_assert for non-vector opcodes

Based on the specification in disasm-test/opcode.c

With a few corrections:
- kma: tighten up the assert
- cdftr, cxftr: no emulation failure when floating-point-extension
  facility is not installed
- cgdtra, cgxtra: check for floating-point-extension facility
- ltdtr, ltxtr, lxdtr:  check for DFP facility

2 months agos390x disasm-test: Fix niai opcode spec
Florian Krohm [Thu, 3 Apr 2025 12:58:38 +0000 (12:58 +0000)] 
s390x disasm-test: Fix niai opcode spec

2 months agos390x disasm-test: Fix a few constraints and facility indications.
Florian Krohm [Thu, 3 Apr 2025 09:43:32 +0000 (09:43 +0000)] 
s390x disasm-test: Fix a few constraints and facility indications.

2 months agoIllumos helgrind: pthread wrapper tweaks
Paul Floyd [Wed, 2 Apr 2025 19:39:54 +0000 (21:39 +0200)] 
Illumos helgrind: pthread wrapper tweaks

Wrap pthread_cond_timedwait which seems to have supplanted
cond_reltimedwait on Illumos.

pthread_rwlock_clockrdlock and pthread_rwlock_clockwrlock both
exist on illumos, so enable those wrappers.

2 months agoIllumos regtest: fix configure check for GCC using Sun Studio as
Paul Floyd [Wed, 2 Apr 2025 18:13:10 +0000 (20:13 +0200)] 
Illumos regtest: fix configure check for GCC using Sun Studio as

2 months agoBug 502324 - Add test case for TMx memcheck false positives
Andreas Arnez [Wed, 2 Apr 2025 17:52:26 +0000 (19:52 +0200)] 
Bug 502324 - Add test case for TMx memcheck false positives

Add a regression test for Bug 502324.  Before the bug was fixed, this test
failed with various "conditional jump or move depends on uninitialised
value(s)" messages.

2 months agoBug 502324 - s390x: Fix memcheck false positives with TM/TMY
Andreas Arnez [Wed, 2 Apr 2025 17:52:26 +0000 (19:52 +0200)] 
Bug 502324 - s390x: Fix memcheck false positives with TM/TMY

If the condition code of TM/TMY is generated in a different block than it
is used, memcheck can yield false positives for a partially initialized
value even if the checked bits are all defined.

Fix this by storing the operand ANDed with the mask in the flags thunk,
instead of the unmodified operand.  This enables memcheck to track the
defined bits correctly.

2 months agoBug 502324 - s390x: Fix memcheck false positives with TMxx
Andreas Arnez [Wed, 2 Apr 2025 17:52:26 +0000 (19:52 +0200)] 
Bug 502324 - s390x: Fix memcheck false positives with TMxx

The 16-bit "test under mask" instructions TMLL, TMLH, TMHL, and TMHH can
yield memcheck false positives when:

* some of the operand bits in the tested 16-bit chunk (but outside the
  mask) are undefined

* the resulting condition code is used in a different block

In this case the condition code is computed by the helper
s390_call_calculate_cond, with the full 16-bit chunk and the given mask as
arguments.  Since the 16-bit chunk is not fully defined, memcheck
complains.

To fix this, AND the operand with the given mask before storing it for use
as a helper argument.  Also, optimize the frequent case of testing a
single bit.  For this purpose, add S390_CC_OP_BITWISE2 as a new way of
computing the condition code.

2 months agoIllumos: mention the build-essential package in README.solaris
Paul Floyd [Tue, 1 Apr 2025 18:09:14 +0000 (20:09 +0200)] 
Illumos: mention the build-essential package in README.solaris

2 months agoBug 502288 - s390x: Fix false positive with NNPA pad elements
Andreas Arnez [Tue, 1 Apr 2025 15:21:16 +0000 (17:21 +0200)] 
Bug 502288 - s390x: Fix false positive with NNPA pad elements

The size of the non-pad elements in the last dimension of NNPA tensors is
computed incorrectly.  This can lead to memcheck false positives that look
like this:

==3180208== Syscall param NNPA(in_tensor_1) points to uninitialised byte(s)

Fix the computation.

2 months agos390x: Reflect ppno -> prno renaming in opcode checker
Andreas Arnez [Tue, 1 Apr 2025 14:25:05 +0000 (16:25 +0200)] 
s390x: Reflect ppno -> prno renaming in opcode checker

After consequently renaming ppno to prno, the tool s390-check-opcodes.pl
complains:

  *** opcode prno is implemented but CSV file does not say so
  *** opcode ppno is not implemented but CSV file says so
  *** opcode ppno is not handled by the decoder

Fix this by renaming to "prno" in s390-opcodes.csv as well and declaring
"ppno" instead of "prno" as an alias in s390-check-opcodes.pl.

2 months agoBug 498421 - s390x: Add BPP, BPRP, and NIAI insns
Andreas Arnez [Tue, 1 Apr 2025 14:25:05 +0000 (16:25 +0200)] 
Bug 498421 - s390x: Add BPP, BPRP, and NIAI insns

Add support for the branch prediction preload (BPP), branch prediction
relative preload (BPRP), and next instruction access intent (NIAI)
instructions.  These instructions just provide performance hints to the
CPU and have no other effect on program execution.  Thus implement them as
no-ops.

2 months agos390x disasm-test: Remove command line flags --d12, --d20, --sint, --uint
Florian Krohm [Sun, 30 Mar 2025 21:32:37 +0000 (21:32 +0000)] 
s390x disasm-test: Remove command line flags --d12, --d20, --sint, --uint

These were somewhat useful in the early days of development. Not anymore.

2 months agos390x disasm-text: Update to support all implemented opcodes
Florian Krohm [Sun, 30 Mar 2025 21:20:01 +0000 (21:20 +0000)] 
s390x disasm-text: Update to support all implemented opcodes

A few opcodes are commented out in opcode.c because test generation
cannot handle the constraint.

For some opcodes (e.g. fixbra) VEX runs out of memory. Work around
that by calling vex_reset. Also add a tweak so we won't segfault
when generating tests for EXRL.

2 months agos390x: Fix disassembly for various DFP and BFP opcodes (BZ 495817)
Florian Krohm [Sun, 30 Mar 2025 20:51:33 +0000 (20:51 +0000)] 
s390x: Fix disassembly for various DFP and BFP opcodes  (BZ 495817)

Specifically:
- DFP: add, subtract, divide, multiply
- BFP: load FP integer, load rounded

Change function names from e.g. s390_irgen/emit_LDXBR to
s390_irgen/emit_LDXBRA because LDXBR does not have m3 and m4 operands.
Adjust the returned mnemonic accordingly.

New function s390_format_RRF_UUFF2 for FI[DEX]BRA.

Add adtra_like_disasm to disassemble opcodes for DFP arithmetic.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=495817

2 months agoHandle top __syscall_cancel frames when getting stack traces
Mark Wielaard [Sun, 30 Mar 2025 15:38:21 +0000 (17:38 +0200)] 
Handle top __syscall_cancel frames when getting stack traces

Since glibc 2.41 there are extra frames inserted before doing a
syscall to support proper thread cancellation.  This breaks various
suppressions and regtests involving checking syscall arguments.

Solve this by removing those extra frames from the top of the call
stack when we are processing a linux system call.

https://bugs.kde.org/show_bug.cgi?id=502126

2 months agofilter_gdb.in: filter out __libc_do_syscall
Mark Wielaard [Sun, 30 Mar 2025 11:08:55 +0000 (13:08 +0200)] 
filter_gdb.in: filter out __libc_do_syscall

On i386 and armhf __libc_do_syscall might be used to invoke a syscall.
Replace __libc_do_syscall with "in syscall ..." and filter out
possible extra (assembly) source file lines containing
libc-do-syscall.S from the gdb output.

https://bugs.kde.org/show_bug.cgi?id=502126

2 months agoLinux PPC: add a suppression for an invalid read in libaio io_getevents
Paul Floyd [Sun, 30 Mar 2025 07:00:34 +0000 (09:00 +0200)] 
Linux PPC: add a suppression for an invalid read in libaio io_getevents

The testcase memcheck/tests/linux/bug420682_1 should be a straightforward
clean test. On old PPC systems it produces one error.

2 months agos390x: Fix disassembly for BFP/DFP conversion opcodes (BZ 495817)
Florian Krohm [Sat, 29 Mar 2025 22:54:53 +0000 (22:54 +0000)] 
s390x: Fix disassembly for BFP/DFP conversion opcodes  (BZ 495817)

Specifically:
- BFP convert from/to fixed
- BFP convert from/to logical
- DFP convert from/to fixed
- DFP convert from/to logical

Change function names from e.g. s390_irgen/emit_CEFBR to
s390_irgen/emit_CEFBRA because CFEBR does not have m3 and m4 operands.
Adjust the returned mnemonic accordingly.

New functions fp_convf_disasm and fp_convt_disasm.

Part of fixing https://bugs.kde.org/show_bug.cgi?id=495817

2 months agoarm/v6intThumb: Disable tests for instructions modifying pc (ldr pc, add pc)
Mark Wielaard [Sat, 29 Mar 2025 20:21:45 +0000 (21:21 +0100)] 
arm/v6intThumb: Disable tests for instructions modifying pc (ldr pc, add pc)

The test doesn't compile.

/usr/bin/ld: v6intThumb-v6intThumb.o(.text+0xf2): unresolvable
R_ARM_THM_CALL relocation against symbol `printf@@GLIBC_2.4'

Changing the movw and movt into a ldr as suggested in
https://bugs.kde.org/show_bug.cgi?id=339862#c1
Causes a different compile error.

/tmp/ccveFwf0.s:140: Error: offset out of range

So disable it for now.

2 months agoBug 420682 - io_pgetevents is not supported
Paul Floyd [Fri, 28 Mar 2025 20:45:15 +0000 (21:45 +0100)] 
Bug 420682 - io_pgetevents is not supported

2 months agofilter_gdb.in: __syscall_cancel_arch is just in a syscall
Mark Wielaard [Fri, 28 Mar 2025 12:44:35 +0000 (13:44 +0100)] 
filter_gdb.in: __syscall_cancel_arch is just in a syscall

Since glibc 2.41 some extra syscall_cancel frames are inserted before
that actual syscall is made. Just filter out __syscall_cancel_arch
from the gdb output and replace it with "in syscall ..." to make the
regtest .exp match.

https://bugs.kde.org/show_bug.cgi?id=502126

3 months agos390x: PRNO tidy
Florian Krohm [Thu, 27 Mar 2025 16:30:03 +0000 (16:30 +0000)] 
s390x: PRNO tidy

The mnemonics PRNO and PPNO denote the same opcode. Both names were used
in the code. Not anymore. From now on: consistent naming PRNO / prno

While I was at it:
- Remove left-overs from the early days when PRNO was implemented by means
  of dirty helpers.
- Fix disassembly to use "prno".
- Fix a bug in s390_irgen_DFLTCC which was using "ppno" as mnemonic.

3 months agos390x: Fix disassembly for various insns (BZ 495817)
Florian Krohm [Wed, 26 Mar 2025 18:32:12 +0000 (18:32 +0000)] 
s390x: Fix disassembly for various insns  (BZ 495817)

Specifically: KMA, KMCTR, CU12, CU14, CU21, CU24, LCBB, TRE,
TROO, TROT, TRTO, TRTT

Part of fixing https://bugs.kde.org/show_bug.cgi?id=495817

3 months agoFix library dependency for vbit-test and disasm-test.
Florian Krohm [Wed, 26 Mar 2025 15:11:29 +0000 (15:11 +0000)] 
Fix library dependency for vbit-test and disasm-test.

The executables were not relinked when the library was updated.

3 months agos390x: disasm-test: prepare for AR and FPR register support
Florian Krohm [Mon, 24 Mar 2025 21:53:11 +0000 (21:53 +0000)] 
s390x: disasm-test: prepare for AR and FPR register support

- New function random_reg to replace random_gpr, random_vr.
- New function unique_reg to replace unique_gpr, unique_vr.
- New function choose_reg_and_iterate to handle register operands whose
  values are constrained, e.g. only even registers.
- Do not call unique_reg for a register operand whose values are constrained.

3 months agos390x: disasm-test tweaks
Florian Krohm [Mon, 24 Mar 2025 14:44:07 +0000 (14:44 +0000)] 
s390x: disasm-test tweaks

- Give error messages a prefix.
- Do not segfault when the .dump file is empty. This happens when the
  generated testcase has compiler errors.
- Avoid a file leak when reading the .dump file causes an I/O error.

3 months agoFreeBSD: update comments for amd64 do_syscall_WRK
Paul Floyd [Sun, 23 Mar 2025 17:09:14 +0000 (18:09 +0100)] 
FreeBSD: update comments for amd64 do_syscall_WRK

Get the comments about the last two stack arguments right.

3 months agoTweak debuginfod-check.pl
Florian Krohm [Sun, 23 Mar 2025 16:00:19 +0000 (16:00 +0000)] 
Tweak debuginfod-check.pl

Testing the presence of debuginfod causes an error message in
case it is not installed. Suppress that message.

3 months agoBug 501893 - Missing suppression for __wcscat_avx2 (strcat-strlen-avx2.h.S:68)?
Paul Floyd [Sun, 23 Mar 2025 09:21:29 +0000 (10:21 +0100)] 
Bug 501893 - Missing suppression for __wcscat_avx2 (strcat-strlen-avx2.h.S:68)?

3 months agos390x: Fix BZ 498629
Florian Krohm [Sat, 22 Mar 2025 18:56:09 +0000 (18:56 +0000)] 
s390x: Fix BZ 498629

IR generation for S[L]HHHR and S[L]HHLR was broken. Now fixed as obvious.

Fixes https://bugs.kde.org/show_bug.cgi?id=498629