]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
6 days agos390_amode_for_stack_pointer: Use it. master
Florian Krohm [Tue, 14 Jul 2026 20:35:12 +0000 (20:35 +0000)] 
s390_amode_for_stack_pointer: Use it.

The function was previously unused. Also fix the incorrect comment.

2 weeks agoVEX: warn when special instr preamble is followed by unknown instruction
Mark Wielaard [Sun, 5 Jul 2026 20:12:02 +0000 (22:12 +0200)] 
VEX: warn when special instr preamble is followed by unknown instruction

When someone compiles a program (or the valgrind preload library) with
-Wa,-O2 then binutils gas might "optimize" the special instructions in
valgrind.h away (since they are essentially NOPs). When that happens
they'll get a somewhat incomprehensible error message. Explicitly
print what is happening (if we are doing sigill diagnostics, which
defaults to yes):

  special instruction preamble followed by unknown instruction
  this can happen when inline valgrind.h assembly is optimized (away)

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

2 weeks agoLTP tests: Run without LTP_QUIET=1
Petr Vorel [Thu, 2 Jul 2026 20:56:50 +0000 (22:56 +0200)] 
LTP tests: Run without LTP_QUIET=1

LTP_QUIET functionality in LTP was merged into LTP_REPRODUCIBLE_OUTPUT
in commit eec4993388 [1] which is part of 20260529 (updated in
e6560a8fc). Remove now unused LTP_QUIET.

[1] https://github.com/linux-test-project/ltp/commit/eec499338836685fc52423f013f0bf33aa267c56

Follow-up: e6560a8fc ("Update the LTP version in valgrind testsuite to v20260529")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
2 weeks agoImplement PMOVSXBW SSE4.1 for x86
Alexandra Hájková [Wed, 1 Jul 2026 17:55:11 +0000 (13:55 -0400)] 
Implement PMOVSXBW SSE4.1 for x86

Move test_PMOVSXBW from none/tests/amd64/sse4-64.c to
none/tests/sse4-common.h so both amd64 and x86
implementations can share it.

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

3 weeks agoRemove function s390_isel_amode_b12_b20
Florian Krohm [Sun, 28 Jun 2026 14:14:29 +0000 (14:14 +0000)] 
Remove function s390_isel_amode_b12_b20

Followup patch to aa7619dacd357e554aeb6016e4e2ce0c09c235c4

3 weeks agoTweak s390_insn_cas_emit and s390_insn_cdas_emit
Florian Krohm [Sun, 28 Jun 2026 13:51:52 +0000 (13:51 +0000)] 
Tweak s390_insn_cas_emit and s390_insn_cdas_emit

These functions required an amode without an index register to
be passed in. This patch removes that restriction and also
allows S390_AMODE_BX12 and S390_AMODE_BX12.
The trick goes like this: if an index register is present
- add its contents to the base register
- emit the compare and swap insn
- subtract the contents of the index register from the base register
  leaving it unmodified.
If the incoming amode has R0 as the base register we simply use the
index register as the base register.

The function s390_isel_amode_b12_b20 is now obsolete. But it is not
removed in this patch. Instead it is modified to create BX12 and BX20
amodes in order to enable testing of above tweak.

Regtested.

3 weeks agoGeneralise s390_amode_is_constant.
Florian Krohm [Sun, 28 Jun 2026 12:41:15 +0000 (12:41 +0000)] 
Generalise s390_amode_is_constant.

3 weeks agos390: Remove invalid asserts in s390_amode_bx...
Florian Krohm [Sun, 28 Jun 2026 08:15:15 +0000 (08:15 +0000)] 
s390: Remove invalid asserts in s390_amode_bx...

Amodes are constructed before registers are allocated. This means
that registers passed in to the amode constructors are typically
virtual and thusly have a 0 register number. So these asserts would fire.
This has not surfaced yet because currently no BX12 and BX20 amodes
are being constructed.
Constructing BX12 and BX20 amodes wouldn't be a bad thing. So I'm
not removing those functions.

3 weeks agoSolaris: add redir for wcsncpy
Paul Floyd [Sat, 27 Jun 2026 06:41:03 +0000 (08:41 +0200)] 
Solaris: add redir for wcsncpy

3 weeks agos390: Tweak s390_isel_amode_wrk
Florian Krohm [Fri, 26 Jun 2026 20:50:44 +0000 (20:50 +0000)] 
s390: Tweak s390_isel_amode_wrk

Adjust s390_amode_is_sane accordingly.

3 weeks agos390_insn_as_string: Tidy
Florian Krohm [Fri, 26 Jun 2026 19:54:49 +0000 (19:54 +0000)] 
s390_insn_as_string: Tidy

In the comma-separated list of arguments of a v-insn there is no
space after the comma. #consistency

3 weeks agoDarwin: add redir for wcsncpy
Paul Floyd [Fri, 26 Jun 2026 19:19:53 +0000 (21:19 +0200)] 
Darwin: add redir for wcsncpy

DHAT copy test is now, or soon will be, happy on macOS.

3 weeks agoDHAT regtest: add wcpncpy and wcsncpy to copy test
Paul Floyd [Fri, 26 Jun 2026 19:04:39 +0000 (21:04 +0200)] 
DHAT regtest: add wcpncpy and wcsncpy to copy test

3 weeks agoIn s390_printf use s390_guest_regname for '%G' format specifier.
Florian Krohm [Fri, 26 Jun 2026 12:22:17 +0000 (12:22 +0000)] 
In s390_printf use s390_guest_regname for '%G' format specifier.

3 weeks agoDarwin: add redir for wcscpy
Paul Floyd [Fri, 26 Jun 2026 11:19:02 +0000 (13:19 +0200)] 
Darwin: add redir for wcscpy

The dhat copy test was failing because of this missing redir.

Also I see that the same test does not cover wcsncpy or wcpncpy.
Will add them to the test (and add macOS redirs if needed).

3 weeks agos390: Remove Put(...) = Get(...) when the offsets are identical.
Florian Krohm [Thu, 25 Jun 2026 22:22:20 +0000 (22:22 +0000)] 
s390: Remove Put(...) = Get(...) when the offsets are identical.

Interestingly this pattern is observed. Not sure whether it's worthwhile
to add a peephole optimisation pass after tree building.
VexTranslateArgs::finaltidy looks like a candidate but it appears
to be indended for tools.

3 weeks agoRobustify the flags check in none/tests/x86/crc32.c
Martin Cermak [Thu, 25 Jun 2026 12:14:31 +0000 (14:14 +0200)] 
Robustify the flags check in none/tests/x86/crc32.c

The crc32 instruction doesn't change flags.  The testcase
assumes flags are zero after crc32 and that works with GCC.
With clang though flags appear to be some garbage value.

To make the flags check more robust, zero out the flags
before crc32 is executed.  After that we can reliably check
flags for zero value.

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

3 weeks agoLinux regtest: add clang expecteds for access_below_sp
Paul Floyd [Thu, 25 Jun 2026 10:42:51 +0000 (12:42 +0200)] 
Linux regtest: add clang expecteds for access_below_sp

The test reads from address 8192 below RSP. With clang the same value
is 32 bytes away. The two have different stack arrangements. I could try
to twiddle the offsets for clang but I think that new expecteds will
be simpler.

3 weeks agoLinux regtest: fix warning when building with clang
Paul Floyd [Thu, 25 Jun 2026 06:32:19 +0000 (08:32 +0200)] 
Linux regtest: fix warning when building with clang

3 weeks agoRegtest: fix for building free_sized and free_aligned_sized on Linux with clang.
Paul Floyd [Tue, 23 Jun 2026 19:36:09 +0000 (21:36 +0200)] 
Regtest: fix for building free_sized and free_aligned_sized on Linux with clang.

GCC 15+ defaults to C23 but LLVM doesn't yet. The configure test was passing (it just
tests for the function in libc.so) but building the test failed.

3 weeks agoRegtest: fix build of none crc32 x86
Paul Floyd [Tue, 23 Jun 2026 06:55:37 +0000 (08:55 +0200)] 
Regtest: fix build of none crc32 x86

The 32bit opcode variant needs an explicit l suffix for clang.

The test is still failing due the the flags mask/printf.

With clang, in gdb jusrt before the crc32 opcode rthe flags are

eflags         0x200296            [ PF AF SF IF ID ]

but with gcc

eflags         0x200202            [ IF ID ]

AF and SF need to be masked. It seems to work without masking PF,
not sure why, need to look at that a bit more.

4 weeks agoAdd tests/check_ppc64_auxv_cap to .gitignore
Florian Krohm [Mon, 22 Jun 2026 20:13:22 +0000 (20:13 +0000)] 
Add tests/check_ppc64_auxv_cap to .gitignore

4 weeks agoLinux reallocarray: include stdio.h
Alyssa Ross [Mon, 22 Jun 2026 16:15:34 +0000 (18:15 +0200)] 
Linux reallocarray: include stdio.h

Per POSIX, fprintf comes from stdio.h.  When building with musl, none
of the other included headers provide fprintf.

Fixes: 4bb5691fc ("Linux reallocarray: update testcase and expected")
4 weeks agoUnhandled amd64-linux syscall: 467 (open_tree_attr)
Martin Cermak [Sun, 21 Jun 2026 10:40:48 +0000 (12:40 +0200)] 
Unhandled amd64-linux syscall: 467 (open_tree_attr)

__NR_open_tree_attr is a generic syscall number for linux defined in
vki-scnums-shared-linux.h Hooked in all syswrap-{x86,s390x,riscv64,\
ppc64,ppc32,nanomips,mips64,mips32,arm64,arm,amd64}-linux.c with LINXY
to sys_open_tree_attr.  With sys_open_tree_attr being defined in
priv_syswrap-linux.h with DECL_TEMPLATE linux.  PRE and POST in
syswrap-linux.c.

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

4 weeks agovex x86->IR: unhandled instruction bytes: 66 0F 38 37 (PCMPGTQ)
Martin Cermak [Sun, 21 Jun 2026 09:59:58 +0000 (11:59 +0200)] 
vex x86->IR: unhandled instruction bytes: 66 0F 38 37 (PCMPGTQ)

VEX/priv/guest_x86_toIR.c:  Instruction decoder
VEX/priv/host_x86_isel.c:  Handle Iop_CmpGT64Sx2
none/tests/x86/sse4-x86.c:  Add testcase
none/tests/x86/sse4-x86.stdout.exp:  Ditto
none/tests/amd64/sse4-64.c  Share test_PCMPGTQ()
   between x86 and amd64 testcases.
none/tests/sse4-common.h:  Ditto

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

4 weeks agodocs/xml/FAQ.xml: Replace mempools xref with ulink
Mark Wielaard [Sat, 20 Jun 2026 21:55:09 +0000 (23:55 +0200)] 
docs/xml/FAQ.xml: Replace mempools xref with ulink

The FAQ.xml should not xref other parts of the docs, because it is
built standalone as FAQ.txt.

ERROR: xref linking to mc-manual.mempools has no generated link text.
Error: no ID for constraint linkend: "mc-manual.mempools".
XLink to nonexistent id: mc-manual.mempools

So replace the xref with an ulink with an url to the online copy of
the manual.

4 weeks agoCleanup x86 and amd64 tests build and runtime checks
Mark Wielaard [Sat, 20 Jun 2026 20:49:08 +0000 (22:49 +0200)] 
Cleanup x86 and amd64 tests build and runtime checks

The sse4.2 and movbe configure checks would only succeed on amd64 so
the x86 sse4.2 and movbe tests were never build on x86-only
setups. Add x86 specific sse4.2 and movbe configure checks. Also add
x86-sse42 and x86-movbe features to tests/x86_amd64_features. Use
those in the sse-x86, crc32 and movbe vgtests.

The aes instructions were using the same configure and
x86_amd64_features tests as sse42. But they are separate. So add
separate configure and x86_amd64_features and remove the aes test from
sse42.

4 weeks agoFix none/tests/x86/crc32 u8 register testcase
Mark Wielaard [Sat, 20 Jun 2026 17:02:05 +0000 (19:02 +0200)] 
Fix none/tests/x86/crc32 u8 register testcase

For the CRC32 U8 (crc32b) we were loading the input word into %edi but
then used %dl as input byte (register) for te crc32 instruction. %dl
however is the 8 byte variant of %edx. This made the testcase output
depend on the specific compiler (version) used, since what was in %edx
isn't strictly defined.

The %edi register doesn't have a 8 byte variant. So use %edx instead
to load the input word. For the CRC32 u16 (crc32w) we still use %edi
because we can then use the 16 byte %di.

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

4 weeks agovex x86->IR: unhandled instruction CRC (SSE4.2)
Martin Cermak [Fri, 19 Jun 2026 06:36:11 +0000 (08:36 +0200)] 
vex x86->IR: unhandled instruction CRC (SSE4.2)

vex x86->IR: unhandled instruction bytes: 0xF2 0xF 0x38 0xF1
(CRC, SSE4.2)

VEX/priv/guest_x86_helpers.c:  Helper functions for
crc32 computation
VEX/pub/libvex_guest_x86.h:  Helper function decls
VEX/priv/guest_x86_toIR.c:  The crc32 instruction decoder
none/tests/x86/crc32.c:  New testcase
none/tests/x86/crc32.stdout.exp:  Ditto (expected output)
none/tests/x86/crc32.vgtest:  Ditto (testcase config)
none/tests/x86/Makefile.am:  Plug the test in

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

4 weeks agotests/check_ppc64_auxv_cap: replace LD_SHOW_AUXV-grep shell script with C program...
Abhay Kandpal via Valgrind-developers [Thu, 18 Jun 2026 18:08:26 +0000 (13:08 -0500)] 
tests/check_ppc64_auxv_cap: replace LD_SHOW_AUXV-grep shell script with C program using getauxval()

glibc 2.42 removed sysdeps/powerpc/dl-procinfo.h, which contained
the PowerPC-specific _dl_procinfo() hook that printed human-readable
capability strings in LD_SHOW_AUXV output.  After the change,
LD_SHOW_AUXV emits raw hex for AT_HWCAP / AT_HWCAP2 instead of
capability names like 'altivec' or 'vsx'.

tests/check_ppc64_auxv_cap was a shell script that grep'd
LD_SHOW_AUXV output for capability words, used as a .vgtest 'prereq:'
across many PowerPC tests under none/tests/ppc{32,64}/ and
memcheck/tests/ppc{32,64}/.  On glibc 2.42 it always returns
non-zero, so vg_regtest.in silently skips every test that depends
on it (rc 256, "skipping, prereq failed").  Effectively the entire
PowerPC instruction-level regression suite was disabled.

Replace the shell script with a small C program using getauxval(),
which reads AT_HWCAP / AT_HWCAP2 directly and is unaffected by the
glibc change.  Calling convention and exit codes match the original
script exactly, so none of the .vgtest files need modification:

    check_ppc64_auxv_cap <capability>
      exit 0 - capability is present
      exit 1 - capability is absent, unknown, or usage error

tests/Makefile.am: move check_ppc64_auxv_cap from dist_noinst_SCRIPTS
to check_PROGRAMS so automake builds the binary from the C source.

For portability, configure.ac is extended with AC_CHECK_FUNCS([getauxval])
to detect whether the platform provides getauxval().  On glibc Linux it
is always present (since 2.16, 2012).  On other platforms (FreeBSD,
Solaris, macOS) the function may be absent; on those, the program is
compiled with a stub main() that returns 1 for every query.  None of
those platforms currently use Valgrind's PowerPC port, but the build
must still succeed there.

Signed-off-by: Abhay Kandpal <abhay@linux.ibm.com>
4 weeks agoCheck compiler support -mcpu=power9 or power10 for isa 3.0 and isa 3.1
Mark Wielaard [Thu, 18 Jun 2026 12:34:19 +0000 (14:34 +0200)] 
Check compiler support -mcpu=power9 or power10 for isa 3.0 and isa 3.1

For the HAS_ISA_3_00 and HAS_ISA_3_1 conditionals we want the compiler
to support -mcpu=power9 (isa 3.0) and -mcpu=power10 (isa 3.1) because
we will pass that flag when building test cases.

4 weeks agoImprove check_makefile_consistency (Fix BZ 521259)
Florian Krohm [Thu, 18 Jun 2026 21:14:35 +0000 (21:14 +0000)] 
Improve check_makefile_consistency (Fix BZ 521259)

The old script did not complain about missing header files belonging to
a newly added testcase. I could not figure out how to improve the old
script to handle this so I rewrote it and added a few more checks. See
the commentary in the script.
The makefile parser is more robust and can process the generated
makefiles instead of reading Makefile.am files. Which eliminates any
worries about handling include directives and ifdeffery.

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

4 weeks agoconfigure.ac: Fix AC_HWCAP_CONTAINS_FLAG for glibc 2.42 on PowerPC users/mark/try-ppc-no-auxv
Abhay Kandpal [Tue, 16 Jun 2026 13:16:54 +0000 (08:16 -0500)] 
configure.ac: Fix AC_HWCAP_CONTAINS_FLAG for glibc 2.42 on PowerPC

glibc 2.42 removed sysdeps/powerpc/dl-procinfo.h which contained
the _dl_procinfo() hook responsible for printing human-readable
capability strings in LD_SHOW_AUXV output on PowerPC. As a result,
LD_SHOW_AUXV now prints raw hex values (e.g. 0xdc0065c2) instead
of capability names (e.g. altivec vsx ppc64 ppc32).

The AC_HWCAP_CONTAINS_FLAG macro was using LD_SHOW_AUXV text output
and grep to detect hardware capabilities at configure time. This
broke on glibc 2.42 causing HWCAP_HAS_ALTIVEC and other flags to
be unset, resulting in testVMX.c failing to compile on PowerPC BE
systems due to missing -maltivec flag.

Beyond the immediate glibc-2.42 breakage, the configure-time HWCAP
checks were conceptually wrong: they answer "does the build host
have these capabilities right now?" when the right build-time
question is "can the compiler/assembler emit these instructions?".
Runtime hardware capability is a runtime concern and is already
handled by coregrind/m_machine.c's signal-based probes in
VG_(machine_get_hwcaps)().  Mark suggested removing the HWCAP
clauses entirely and relying on the existing assembler/compiler
checks alone.

This patch:

  - Removes AC_HWCAP_CONTAINS_FLAG and all 10 of its invocations.
  - Drops the '-a x$HWCAP_HAS_* = xyes' clause from 8 AM_CONDITIONALs:
    HAS_ISA_2_07, HAS_ALTIVEC, HAS_VSX, HAS_DFP, BUILD_DFP_TESTS,
    SUPPORTS_HTM, HAS_ISA_3_00, HAS_ISA_3_1.
  - Forces HAS_ISA_2_05 unconditionally true.  ISA 2.05 is POWER6
    (2007); no supported PowerPC system today lacks it.  The
    conditional can't be deleted because tests/Makefile.am still
    references it.
  - Replaces HAS_ISA_2_06's HWCAP clause with the existing VSX
    assembler check, since VSX was introduced in ISA 2.06 and any
    assembler that accepts VSX accepts ISA 2.06.  The AM_CONDITIONAL
    is relocated to after the VSX assembler probe so the variable
    ac_compiler_supports_vsx is defined when it is read.
  - HWCAP_HAS_MMA was defined but never consumed in configure.ac,
    so removing the macro call is a clean removal.

5 weeks agoFix compile issue in VEX/priv/guest_amd64_helpers.c with GCC8
Mark Wielaard [Sat, 13 Jun 2026 22:01:49 +0000 (00:01 +0200)] 
Fix compile issue in VEX/priv/guest_amd64_helpers.c with GCC8

GCC 8.5.0 doesn't like a direct variable declaration after a case
statement.

priv/guest_amd64_helpers.c: In function 'amd64g_dirtyhelper_CPUID_avx2':
priv/guest_amd64_helpers.c:3653:10: error: a label can only be part of a
statement and a declaration is not a statement

Create a block for the case statement to declare the variable.

5 weeks agoUpdate the LTP version in valgrind testsuite to v20260529
Martin Cermak [Fri, 12 Jun 2026 15:07:52 +0000 (17:07 +0200)] 
Update the LTP version in valgrind testsuite to v20260529

Update the LTP version in valgrind testsuite to v20260529.
All patches from auxprogs/ltp-patches were accepted by LTP
upstream and included in the release, so these can now be
dropped locally.

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

5 weeks agoAdvertise LZCNT via CPUID for amd64 clients
Martin Cermak [Fri, 12 Jun 2026 14:45:12 +0000 (16:45 +0200)] 
Advertise LZCNT via CPUID for amd64 clients

The LZCNT instruction is only recognized by a
amd64 guest if the host CPU supports it.

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

5 weeks agoAdd PMULDQ SSE4.1 support for x86
Mark Wielaard [Mon, 8 Jun 2026 13:09:04 +0000 (15:09 +0200)] 
Add PMULDQ SSE4.1 support for x86

Add handling of PMULDQ to VEX/priv/guest_x86_toIR.c based on the
guest_amd64_toIR.c implementation (inline math_PMULDQ_128).

Move test_PMULDQ from none/tests/amd64/sse4-64.c to
none/tests/sse4-common.h and add the same test to
none/tests/x86/sse4-x86.c with new PMULDQ output in stdout.exp.

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

5 weeks agoFreeBSD regtest: update clock_nanosleep1 test
Paul Floyd [Wed, 10 Jun 2026 20:53:04 +0000 (22:53 +0200)] 
FreeBSD regtest: update clock_nanosleep1 test

The test was failing on a VM because the sleep was too short.

5 weeks agoRegtest: remove duplicate filters
Paul Floyd [Wed, 10 Jun 2026 20:51:44 +0000 (22:51 +0200)] 
Regtest: remove duplicate filters

filter_stanza and filter_stanza_and_size_t were doing the same thing.
Keep the one with a short name.

5 weeks agoShip drd/Testing.txt and verify-xml-output
Florian Krohm [Wed, 10 Jun 2026 14:50:54 +0000 (14:50 +0000)] 
Ship drd/Testing.txt and verify-xml-output

That is useful information for developers.
Also add verify-xml-output to dist_noinst_SCRIPTS

5 weeks agoMore makefile tweaks for dist_noinst_SCRIPTS.
Florian Krohm [Wed, 10 Jun 2026 14:05:30 +0000 (14:05 +0000)] 
More makefile tweaks for dist_noinst_SCRIPTS.

Make scripts executable such that the new makefile checker
recognises them as such.

5 weeks agoCleanups in regression test makefiles
Florian Krohm [Wed, 10 Jun 2026 13:10:10 +0000 (13:10 +0000)] 
Cleanups in regression test makefiles

Scripts should go to dist_noinst_SCRIPTS. Move them there from EXTRA_DIST.

5 weeks agoCleanups in regression test makefiles
Florian Krohm [Wed, 10 Jun 2026 10:36:02 +0000 (10:36 +0000)] 
Cleanups in regression test makefiles

Header files should go to noinst_HEADERS. Move them there from
EXTRA_DIST.

5 weeks agoRegtest x86: ensure 16 byte alignment for ROUNDPS and ROUNDPD
Paul Floyd [Tue, 9 Jun 2026 18:04:05 +0000 (20:04 +0200)] 
Regtest x86: ensure 16 byte alignment for ROUNDPS and ROUNDPD

6 weeks agoAdd x86 ROUNDPS and ROUNDPD
Mark Wielaard [Wed, 27 May 2026 18:03:47 +0000 (20:03 +0200)] 
Add x86 ROUNDPS and ROUNDPD

This completes the ROUNDPS, ROUNDSS, ROUNDPD and ROUNDSD SSE4.1
support for x86. x86 already supported SSE 4.1 ROUNDSS and ROUNDSD
instructions.

Add ROUNDPS and ROUNDPD support in VEX/priv/guest_x86_toIR.c based on
the amd64 implementation. Move the testcases from sse4-64.c to
sse4-common.h and make them use XMMREG_DST instead of xmm11 (which
isn't available on x86).

Add testcase output for test_ROUNDPD_w_immediate_rounding,
test_ROUNDPS_w_immediate_rounding, test_ROUNDPD_w_mxcsr_rounding and
test_ROUNDPS_w_mxcsr_rounding to sse4-x86.stdout.exp.

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

6 weeks agoRemove essentially empty .stderr.exp files in none/tests/...
Florian Krohm [Sun, 7 Jun 2026 15:21:12 +0000 (15:21 +0000)] 
Remove essentially empty .stderr.exp files in none/tests/...

Where "essentially empty" means "containing two empty lines only".
That not-so-interesting output can nicely be suppressed by adding
"vgopts: -q" to the respective .vgtest file.
Two exceptions:
(1) vgtest files already containing vgopts are not modified.
(2) If there is more than one .stderr.exp file all .stderr.exp
    files are retained.

6 weeks agoAdd SSE4.1 PHMINPOSUW for x86 32-bit
Alexandra Hájková [Wed, 27 May 2026 15:24:34 +0000 (11:24 -0400)] 
Add SSE4.1 PHMINPOSUW for x86 32-bit

Moved sel16x4_0/1/2/3 to VEX/priv/guest_generic_helpers.h.
Moved amd64g_calculate_sse_phminposuw from guest_amd64_helpers.c
to guest_generic_helpers.h and renamed to
g_calculate_sse_phminposuw so both x86 and amd64 can use it.
Add test function to sse4-common.h and update
none/tests/x86/sse4-x86.c to test the instruction.

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

6 weeks agoFix dist builds: add NEWS.older to EXTRA_DIST
Paul Floyd [Fri, 5 Jun 2026 11:00:08 +0000 (13:00 +0200)] 
Fix dist builds: add NEWS.older to EXTRA_DIST

6 weeks agoDoc: add NEWS.older to html generation
Paul Floyd [Fri, 5 Jun 2026 05:17:24 +0000 (07:17 +0200)] 
Doc: add NEWS.older to html generation

A while back I split up NEWS NEWS.old and NEWS.older. I didn't notice
that I should have also updated the html generation to use the new
file.

6 weeks agoBug 338365 - New client request to fetch valgrind version
Julien Floyd [Fri, 29 May 2026 18:38:10 +0000 (20:38 +0200)] 
Bug 338365 - New client request to fetch valgrind version

added documentation and tests, changed the value from hex to decimal.

Original patch provided by Étienne Dupuis.

6 weeks agoAdvertise LZCNT via CPUID for x86 (32-bit) clients
Martin Cermak [Thu, 4 Jun 2026 07:02:17 +0000 (09:02 +0200)] 
Advertise LZCNT via CPUID for x86 (32-bit) clients

The LZCNT instruction is only recognized by a
x86 guest if the host CPU supports it.

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

6 weeks agoDoc: update README_MISSING_SYSCALL_OR_IOCTL
Paul Floyd [Wed, 3 Jun 2026 20:18:43 +0000 (22:18 +0200)] 
Doc: update README_MISSING_SYSCALL_OR_IOCTL

Add a few things for regword formatting, checking that pointer
deref is safe, syscall failures and checking and tracking fds.

A few more sentences about Solaris, Darwin and FreeBSD.

6 weeks agoWarning cleanup: one more -Wmisleading-indentation for minilzo-inl.c
Paul Floyd [Wed, 3 Jun 2026 19:39:00 +0000 (21:39 +0200)] 
Warning cleanup: one more -Wmisleading-indentation for minilzo-inl.c

I think that I will give up here. The ones in minilzo-inl.c were
easy to fix. The others are all deep in macros and caused by
macros putting everything on one line. I don't think that it's worth
the effort to use pragmas or per-file compiler options or to convert
the macros to static inline functions. I'm only seeing them with
GCC 8.5 on ppc64le.

6 weeks agoRegtest warnings: fixes for GCC 16.1 C++20 volatile deprecation
Paul Floyd [Wed, 3 Jun 2026 06:06:49 +0000 (08:06 +0200)] 
Regtest warnings: fixes for GCC 16.1 C++20 volatile deprecation

We now get warnings for things like using operator++ on a volatile.
Simply removing the volatile keyword seems to solve the problem.
In two of the cases the value is now returned in order to prevent the
compiler from optimising away the variable (which was probably the
original intent).

6 weeks agoWarning cleanup: -Wmisleading-indentation warnings
Paul Floyd [Tue, 2 Jun 2026 06:16:51 +0000 (08:16 +0200)] 
Warning cleanup: -Wmisleading-indentation warnings

On cfarm135 I get a lot of thse warnings. This first bunch
are due to mutliple macros being used on the same line.

7 weeks agoRegtest: fix none round.c test for ppc32 and 64
Paul Floyd [Mon, 1 Jun 2026 18:41:51 +0000 (20:41 +0200)] 
Regtest: fix none round.c test for ppc32 and 64

Was failing to build on buildbot due to the use of an old
K&R function definition.

7 weeks agoRegtest: fox for new none x86 bug520856-x86 test users/paulf/try-fix_x86_ind_jmp_cs_prefix
Paul Floyd [Mon, 1 Jun 2026 10:48:14 +0000 (12:48 +0200)] 
Regtest: fox for new none x86 bug520856-x86 test

A problem with the jumped to skip address with some versions of GCC.
Fix it by junping in the inline assembler.

7 weeks agoBug 520861 - Update FAQ for C++ standard library
Paul Floyd [Mon, 1 Jun 2026 05:42:01 +0000 (07:42 +0200)] 
Bug 520861 - Update FAQ for C++ standard library

7 weeks agoDoc: change STL to standard library
Paul Floyd [Sun, 31 May 2026 18:01:10 +0000 (20:01 +0200)] 
Doc: change STL to standard library

7 weeks agoBug 520856 - unhandled instruction bytes: 0x2E 0xFF 0x14 0x8
Paul Floyd [Sun, 31 May 2026 10:00:43 +0000 (12:00 +0200)] 
Bug 520856 - unhandled instruction bytes: 0x2E 0xFF 0x14 0x8

This was an indirect JMP with a CS segment override prefix.
The fix is to just skip the prefix.

7 weeks agoMassif doc: mention that Darwin x86 uses unsigned long for size_t.
Paul Floyd [Sun, 31 May 2026 05:53:50 +0000 (07:53 +0200)] 
Massif doc: mention that Darwin x86 uses unsigned long for size_t.

This is somewhat academic, macOS 10.15 dropped x86 in 2019,
Valgrind does not support macOS 10.14 x86 since it uses AVX.
The last version of macOS x86 that we do have support for is
macOS 10.13 which was released in 2017 and ended support in
2020.

7 weeks agoDarwin: fix use of DARWIN_VERS on x86
Paul Floyd [Sat, 30 May 2026 06:28:38 +0000 (08:28 +0200)] 
Darwin: fix use of DARWIN_VERS on x86

There was a mistake where I left in one too many "== DARWIN_VERS" when
I purged the DARWIN_10_6 checks. Thanks to Mark Harris for spotting it.

7 weeks agoNEWS: add the new ms_print --peak-only option to TOOL CHANGES
Paul Floyd [Sat, 30 May 2026 05:59:35 +0000 (07:59 +0200)] 
NEWS: add the new ms_print --peak-only option to TOOL CHANGES

7 weeks agoDarwin regtest and version: remove last trace of DARWIN_10_6
Paul Floyd [Fri, 29 May 2026 19:36:15 +0000 (21:36 +0200)] 
Darwin regtest and version: remove last trace of DARWIN_10_6

7 weeks agoFix macOS 10.8.5 undeclared identifier F_READBOOTSTRAP/F_WRITEBOOTSTRAP
Mark Harris [Wed, 20 May 2026 19:21:34 +0000 (12:21 -0700)] 
Fix macOS 10.8.5 undeclared identifier F_READBOOTSTRAP/F_WRITEBOOTSTRAP

Apparently these macros were present in OS X 10.8 but were removed
at some point before OS X 10.8.5.

7 weeks agoDarwin version macros: remove DARWIN_10_6 and DARWIN_10_7
Paul Floyd [Fri, 29 May 2026 19:16:32 +0000 (21:16 +0200)] 
Darwin version macros: remove DARWIN_10_6 and DARWIN_10_7

A while back I bumped up the configure.ac oldest supported OSX to
version 10.8 (that's the oldest with an xcode supporting C11,
I suppose that we could use MacPorts gcc or clang but I don't
want to turn back now).

There were a good number of uses of conditional DARWIN_10_6
and DARWIN_10_7 in the code that this change purges.

7 weeks agoWarning cleanup: make sure that either macros are defined or use #ifdef rather than #if
Paul Floyd [Fri, 29 May 2026 06:31:39 +0000 (08:31 +0200)] 
Warning cleanup: make sure that either macros are defined or use #ifdef rather than #if

A comment in https://bugs.kde.org/show_bug.cgi?id=519604 about correctly checking
for DARWIN_VERS led me to doing some builds with -Wundef. We still get quite a few
warnings from mips and LZO. I'll repeat the exercise on illumos Darwin and Linux amd64.

7 weeks agoDarwin vki header: include config.h
Paul Floyd [Fri, 29 May 2026 05:30:58 +0000 (07:30 +0200)] 
Darwin vki header: include config.h

vki-darwin.h uses DARWIN_VERS to check for OS versions that are
missing needed definitions but it wasn't including config.h

7 weeks agoBug 387080 - Add --peak-only option to ms_print
Julien Floyd [Mon, 25 May 2026 15:34:19 +0000 (17:34 +0200)] 
Bug 387080 - Add --peak-only option to ms_print

Original patch submitted by "Vadim Zeitlin <vz-kde@zeitlins.org>"

This is based on the original patch that added the --only-peak option to ms_print.

Most of my changes targeted the documentation and test.

7 weeks agoBug 520482: Advertise POPCNT on x86 via CPUID
Martin Cermak [Tue, 26 May 2026 10:26:35 +0000 (12:26 +0200)] 
Bug 520482:  Advertise POPCNT on x86 via CPUID

VEX/priv/guest_x86_helpers.c: Add popcnt to the
current "max" cpuid helper ssse3 just
unconditionally as a followup to bug 271615.

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

8 weeks agodocs FAQ: update gmane and add a bit on Stack Overflow.
Paul Floyd [Mon, 25 May 2026 14:02:40 +0000 (16:02 +0200)] 
docs FAQ: update gmane and add a bit on Stack Overflow.

The gmane part was simply out of date. For SO I tried really hard not
to be rude about the quality of the reviewing.

8 weeks agoRegtest arm64: remove none filter_nan
Paul Floyd [Sat, 23 May 2026 05:39:30 +0000 (07:39 +0200)] 
Regtest arm64: remove none filter_nan

Handle printing "-nan" in simd.c rather than using a filter. Also use builtins
to generate inf and nan values as it is more reliable.

8 weeks agoUse helper functions to print double +/- inf/nan for amd64 fxtract and bug132918...
Paul Floyd [Sat, 23 May 2026 05:11:34 +0000 (07:11 +0200)] 
Use helper functions to print double +/- inf/nan for amd64 fxtract and bug132918 testcases

These are the last two x86/amd64 testcases with printf inf/nan issues.

8 weeks agoRemove VEX/test
Florian Krohm [Fri, 22 May 2026 20:08:50 +0000 (22:08 +0200)] 
Remove VEX/test

The snippets there are not suitable for testsuite integration.
Some compile with warnings or not at all (x87fxam.c, x87tst.c),
fpucw.c has no meaningful output. The remaining ones test x87
FPU state save / restore by dumping the state as hex bytes. That
would result in several .exp files because FPU state contains
instruction and data addresses.

8 weeks agoUse helper functions to print double +/- inf/nan for x86 fxtract testcase
Paul Floyd [Fri, 22 May 2026 19:06:53 +0000 (21:06 +0200)] 
Use helper functions to print double +/- inf/nan for x86 fxtract testcase

Similar to recent commit for sse4 testcases

8 weeks agoBug 513165 - Update zstd to 1.5.7
Julien Floyd [Sun, 3 May 2026 11:03:08 +0000 (13:03 +0200)] 
Bug 513165 - Update zstd to 1.5.7

This was done following the README_DEVELOPERS zstd upgrade guide, I copied the
new version of zstd and did a 3 way merge to avoid conflicts.

8 weeks agoUse helper functions to print double +/- inf/nan for sse4 testcase
Mark Wielaard [Fri, 22 May 2026 05:39:56 +0000 (07:39 +0200)] 
Use helper functions to print double +/- inf/nan for sse4 testcase

Different libc printf implementations can have different ways to print
plus/minus nan/inf values. Add a print_double wrapper that checks
whether the double value is a nan, inf and whether it has a positive
or negative signbit. Similarly add a print_float wrapper. This way
we don't need any alternative .exps or filters.

8 weeks agonone/tests/{x86,amd64}/Makefile.am: Move fb_test headers in noinst_HEADERS
Mark Wielaard [Thu, 21 May 2026 12:36:26 +0000 (14:36 +0200)] 
none/tests/{x86,amd64}/Makefile.am: Move fb_test headers in noinst_HEADERS

8 weeks agoBug 271615: Unhandled instruction "popcnt" (x86)
Martin Cermak [Thu, 21 May 2026 11:20:59 +0000 (13:20 +0200)] 
Bug 271615: Unhandled instruction "popcnt" (x86)

VEX/priv/guest_x86_toIR.c: POPCNT decoder authored by
                           Thomas.Eschenbacher@gmx.de
none/tests/x86/sse4-x86.c: Test coverage
none/tests/x86/sse4-x86.stdout.exp: ditto
none/tests/sse4-common.h: ditto

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

2 months agoFreeFSD regtest: update none x86/sse4-x86 expected
Paul Floyd [Thu, 21 May 2026 06:34:07 +0000 (08:34 +0200)] 
FreeFSD regtest: update none x86/sse4-x86 expected

2 months agoAdd PACKUSDW SSE4.1 support for x86
Mark Wielaard [Thu, 5 Mar 2026 17:49:32 +0000 (18:49 +0100)] 
Add PACKUSDW SSE4.1 support for x86

Add handling of PACKUSDW to VEX/priv/guest_x86_toIR.c based on the
guest_amd64_toIR.c implementation. Handle Iop_QNarrowBin32Sto16Ux8
using h_generic_calc_QNarrowBin32Sto16Ux8 in VEX/priv/host_x86_isel.c.

Move test_PACKUSDW from none/tests/amd64/sse4-64.c to
none/tests/sse4-common.h and add the same test to
none/tests/x86/sse4-x86.c with new PACKUSDW output in stdout.exp.

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

2 months agoVEX/test: Remove various files.
Florian Krohm [Wed, 20 May 2026 21:39:40 +0000 (23:39 +0200)] 
VEX/test: Remove various files.

Either boring, or not suitable for integration into the testsuite
or redundant.

2 months agoAdd SSE4.1 PEXTRD instruction for x86 32 bit
Alexandra Hájková [Thu, 30 Apr 2026 14:44:27 +0000 (10:44 -0400)] 
Add SSE4.1 PEXTRD instruction for x86 32 bit

Support pextrd instruction in guest_x86_toIR.c and
host_x86_isel.c. Add test function to sse4-common.h
and update none/tests/x86/sse4-x86.c to test the
instruction.

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

2 months agoAdd fb_test header files to none/tests/x86/Makefile.am EXTRA_DIST
Mark Wielaard [Tue, 19 May 2026 17:10:21 +0000 (19:10 +0200)] 
Add fb_test header files to none/tests/x86/Makefile.am EXTRA_DIST

Add fb_test_i386.h, fb_test_i386_shift.h and fb_test_i386_muldiv.h.
Fixes make distcheck.

2 months agoTestcase none/tests/x86/fb_test_i386.c: disable test_fenv
Florian Krohm [Mon, 18 May 2026 21:16:45 +0000 (23:16 +0200)] 
Testcase none/tests/x86/fb_test_i386.c: disable test_fenv

Results differ depending on compiler version.

2 months agofree_aligned_sized: improve error message for alignment mismatch
Paul Floyd [Sun, 17 May 2026 10:42:26 +0000 (12:42 +0200)] 
free_aligned_sized: improve error message for alignment mismatch

Previously if the allocation used default alignment then
the error message used 0 for the allocation alignment.
Now it says "default-aligned".

2 months agoRegtest: add a test for C23 free_sized and free_aligned_sized
Paul Floyd [Sun, 17 May 2026 09:40:02 +0000 (11:40 +0200)] 
Regtest: add a test for C23 free_sized and free_aligned_sized

With Fedora 44 these are now generally available.

2 months agoNew test none/tests/x86/fb_test_i386.c
Florian Krohm [Sat, 16 May 2026 20:31:17 +0000 (20:31 +0000)] 
New test none/tests/x86/fb_test_i386.c

This is essentially VEX/test/test-i386* with various fixes.
The md5sum code in fb_test_i386.c was copied verbatim from
none/tests/amd64/fb_test_amd64.c.

2 months agoVEX/test: Remove test-amd.[ch] and included header files.
Florian Krohm [Thu, 14 May 2026 21:07:22 +0000 (21:07 +0000)] 
VEX/test: Remove test-amd.[ch] and included header files.

This test has already been integrated as "none/tests/amd64/fb_test_amd64.c"

2 months agoBug 487418 - [arm64] Cleanup M{SR,RS} instructions (part 2)
Paul Floyd [Sat, 16 May 2026 09:16:36 +0000 (11:16 +0200)] 
Bug 487418 - [arm64] Cleanup M{SR,RS} instructions (part 2)

Extracts system register shift and mask macros to a new VEX public
header libvex_guest_arm64_sysregs.h

These macros are used in both VEX dirty helpers and coregrind
VG_(machine_get_hwcaps).

Mostly this is just refactoring the code. It should be more robust
in the face of changes concerning future ARM CPU features. The
id_aa64pfr0_el1 dirty helper has changed a bit - the code was wrong
but the output was right (for what we currently support).

2 months agoRemove VEX/switchback
Florian Krohm [Thu, 14 May 2026 16:22:54 +0000 (16:22 +0000)] 
Remove VEX/switchback

The code does not compile since 56e04256a7a and hasn't been used in a
long time.

2 months agoRemove VEX/unused
Florian Krohm [Thu, 14 May 2026 15:57:56 +0000 (15:57 +0000)] 
Remove VEX/unused

20 years of being unused are enough.

2 months ago.gitignore: VEX related changes
Florian Krohm [Mon, 11 May 2026 22:09:17 +0000 (22:09 +0000)] 
.gitignore: VEX related changes

2 months agoReformat README.freebsd for an 80 wide terminal
Paul Floyd [Mon, 11 May 2026 18:51:43 +0000 (20:51 +0200)] 
Reformat README.freebsd for an 80 wide terminal

2 months agotestcases: Cleanup garbage.filtered.out
Florian Krohm [Sun, 10 May 2026 17:59:59 +0000 (17:59 +0000)] 
testcases: Cleanup garbage.filtered.out

2 months agoTweak .gitignore
Florian Krohm [Thu, 7 May 2026 08:27:44 +0000 (08:27 +0000)] 
Tweak .gitignore

Forgotten in 8221f8f3842a75632060f1ba83339ee28a091882

2 months agoarm64: change configure dotprod test to a run test
Paul Floyd [Sun, 10 May 2026 13:10:58 +0000 (15:10 +0200)] 
arm64: change configure dotprod test to a run test

We were testing for dotprod with AC_COMPILE_IFELSE. That's wrong, it just
checks that the compiler accepts -march=armv8.2-a+dotprod and that the
assembler handles dotprod opcodes. Changed it to AC_RUN_IFELSE which
additionally checks that the binary runs. Valgrind should be checking
for this in VG_(machine_get_hwcaps), storing it in VexArchInfo and
checking it in guest_arm64_toIR.c (it looks like we check it but don't
store 'dp' in vai.hwcaps and in general VEX doesnt check whether it
should try to decode these extensions).

2 months agoBug 391311 - [Patch] Fix arm64 valgrind tests compilation with clang
Paul Floyd [Sun, 10 May 2026 10:47:18 +0000 (12:47 +0200)] 
Bug 391311 - [Patch] Fix arm64 valgrind tests compilation with clang

This fixes the last part of the issues - CPUs with and without
crypto support. Rather than just fix building tests this splits
the crypto part out of fp_and_simd.c into a new file, v8crypro.c

2 months agoarm64: add a configure check for crypto support
Paul Floyd [Sun, 10 May 2026 07:34:19 +0000 (09:34 +0200)] 
arm64: add a configure check for crypto support

This is related to https://bugs.kde.org/show_bug.cgi?id=391311
In the patch for that bugzilla item there is a build time fix.
Without the crypto tests the test will fail.

If there are no issues with this configure test I'll split off a new
test v8crypto from fp_and_simd.

2 months agoRegtest: remove duplicate break from iropt-test/unary.c
Paul Floyd [Sat, 9 May 2026 19:34:26 +0000 (21:34 +0200)] 
Regtest: remove duplicate break from iropt-test/unary.c

Louis Brunner fixed this and I noticed the diff so merging
it upstream.