zoned_uid: print as integer, reject out-of-range uids
The zoned_uid property is registered as a plain number property, so
libzfs formatted it with zfs_nicenum() and parsed it with
zfs_nicestrtonum(). As a result:
# zfs set zoned_uid=1500 tank/fs
# zfs get -H -o value zoned_uid tank/fs
1.46K
and values that do not fit in a uid_t were accepted, then silently
truncated by the (uid_t) casts in zfs_prop_set_special(), delegating
the dataset to an unintended user namespace owner:
# zfs set zoned_uid=4294968296 tank/fs # delegated to uid 1000
# zfs set zoned_uid=4G tank/fs # delegated to uid 0
pbkdf2iters is a count, not a size, but likewise accepted size
suffixes (pbkdf2iters=150K became 153600 iterations).
[17 lines not shown]
ZTS: test zoned_uid and pbkdf2iters numeric parsing
Extend zoned_uid_001_pos to check that zoned_uid is displayed as a
plain integer, and zoned_uid_005_neg to check that values which do
not fit in a uid_t, (uid_t)-1, and values with size suffixes are
rejected. Extend zfs_change-key_pbkdf2iters to check that an
iteration count with a size suffix (150K) is rejected.
These currently fail: a zoned_uid of 1500 is displayed as "1.46K",
values such as 4294968296 or 4G are accepted and silently truncated
(to uid 1000 and uid 0), and pbkdf2iters=150K is accepted as 153600.
The fix follows in the next commit.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Colin K. Williams <colin at li-nk.org>
Signed-off-by: Will Rouesnel <wrouesnel at wrouesnel.com>
Closes #19297
[BPF] Extend BTF vlen to 24 bits and kind to 7 bits (#237620)
The Linux kernel recently extended the BTF info encoding to use the
previously unused bits [1]:
- vlen is extended from 16 bits (bits 0-15) to 24 bits (bits 0-23), so
the max vlen grows from 0xffff to 0xffffff.
- kind is extended from 5 bits (bits 24-28) to 7 bits (bits 24-30), so
up to 128 kinds can be encoded.
The vlen extension is needed by BTF location information (e.g. inline
sites), which can exceed 65535 entries. The kind extension leaves room
for new BTF kinds, as the current limit of 32 is close to being reached.
Update LLVM to match:
- BTF::MAX_VLEN is changed to 0xffffff. Structs/unions, enums and func
protos with more than 65535 members/params, which were previously
skipped in BTF generation, are now emitted. This is consistent with
libbpf, which also uses the new 24-bit limit.
- CommonType::getKind() and CommonType::getVlen() use the new masks, so
[8 lines not shown]
[PassBuilder] Run LoopUnrollAndJam before the vectorizers
LoopUnrollAndJam runs after LoopVectorize, which splits a vectorized
inner loop into a vector and a remainder loop. UnrollAndJam can't
handle that form, so most candidates are out of reach by the time it
runs. Move it to the start of addVectorPasses, which also covers the
full LTO pipeline. The pass is still only added under
-enable-unroll-and-jam.
With this change running over llvm-test-suites. We observe a speedup
over my Ryzen 9 9955HX in some cases (Shootout-C++-ary3 (-34.6%),
oopack_v1p8 (-6.0%)).
Assisted by: Claude # Testcases
[LoopUnrollAndJam] Jamming Outside Loop for stencil
Previously, we only tried to jam the loop if there was any
loop-invariant memory usage. This makes our UnrollAndJam quite
limited. GCC (gimple-loop-jam.cc) also handles stencils. What they do
is, for each MemRef pair, check the distance vector and allow jamming
if the vector is lexicographically positive.
Our safety checker (checkDependency) already allows these cases. To
match GCC's behavior, we try to calculate the actual step for each
memory usage using SCEV and find the maximum ReuseCount. Note that our
safety checker has already guaranteed that this is a forward edge, so
we don't need any additional safety checks here.
Assisted by: Claude # Testcases
ZTS: scope uncached dbuf counts to the test dataset
Object numbers can recur in other datasets and pools. Filter by the
pool and objset as well, so unrelated cached dbufs cannot satisfy or
fail the uncached I/O assertions.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Giuseppe Piscitelli <ooonea at gmail.com>
Assisted-by: OpenAI Codex
Closes #19615
ZTS: wait for the zvol probe after the errata write
Closing the writable zvol triggers a udev probe that can hold the pool
busy during export. Wait for it with the existing block_device_wait
helper after the write, keeping the export assertion unchanged.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Will Rouesnel <wrouesnel at wrouesnel.com>
Signed-off-by: Giuseppe Piscitelli <ooonea at gmail.com>
Co-authored-by: Will Rouesnel <wrouesnel at wrouesnel.com>
Assisted-by: OpenAI Codex
Closes #19616
[AMDGPU][Doc] Add documentation about ABI occupancy
This PR introduces ABI occupancy in documentation. The actual code
implementation will be in follow-up PRs.
gcc120,gcc80: Reuse COMPILE.cc to avoid duplicating explicit rules
Make use of COMPILE.cc from <sys.mk> to avoid duplicating explicit rules
(in particular the various flags) in libstdc++/components/libconv_2011.
In addition, create a ".USE" reusable rule to further reduce duplicate
code.
bsd.sys.mk: Adjust -Wno-unused-value for WARNS level
Without this adjustment, building gnu/usr.bin/gdb/libdecnumber with
WARNS=2 would fail with the -Werror=unused-value warning, but with
WARNS=3 the building would succeed.
Discussed-with: swildner
gcc120,gcc80: Get rid of duplicate explicit compile rules
Make use of the new features implemented in the last commit.
Actually, this fixed one mistake in gcc80/libgcc that the 'raise'
flags group was ignored, because the explicit compile rules didn't refer
to the group flags. Luckily, the build result was good; md5 checksums
of the libraries don't change.
stand/pxeldr_tftp: Remove obsolete AFLAGS
Two reasons:
- AFLAGS is not used by the .S suffix rule; should use CFLAGS instead.
- This is no longer needed after the commit
6c644be32975767831a57868196e63523af13989 that collapsed makefile with
parent to avoid duplication.
gnu/lib: Add missing WARNS to gcc120 and gcc80
Note that the following libraries require WARNS=0:
- gcc80/libstdc++/components/libconv_supc
- gcc120/libstdc++/components/libconv_1998
- gcc120/libstdc++/components/libconv_supc
ZTS: remove TESTDIR after the cache tests
cache.cfg puts the group's vdev files in $VDIR and $VDIR2, under
$TESTDIR. setup.ksh creates both with mkdir -p, which also creates
$TESTDIR, but cleanup.ksh removes only $VDIR and $VDIR2, and none of
the group's tests removes $TESTDIR or calls default_cleanup. An empty
testdir directory is therefore left in the test directory after
zfs-tests.sh -T cache, or -t with any of its tests, unless a later
group's cleanup removes it. Remove $TESTDIR, which holds both, as
default_cleanup does.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19652
ZTS: remove TESTDIR after the l2arc tests
l2arc.cfg puts the group's vdev files in $VDIR, $TESTDIR/disk.l2arc.
setup.ksh creates it with mkdir -p, which also creates $TESTDIR, but
cleanup.ksh removes only $VDIR, and none of the group's tests removes
$TESTDIR or calls default_cleanup. An empty testdir directory is
therefore left in the test directory after zfs-tests.sh -T l2arc, or
-t with any of its tests, unless a later group's cleanup removes it.
Remove $TESTDIR, which holds $VDIR, as default_cleanup does.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19652
ZTS: remove TESTDIR1 after removal_condense_export
removal_condense_export.ksh sets up its pool with a container
filesystem mounted at $TESTDIR1, but its cleanup only calls
default_cleanup_noexit, which removes $TESTDIR and not $TESTDIR1, so
an empty testdir1 directory is left in the test directory after every
run. Remove it as default_container_cleanup does.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19652
ZTS: restore zfs_remove_max_segment in removal_multiple_indirection
removal_multiple_indirection.ksh lowers zfs_remove_max_segment to
32K and its cleanup sets it back to 1M, which is not the default: the
module starts with SPA_MAXBLOCKSIZE (16M). Every test that runs after
it in the same module load, the rest of the removal group included,
therefore removes devices in 1M segments. Save the value the test
found and restore that.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19652
ZTS: remove vdevs_in_pool's temporary file when a vdev is missing
vdevs_in_pool() saves the pool's config to a file from mktemp and
returns 1 as soon as one of the vdevs it looks for is missing, before
it removes that file. Every log_mustnot vdevs_in_pool, which the
removal, pool_checkpoint and zpool_add tests use to check that a vdev
has left the pool, therefore leaves one file behind.
On a Debian 13 VM, zfs-tests.sh -T zpool_add left nine such tmp.*
files in the test directory, all written while zpool_add_001_pos to
zpool_add_009_neg ran. Remove the file before returning 1 too.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19652
ZTS: end zpool_add_warn_removal with log_pass
zpool_add_warn_removal.ksh has no log_pass, so it falls off its end
and exits 0. The runner records a PASS, but the cleanup registered
with log_onexit only runs from log_pass or log_fail, so the loop
device that zpool_create_add_setup attaches to vdev4 and the files
vdev0 to vdev9 are left behind after every passing run.
On a Debian 13 VM, after zfs-tests.sh -T zpool_add passed all of its
tests, /dev/loop3 was still attached to vdev4 and vdev0 to vdev9
were still present; the test's log ends without the "Performing
local cleanup via log_onexit" line that its two siblings print.
zpool_add_warn_create and zpool_add_warn_degraded use the same setup
and cleanup and end with the same log_pass, which this adds.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19652
[ORC] Export perf JIT loader wrapper symbols with LLVM_ALWAYS_EXPORT
PerfSupportPlugin resolves llvm_orc_registerJITLoaderPerf{Start,End,Impl} dynamically from process symbols, which fails when static executables are built with -fvisibility=hidden (e.g. CFI bootstrap builds).
Assisted-by: Gemini
[cfi] Ignore cfi-icall on LLVMContext::yield and JIT calls
LLVMContextSetYieldCallback casts a C callback with a mismatched pointer type, and ExecutionEngine / JIT tools invoke runtime-generated JIT code outside the link-time CFI jump table.
Assisted-by: Gemini
tests/sys/netinet/tcp_socket: fix build with ATF 0.22+
Confirm that creating clients/sockets was successful by testing the
result separate from the assignment and test that the return value is
not -1 instead of testing that the value returned is non-zero.
This fixes the build with [ATF 0.22+][1].
MFC after: 2 weeks
Reported by: clang (-Wparenthesis)
Reviewed by: tuexen, cc
Differential Revision: https://reviews.freebsd.org/D59284
[1]: https://github.com/freebsd/atf/pull/72
Conflicts:
tests/sys/netinet/tcp_implied_connect.c
(cherry picked from commit 4aea6ea2eb400737837ff8d22c25688f88c7966c)