[msan] Correctly handle llvm::fake_use (as a no-op) (#229591)
The fake_use intrinsic (used by -fextend-variable-liveness) was being
strictly handled (i.e., check that the parameter is fully initialized),
which led to false positives
(https://github.com/llvm/llvm-project/issues/225425). This patch solves
the issue by silently not instrumenting fake_use, since they are, by
definition, not real uses and therefore cannot lead to
use-of-uninitialized-memory.
Fixes: #225425
[libc][math] Improve accuracy for exp*f float-only implementations. (#227881)
Pure Estrin's scheme pushes the rounding errors a bit more than 1 ULP on
non-FMA targets for these functions.
[SelectionDAG] Add ATOMIC_LOAD_FMAXIMUMNUM/FMINIMUMNUM to SDNode::getOperationName. (#229566)
Reorder the other FP min/max nodes to locally match the order in
ISDOpcodes.h.
[SelectionDAG] Add static_assert for ISD::BUILTIN_OP_END to SDNode::getOperationName to encourage updating when opcodes are added. (#229573)
Also add missing case for DEACTIVATION_SYMBOL.
GlobalISel: Use integer types when splitting loads in lowerLoad (#229544)
lowerLoad built the split pieces using the destination type with the
element size changed, which preserved floating-point types. An
unaligned f64 load was decomposed into G_ZEXTLOAD, G_SHL and G_OR on
f32 and f64, which then crashed in AMDGPU RegBankLegalize. Build the
pieces as integers and bitcast to a non-integer result type, as
lowerStore already does.
The pieces are now consistently integer typed, which allows more
constants to be CSEd in the existing tests.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[CIR] Implement ctor-try-body rethrow (#229436)
This came up in a test suite, but we weren't properly re-throwing
exceptions when they were in the body of a constructor's try-body. This
patch mirrors classic-codegen's behavior reasonably well, implementing
this behavior properly.
Side note: this mirrors classic codegen's behavior of including
dtor-try-bodies too, but that isn't implemented yet, so those will just
be an NYI for now.
[Bazel][mlir] Fixes build failures (#229605)
Fixes build failures following commit 4c520f2ae12f and commit
155462f440ff where ROCDLTargetInfo was introduced and referenced across
ROCDL/AMDGPU passes.
[lldb] Add LanguageRuntime::FixupVariableLocation (NFC) (#229602)
Some languages store a variable in a location whose indirection level is
only known at runtime. Swift, for example, emits resilient globals into
a fixed-size buffer; a value that doesn't fit is boxed on the heap and
the buffer holds a pointer to the box. Whether the value fits depends on
the runtime layout of a type, so the compiler can't encode it in the
DWARF location expression.
This patch adds a LanguageRuntime hook that ValueObjectVariable calls
after evaluating a variable's location, so the runtime can adjust it.
The default implementation does nothing.
Assisted-by: Claude
libzfs: honor literal for vdev fragmentation property
"zpool get -p fragmentation <pool> all-vdevs" printed the value with
a trailing '%', unlike the pool fragmentation property and the vdev
capacity property. Print the bare number when literal is requested.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: George Melikov <mail at gmelikov.ru>
Closes #19222
vdev_prop_get: report real vdev fragmentation
VDEV_PROP_FRAGMENTATION was taken from vd->vdev_stat.vs_fragmentation,
which is never updated: fragmentation is only filled into the copy
returned by vdev_get_stats_ex(). So "zpool get fragmentation <pool>
all-vdevs" always reported 0%.
Report the same values as "zpool list -v": pool fragmentation for the
root vdev, metaslab group fragmentation for top-level concrete vdevs,
and "-" for everything else.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: George Melikov <mail at gmelikov.ru>
Closes #16459
Closes #19222
dbuf: restore BP_IS_HOLE() recheck after dnode_block_freed()
Commit 79cf54582 ("Fix reads for blocks freed after being cloned")
reworked the level-0 check in dbuf_read_hole() and dropped the
BP_IS_HOLE() recheck that followed dnode_block_freed(), together with
the comment explaining it. That recheck was not about overrides: it
closes a race with dnode_sync().
dnode_sync_free_ranges() drops dn_mtx, clears the bps through
dnode_sync_free_range_impl() -> free_blocks(), then retakes dn_mtx and
removes the range from dn_free_ranges. For blkptrs held in the dnode
(dn_nlevels == 1), free_blocks() writes the bp without the parent's
db_rwlock, so holding that lock in dbuf_read() does not serialize
against it. A reader that saw a non-hole bp, then waited on dn_mtx in
dnode_block_freed() until the range was removed, gets "not freed" while
the bp it is about to copy is already a hole (with HOLE_BIRTH, lsize
and birth preserved). dbuf_read_impl() then hands that hole to
arc_read(): no child I/O is issued, checksum verification fails with
EINVAL, and without ZIO_FLAG_CANFAIL the pool is suspended.
[19 lines not shown]
[Bazel] Add Support dependency to amdgpu_tests (#229597)
Fixes amdgpu_tests bazel layering failure introduced in commit
45ebdb6a55db, where AMDGPUUtilsTest.cpp includes
llvm/Support/Compiler.h.
[Bazel][libc] Update platform_file to depend on dup3 (#229595)
Fixes bazel build failure introduced in commit 64d83dcba1cb, where
file.cpp switched from using dup2 to dup3.
Fix a deadlock between zvol first open and pool export
After the reference check, zpool export drops the namespace lock with
spa_export_thread still set, and then removes the pool's zvols. A zvol
first open can take the namespace lock in that window. It then waits in
spa_lookup() for the export to finish while it holds zv_state_lock.
Export needs that lock to remove the zvol, so neither can make progress.
zvol_first_open() now fails with ENXIO when spa_lookup() would wait for
the pool. That is the same error the open gets a moment later, once
export marks the zvol for removal. An open in that window can never
succeed, because export removes the zvol before anything else can fail.
So only the case that hangs today behaves differently.
The check is in the shared zvol_first_open(), so it covers Linux,
FreeBSD, and opens made while the caller already holds the namespace
lock, such as a pool that uses zvols from another pool as vdevs. The
new spa_lookup_would_wait() shares its code with spa_lookup().
[10 lines not shown]
AMDGPU/GlobalISel: Use integer types when narrowing loads and stores
The narrowScalar mutation for loads and stores produced untyped scalars.
For FP-typed values this resulted in an untyped G_OR in the lowerLoad
expansion for unaligned private accesses, which failed to select.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
zfs_file: hide implementing struct
Nothing cares about what zfs_file_t actually is, so we can remove it
from the public header and with it the platform gates.
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19231
da: Update trim stats with the periph lock held
Separate the updating the stats for the completion from the biodone for
each one.
Sponsored by: Netflix
Reviewed by: ali_mashtizadeh.com
Differential Revision: https://reviews.freebsd.org/D60156
ada: Update trim stats for every bio
Separate the updating the stats for the completion from the biodone for
each one.
Sponsored by: Netflix
Reviewed by: ali_mashtizadeh.com
Differential Revision: https://reviews.freebsd.org/D60157
zfs_file: replace zfs_file_t in ztest to simulate failure
This is the only place that reaches into an existing zfs_file_t to mess
with its contents. Now that zfs_file_get() works on an existing (non-)
fd, we can just replace the zfs_file_t outright.
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19231
nda: Update trim stats with the periph lock held
Separate the updating the stats for the completion from the biodone for
each one.
Sponsored by: Netflix
Reviewed by: ali_mashtizadeh.com
Differential Revision: https://reviews.freebsd.org/D60155
cam: Rename cam_iosched_bio_complete to cam_iosched_bio_update_stats
The function updates scheduler statistics but does not complete the
bio. Rename it to avoid implying ownership of bio completion.
Sponsored by: Netflix
Reviewed by: ali_mashtizadeh.com
Differential Revision: https://reviews.freebsd.org/D60349
[AMDGPU] Fix true16 losing 16-bit subreg operands
Folding a true16 v2s copy such as %2:sreg_32 = COPY %1.lo16 rewrites
its users to read %1.lo16 and relies on legalizeOperandsVALUt16 to
legalize the narrower operand. PHI and REG_SEQUENCE operands have no
register class, so it skipped them, leaving a 16-bit input in a VGPR_32
PHI or a 32-bit REG_SEQUENCE slot. DetectDeadLanes then marked the PHI
input undef and the defining load was deleted.
Widen such operands with a REG_SEQUENCE in legalizeOperandsVALUt16,
which runs both when the copy is folded and when the user is moved to
the VALU. This miscompiled uniform i16 loads feeding PHIs on gfx1250.
Change-Id: I9ddee5b11ff8503f4b2b1d1c4c776a12b270d968
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
zfs_file: implement _get/_put for userspace
Simple enough just to wrap the existing fd, whatever it is, in a
zfs_file_t.
Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Tony Hutter <hutter2 at llnl.gov>
Signed-off-by: Rob Norris <rob.norris at truenas.com>
Closes #19231