ZTS: stop zpool_initialize tests racing initialize to completion
zpool_initialize_import_export and zpool_initialize_suspend_resume start
initializing a one-disk pool, wait a fixed couple of seconds, and then
expect initializing to still be running so it can be observed across an
export/import and suspended. On a small or fast vdev the default 1 MiB
initialize chunk lets the whole disk finish within that window, after
which "zpool initialize -s" fails with "there is no active
initialization" and the test fails.
Throttle initializing with zfs_initialize_chunk_size, exactly as the
zpool_wait_initialize_* tests already do, so it stays active long enough
to observe regardless of vdev size or speed. The tunable is saved and
restored per test. Cleanup destroys the pool before restoring the chunk
size: the initialize thread rereads zfs_initialize_chunk_size on every
write but allocates its fill buffer once at the smaller size, so raising
it back while the thread is still running would issue a write larger
than that buffer.
[13 lines not shown]
ZTS: migration/setup: clear stale zfs_member label before new_fs
During a full ZTS run functional/migration/setup fails intermittently
when it mounts the non-ZFS device. That device is often one an earlier
test used as a pool vdev. 'zpool destroy' leaves the vdev labels in
place and new_fs only overwrites the front of the device, so the
trailing labels can survive. libblkid then probes the device as
ambiguous (both the new filesystem and zfs_member) and the
auto-detecting mount refuses, which setup reports as a spurious failure.
Wipe any residual signatures with wipefs before laying down the new
filesystem so the device carries a single, unambiguous type, and let
udev settle before the mount. Skip the wipe in the single-disk case,
where the non-ZFS device is the same one the test pool was just created
on, so the live pool is left untouched.
Verified on Linux: after a pool create and destroy the scratch device
still carries a zfs_member label (blkid -p reports zfs_member); a
wipefs -a removes it so the following new_fs is the only signature and
[6 lines not shown]
AMDGPU: Migrate Analysis/Transforms tests to amdgpu subarch triple (3) (#208811)
Continue migrating command-line target spelling on RUN lines to the
folded amdgpu subarch triple form, covering more Transforms tests.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
[Clang] Adjust assert in addUnsizedArray to check Base is set before … (#208112)
In addUnsizedArray we attempt to check the type of Base in an assert but
don't verify if it set before doing so. This can lead to a crash, check
Base is set before checking its type and add a regression test.
Fixes: https://github.com/llvm/llvm-project/issues/44212
[Clang] [C++26] Expansion Statements (Part 2: Parsing and Parser Tests) (#169681)
This patch implements parsing of expansion statements and expansion
initialiser lists. I’ve also had to implement sema for
`CXXExpansionStmtDecl` because parsing doesn’t really work without that
node.
[libc] Implement fast date conversion algorithm of Ben Joffe (#208312)
Replaced the loop-based year/month/day extraction in update_from_seconds
with Ben Joffe's "Very Fast 64-bit" date algorithm using multiply-shift
division (4 multiplications, 0 hardware divisions). Also replaced the
mktime inverse with Ben Joffe's inverse date algorithm.
Updated is_leap_year to use the Drepper-Neri-Schneider algorithm (% 25
instead of % 100). Replaced the O(n) yday month-length loop with a
constant-time cumulative-days table lookup.
Uses UInt128 for portable 128-bit support across 64-bit (native) and
32-bit (software fallback) targets.
Raman's benchmarks on x86-64 show a ~13% wall-time improvement:
Before: real 2.215s, user 2.214s
After: real 1.919s, user 1.913s
[7 lines not shown]
[cmake] Fix VSINSTALLDIR check in FindDIASDK module (#208524)
elseif($ENV{VSINSTALLDIR}) expands the env value into the condition,
where CMake treats it as an undefined variable, so the branch is always
false. Fix this by testing if the env variable is defined instead.
zfs bookmark: add recursive (-r) bookmark creation
"zfs snapshot -r" and "zfs destroy -r" already operate recursively, but
there was no way to create bookmarks for a recursive snapshot in one
step, so users had to script a loop over every dataset.
Add a -r flag to "zfs bookmark" that, given a snapshot source, creates
a bookmark of that snapshot on every descendant dataset that has it.
Descendants that lack the snapshot (for example one created after the
recursive snapshot) or that are still inconsistent are skipped instead
of failing the whole request, mirroring how "zfs snapshot -r" gathers
its targets. The pairs are submitted to lzc_bookmark() in a single
call and any per-dataset failures are reported individually. The -r
flag requires a snapshot source; a bookmark source is rejected.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: MorganaFuture <103630661+MorganaFuture at users.noreply.github.com>
Closes #9460
Closes #18763
[ELF] Fix TLS GD against non-preemptible dynamic symbols in DSOs (#207881)
Consider a DSO that uses TLS GD against a dynamic non-preemptible symbol
(e.g. protected, or linked with -Bsymbolic). The expected meaning of
this is to always reference the DSO's own TLS segment for that symbol,
regardless of any attempts to preempt it at load time, and LLD will
indeed emit a constant offset rather than a symbolic DTPOFF relocation
for the second GOT word. However, for the first GOT word, because we
currently only treat the isLocalInExecutable case as special (where the
module index is 1), we end up creating a symbolic DTPMOD relocation,
rather than a non-symbolic (i.e. against the null symbol) one to get
this DSO's index, and so any load-time preemption will cause us to use a
different module's TLS block. As a result, not only do we have symbol
preemption when we shouldn't, but also the two halves of the TLS GD GOT
entry end up inconsistent, using the offset of the symbol in this
module's TLS block for a different module's.
Fix this by breaking down the two !isLocalInExecutable cases, emitting
the expected non-symbolic DTPMOD relocation for any non-preemptible
[15 lines not shown]
[AggressiveInstCombine] Support alternate deBruijn log2 table that isolates the MSB before the multiply. (#208532)
The existing deBruijn log2 match expects the multiply input to be a mask
that has all bits below the most significant set bit to be 1.
There is an alternate form in some programs where this mask is modified
to isolate the MSB by doing (mask - (mask >> 1)). A cttz table is then
used instead of a log2 table.
This patch teaches tryToRecognizeTableBasedLog2 to match this form too.
I think there's still some additional work needed elsewhere to recognize
that the sub+select in the output can be done with not+and.
Fixes #207571
Assisted-by: Claude
[Github] Make ids-check workflow use container (#208780)
4bf0737d68bbb86d9d693e96a94c4175f27acebe introduced a container for this
to enable the use of a PGO optimized compiler and to bake the idt build
into the container. This patch updates the workflow to use it.
AMDGPU: Migrate Analysis/Transforms tests to amdgpu subarch triple (1) (#208809)
Mechanically migrate the command-line target spelling on RUN lines from
-mtriple=amdgcn ... -mcpu=<gfx> to the folded subarch triple form (e.g.
-mtriple=amdgpu9.00-amd-amdhsa), dropping the redundant -mcpu.
This first batch covers Analysis and Transforms tests. Tests whose
output materially depends on -mcpu (e.g. opt runs that record a target-cpu
attribute, or cost-model tests whose default subtarget differs) are left for
separate handling. This begins a series of ~62 PRs covering backend tests.
Co-Authored-By: Claude <noreply at anthropic.com> (Claude-Opus-4.8)
[SystemZ][z/OS] Add options -m[no-]zos-ppa1-name to remove the function name in PPA1. (#207416)
This PR adds a pair of flag options `-m[no-]zos-ppa1-name` to clang,
which controls whether the function name is emitted in PPA1 on z/OS.
[flang][OpenMP] Support lowering of metadirective (part 3)
Enable lowering of metadirectives that resolve to a loop-associated
variant such as `do`, `simd`, `parallel do`, and `do simd`. The
associated DO construct is made available to the selected variant so the
existing OpenMP loop lowering can process it. A standalone metadirective
uses the following sibling DO, and a begin/end metadirective uses the
first substantive evaluation nested in its block.
For example, when the `vendor(llvm)` selector matches, the `parallel do`
variant is lowered together with the DO loop that follows it:
```fortran
!$omp metadirective when(implementation={vendor(llvm)}: parallel do)
do i = 1, n
y(i) = a*x(i) + y(i)
end do
```
[30 lines not shown]
[clang] Use a 128-byte destructive interference size on Apple AArch64 (#208716)
Apple arm64 cores use a 128-byte cache line, as reported by `sysctl -a`.
However, Clang inherited the generic AArch64 value and was setting
`__GCC_DESTRUCTIVE_SIZE` to 256 for Apple targets (see bce2cc15133a).
While the value of 256 matches what GCC uses and is what's documented by
ARM, 128 seems to be a better value for Apple arm64 specifically, with
256 simply being wasteful.
Note that changing this value should in principle not be an issue since
it (and constructive interference) are explicitly documented as being
"ABI unstable" values, in the sense that users should not rely on them
in ABI-sensitive places.
Fixes #182951
hwpstate_intel(4): Introduce a CPU ID cache
To minimize the diff with hwpstate_intel(4). See previous commit there
for the rationale.
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
hwpstate_amd(4): Restore CPU ID cache after introducing cpu_get_pcpuid()
Using cpu_get_pcpuid() directly or having a CPU ID cache does not really
make any significant difference. With cache: Less function calls, less
space on stack, but an additional allocation in the softc, who stays
permanently. Without cache: Some function calls, but one less slot in
the softc, and no data duplication (but that info never changes).
The main reason for this change is to reduce conflicts with some
work-in-progress by aokblast@.
While here, move the check that a per-CPU structure is provided by the
bus from the attach to the probe method, as it is already used by
hwpstate_probe_pstate() there.
Reviewed by: aokblast
Sponsored by: The FreeBSD Foundation
ice(4): Add support for 40G maximal PMD speed
E823 backplane devices may support 40G as maximal PMD speed.
Extend port topology reading logic to handle this case.
While at that fix indentation according to FreeBSD style(9).
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>
Tested by: gowtham.kumar.ks_intel.com
Approved by: kbowling (mentor), erj (mentor)
Sponsored by: Intel Corporation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53587
(cherry picked from commit c6212b7da110d82b1d0086ec525deb216993021e)
[Clang][Driver][NFC] Fix offload-parallel-device-cc1.cu failing in read-only runfiles sandbox (#208801)
When running offload-parallel-device-cc1.cu with multiple
--cuda-gpu-arch
flags and --cuda-device-only -S, Clang generates multiple .s outputs in
the
current working directory (.). In sandboxed test environments, . is
read-only,
causing compilation to fail with "Permission denied".
Fix by executing the CUDA compilation step inside a temporary directory
(%t).
This pattern is being used in other tests like in
clang/test/Driver/ftime-trace-offload.cpp and
clang/test/Driver/unix-conformance.c.
ice(4): Fix link speed after changing cable type
When interface was connected to a link partner with a cable
type limitting maximum supported speed, e.g. SFP+ cable
in 25G port, driver incorrectly saved a supported speed
as the user configured speed. This prevented interface
from using all supported speeds after switching cable to SFP28.
Link was established at 10G as supported by previously used
SFP+ cable. Don't set user requested speed unless actually
configured by an user, to allow automatic selection of highest
available speed. Only when user sets custom config
using advertise_speed sysctl save it and try
to apply after cable is changed.
Also don't save initial supported speeds if FW supports
reporting default PHY config.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>
[5 lines not shown]
ice(4): Add support for new E810-XXV-2 adapters
Add two new subdevice IDs for E810-XXV-2 and E810-XXV-2 for OCP 3.0.
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>
Reviewed by: kbowling, erj, mateusz.moga_intel.com
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D54069
(cherry picked from commit bea6f7d02dfbef8f8209f0ca5f1d76877d549f46)
ice(4): Add support for 40G maximal PMD speed
E823 backplane devices may support 40G as maximal PMD speed.
Extend port topology reading logic to handle this case.
While at that fix indentation according to FreeBSD style(9).
Signed-off-by: Krzysztof Galazka <krzysztof.galazka at intel.com>
Tested by: gowtham.kumar.ks_intel.com
Approved by: kbowling (mentor), erj (mentor)
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D53587
(cherry picked from commit c6212b7da110d82b1d0086ec525deb216993021e)
[SSAF][WPA] Operator new/delete overload entities that shall retain their types (#208342)
A follow-up change to #206600. This commit adds the WPA implementation
for those operator new/delete overload entities that shall retain their
types. This WPA result will later be used to filter unsafe buffer
analysis results.
rdar://179151541
Assisted by Claude Sonnet 4.6