Mark [Sat, 17 Jan 2026 16:22:59 +0000 (17:22 +0100)]
Add support for fnop instruction on x86 and amd64
This implements FNOP in guest_amd64_toIR.c and guest_x86_toIR.c by
simply skipping the instruction. Which is OK for now since one of the
x87 FP Limitations is no FP exceptions, except for handling stack
over/underflow.
Add fnop to none/tests/{amd64,x86}/insn_fpu.{def,stdout.exp}.
Also update old 3_1_BUGSTATUS.txt to correct bug number.
Florian Krohm [Thu, 15 Jan 2026 20:16:08 +0000 (20:16 +0000)]
Update s390-check-opcodes.pl
Remove the --check-formats option. The specialisation of opcode names in
<binutils>/opcode/s390_opc.txt is no longer interesting as we do not need
to distinguish whether a register number in an opcode denotes a GPR od FPR
or whatever.
Instead it is better to use those opcode format names as shown in the
Principles of Ops wherever possible. Simplifies proofreading.
Florian Krohm [Thu, 15 Jan 2026 11:10:30 +0000 (11:10 +0000)]
s390: Remove s390_format_RIL and friends.
This patch removes the functions: s390_format_RIL, s390_format_RIL_RU,
s390_format_RIL_RI, s390_format_RIL_RP and s390_format_RIL_UP.
Cf. fa21e88ac38 for a rationale.
Florian Krohm [Thu, 15 Jan 2026 10:08:59 +0000 (10:08 +0000)]
s390: Remove s390_format_RRE and friends.
This patch removes the functions: s390_format_RRE, s390_format_RRE_RR,
s390_format_RRE_FF, s390_format_RRE_RF, s390_format_RRE_FR,
s390_irgen_RRE_R0 and s390_irgen_RRE_F0.
Cf. fa21e88ac38 for a rationale.
Florian Krohm [Thu, 15 Jan 2026 09:19:10 +0000 (09:19 +0000)]
s390: Remove s390_format_RR and friends.
This patch removes the functions: s390_format_RR, s390_format_RR_RR
and s390_format_RR_FF.
First, because of the disassembly changes in 370531396ad there is no
longer a need to specialise s390_format_RR because the register class
of its operands is now irrelevant. Hence s390_format_RR_RR and
s390_format_RR_FF can go.
Secondly, s390_irgen_RR only calls the function pointer being passed in.
So we can call that function directly and s390_irgen_RR can go as well.
The same reasoning also applies to other opcode formats. Patches will
follow soon. Having several installments gives a chance to actually
proofread them.
Florian Krohm [Sun, 11 Jan 2026 17:54:59 +0000 (17:54 +0000)]
vg_regtest: Miscellaneous tweaks
Drop the requirement that there must be at least one .stderr.exp
file. That way we can eliminate some 440 empty stderr.exp files and
a few stderrB.exp files.
Drop the requirement that there must be a "filter_stderr" script.
If there is nothing to filter (e.g. iropt-test) a filter script is
not meaningful. In that is so desired, specify an empty stderr_filter
and stderrB_filter in the .vgtest file.
Paul Floyd [Sat, 10 Jan 2026 14:53:43 +0000 (15:53 +0100)]
regtest: undo changes to str_tester as a workaround for darwin checked functions
I had added parens to force the use of the function rarther than a
macro expanding to the _chk version. The _chk functions are now wrapped
so no longer need to keep the workaround.
Mark Wielaard [Wed, 7 Jan 2026 21:20:49 +0000 (22:20 +0100)]
Disable linux madvise MADV_GUARD_INSTALL
glibc 2.42+ (with linux 6.13+) uses MADV_GUARD_INSTALL to setup stack
guard pages. valgrind currently isn't able to track this and such
guard pages also don't show up in /proc maps (only in /proc pagemap
since linux 6.14). For now valgrind fails a madvise MADV_GUARD_INSTALL
syscall with EINVAL. This causes glibc to fall back to mprotect
PROT_NONE which valgrind is able to track.
Mark Wielaard [Sat, 3 Jan 2026 13:08:08 +0000 (14:08 +0100)]
VEX: Fix srcdir != builddir build
commit 370531396ad1 ("s390: Use objdump machinery to disassemble insns")
broke srcdir != builddir builds with:
../../../VEX/priv/objdump/s390-dis.c:26:10: fatal error: main_util.h: No such file or directory
26 | #include "main_util.h" // vex_strlen
| ^~~~~~~~~~~~~
This comes from including the "wrong" priv directory for main_util.h
in Makefile.vex.am. Fix this by adding -I$(srcdir)/priv. This was
always wrong but didn't cause issues till now because of the extra
objdump subdir.
Paul Floyd [Fri, 26 Dec 2025 13:20:34 +0000 (14:20 +0100)]
Darwin regtest: ensure no stdout output for memcheck/tests/darwin/deep_badparam
The test was doing a write of an uninit ilocal 32byte char buffer.
This has started outputting junk resulting in a stdout diff. So
make sure that the buffer only contains zeros (but still uninit).
Hope the compiler doesn't get too smart.
Support pmulld (packed multiply 32-bit doubleword integers) 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.
Paul Floyd [Tue, 23 Dec 2025 20:22:17 +0000 (21:22 +0100)]
Darwin mmap: use ARG5 for VG_(di_notify_mmap)
The fix for bug280965 (a long long time ago) changed VG_(di_notify_mmap)
so that instead of opening a new fd to peek at the ELF header it would
reuse the same mmap fd with pread() to avoid resetting fcntl flags.
Except that the patch was applied to mmap in syswrap-generic but not
to the mmap in syswrap-darwin. So the problem remained there on Darwin
for 14 years.
Paul Floyd [Mon, 22 Dec 2025 09:19:30 +0000 (10:19 +0100)]
Helgrind regtest: add asserts to cond_timedwait_test.c
This test fails on Darwin, It looks like Darwin uses another mutex
and it's complaining that the condition mutex is not locked when
the unlock call is made. I made these changes when checking that the
testcase has the same behaviour on FreeBSD.
Paul Floyd [Fri, 19 Dec 2025 05:58:51 +0000 (06:58 +0100)]
Bug 258140 - Valgrind on OS X always reports some memory "still reachable"
Just needed one more suppression for the minimal test in the bugzilla
item. I expect that there will be a seemingly endless number of leaks
in Darwin (different libs, later versions).
Martin Cermak [Tue, 16 Dec 2025 08:52:29 +0000 (09:52 +0100)]
Wrap new lsm_list_modules syscall
The lsm_list_modules syscall returns a list of the active LSM ids. On
success this function returns the number of @ids array elements. This
value may be zero if there are no LSMs active. If @size is insufficient
to contain the return data -E2BIG is returned and @size is set to the
minimum required size. In all other cases a negative value indicating
the error is returned.
Paul Floyd [Sun, 14 Dec 2025 19:23:10 +0000 (20:23 +0100)]
Darwin DRD: redirs for semaphore functions
Like 2802b31ae644301ee641dcae20d1f84373615d54 for Helgrind.
Use the DRD script supported_sem_init in Helgrind tests that use
semaphores, it's clearer than just using tests/os_test
Paul Floyd [Sun, 14 Dec 2025 17:21:19 +0000 (18:21 +0100)]
Darwin helgrind: redirs for semaphore functions
The semaphore functions are not in the pthread library (similar to FreeBSD).
Change the redirs to use libsystem_kernel.dylib
Unfortunately this doesn't help much. Darwin has deprecated these functions
so the tests will compile (with a warning) but at runtime they all fail
with errors like ENOSYS and EBADF.
Paul Floyd [Sun, 14 Dec 2025 12:31:18 +0000 (13:31 +0100)]
Darwin fdleaks: fix handling of recvmsg cmsg
In the Darwin headers the macro __DARWIN_ALIGN32 is used for
the CMSG macros. We were using just ALIGN which looks like
it uses __DARWIN_ALIGN for 8 byte alignment. Using the
wrong alignment gate a wrong count of fds and check_cmsg_for_fds
was only calling ML_(record_fd_open_named) for one fd. The result
was fd errors when writing to a second fd that should have been
recorded.
Paul Floyd [Sun, 14 Dec 2025 09:05:04 +0000 (10:05 +0100)]
Darwin regtest: update none ioctl_moans
This testcase needs IOCTL_REQUEST_BASE to be set to some bogus
value with the platform dependent "no direction" flag set.
That flag wasn't being set for Darwin and so the testcase was
failing.