[flang][acc] Prefer the reduction mapping when remapping region symbols (#233938)
When a variable appears on several data clauses of one compute
construct, `AccDataMap::remapDataOperandSymbols` bound the region's
symbol to the first data operation result, on the assumption that every
result for a symbol addresses the same memory.
For a reduction the results are not interchangeable. The reduction
clause carries bounds for the section while the data clause maps the
whole variable, so for
```fortran
!$acc parallel loop copy(rarr) reduction(+:rarr(3:10))
```
The variable has two mappings and only the reduction one describes the
accumulator. Binding the region to the whole-array `copy` meant accesses
inside it, including the `acc.reduction` rooted on that declare, were
expressed against the variable's mapping rather than the accumulator's.
[11 lines not shown]
[KnownFPClass] Fix fsub input denormal handling (#225605)
Fixes https://github.com/llvm/llvm-project/issues/225587
Refactors the output/input denormal handling for `KnownFPClass::fadd`
and `KnownFPClass::fsub`.
`fadd`/`fadd_self`/`fsub` handle the flushing of output/input denormals,
and will pass the flushed inputs to `fadd_impl` (which uses IEEE
subnormal handling).
`KnownFPClass::fma` remains unchanged (note that the `DenormalMode`
parameter was unused by `fadd_impl`).
[flang][cuda] Mark cuf.device_is_active as a read-only query (#233987)
`cuf.device_is_active` declared no memory effects, so an unused query
could never be removed even though it only reads the CUDA context state.
Give it `MemoryEffects<[MemRead]>` so canonicalization erases it when
dead, for example once the `if (cuf.device_is_active) { ... }` cleanup
it guards has been emptied.
The runtime probe it lowers to must stay free of observable effects; a
comment on `deviceContextTornDown` records that.
[BPF] Lower unwinding to unwind_goto and unwind_exit (#233649)
Replace the .bpf_cleanup table with two new instructions, so that
neither a loader nor the kernel has to dispatch landing pads.
unwind_goto pad BPF_JMP | BPF_JCOND, src_reg = 1
unwind_exit BPF_JMP | BPF_EXIT, src_reg = 1
'call f; unwind_goto pad' goes to the pad when f left with unwind_exit
and falls through when it left with exit. No register says which one it
was: how one instruction tells the other is up to the JIT. In everything
else unwind_exit is exit.
ret exit
invoke f() unwind pad call f; unwind_goto pad
resume r0 = 0; unwind_exit
call _Unwind_RaiseException r0 = 0; unwind_exit
invoke _Unwind_RaiseException goto pad
[56 lines not shown]
pam_exec: fix the stderr close test and avoid a double close
The cleanup tested cherr[0] when closing cherr[1]. The parent also closed
chin[0]/chout[1]/cherr[1] after pdfork() without clearing them, so the out:
cleanup path closed them again. Clear each fd after closing and test the right
one.
Reviewed by: des, markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60924
bhyve: Treat BAR registration failures as non-fatal
Some guest operating systems (at least 9front) will leave device I/O
space decoding enabled while probing BAR sizes. In this case, a
sufficiently large 32-bit BAR can overlap with the HPET MMIO region
fixed at 0xfed00000. This results in an assertion failure in
modify_bar_registration(), even though the collision is transient, i.e.,
the guest will promptly map the BAR elsewhere.
Tolerate such overlaps. Keep track of a BAR's registration state and
make sure that modify_bar_registration() doesn't try to unregister an
I/O space if registration failed.
This fixes a problem where a 32MB framebuffer ends up overlapping with
the HPET MMIO region, causing some guests to crash with an assertion
failure when probing BARs during boot.
PR: 290098
Reviewed by: bnovkov
[3 lines not shown]
inetd: use snprintf() in inetd_setproctitle()
inetd_setproctitle() formats se_service (the service name taken verbatim
from inetd.conf) and the peer address into an 80-byte buffer with
sprintf(). A long service name can overflow it. Bound both calls with
snprintf().
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D60879
[mlir][LLVMIR] Translate dso_local on llvm.mlir.alias
MLIR's LLVM IR translation now sets dso_local on the aliases it creates
from llvm.mlir.alias, the same way it already does for globals, functions
and ifuncs. The importer already reads the flag, so it now survives a
round trip.
Assisted-by: Cursor / claude-opus-5.5
zvol: remove minors in parallel
zvol_remove_minors_impl() shuts down its zvols one at a time, and on
Linux each del_gendisk() waits for an RCU grace period, so exporting a
pool with 1,000 zvols spends about 30 s in this loop.
Move the loop body unchanged into zvol_shutdown_minor(). When there is
more than one zvol, run it for each on a taskq created for the call, as
vdev_open_children() does, with up to 32 threads, and wait for all of
them before freeing the zvols, so the removal stays one synchronous
operation as #17625 made it.
On a 12-CPU VM with Linux 6.12, exporting a pool with 1,000 zvols took
28.7-30.2 s before and 2.5-3.3 s after. FreeBSD doesn't wait for a
grace period per device, and its export times are unchanged.
Reviewed-by: Alexander Motin <alexander.motin at TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Signed-off-by: Ameer Hamza <ameer.hamza at truenas.com>
Closes #19430
Add middleware support for LIO ALUA HA
Wire up the middleware side of LIO ALUA high-availability: load
lio_ha.ko with per-node addresses on service start, manage ALUA
state across failover events, clean up STANDBY configfs on pool
export, and add pre-flight validation that targets have static
initiator ACLs before ALUA can be enabled.
For each target, create a portal-less phantom TPG carrying the peer
node's controller group so that a single RTPG response from any
connected port lists both ALUA groups. Write tpgt_N/rtpi explicitly
before enable so that relative target port IDs in RTPG match the
tag formula (portal.tag on Node A, portal.tag + 32000 on Node B)
rather than being auto-assigned sequentially by the kernel.
ALUA group states are driven by role and ha_state:
MASTER + synced local=OPTIMIZED remote=NONOPTIMIZED
MASTER + connected local=OPTIMIZED remote=TRANSITIONING
[4 lines not shown]
Add context_params to iscsi_scsi_connect()
Pass an optional context_params dict through to python-scsi's
init_device(), so a test can set pre-login iscsi.Context options such
as an explicit ISID. context_params_supported() lets callers skip when
the installed python-scsi predates it.
Also ruff.
emulators/ares: Remove librashader from BUILD_DEPENDS
Ares always needs the librashader headers to build, even if building
without shader support by disabling the LIBRASHADER option. Because of
this, devel/librashader is an unconditional build dependency.
This requires every user who wants to build the port to also build
devel/librashader, which needs Rust. This is undesired by some users who
don't need/want shader support in the emulator.
To provide a way for such users to compile the ares port without needing
a Rust toolchain, devel/librashader is removed from BUILD_DEPENDS. The
required headers are bundled with the distfile and the port extracts
them now if the LIBRASHADER option is disabled. They are then picked up
by ares' build process.
Building with LIBRASHADER enabled is unchanged: thirdparty/librashader
is excluded from extraction and the build process picks up the headers
provided by the devel/librashader port.
[3 lines not shown]
[RISCV] Correctly restore libcall CSRs with SCS (#233338)
Fixes #233318
Before this change, we were restoring some callee-saved registers twice
when using save/restore libcalls with shadow call stack (SCS), and the
second restore was happening after the stack was deallocated using the
wrong register and offset calculation, which was causing lots of access
problems.
The problems were:
- We were using the entire list of Callee Saves rather than just the
subset that would have been restored by the libcall. This caused
duplicate restores because of how the CSI subsetting works.
- We were not using the correct offset calculation in
eliminateFrameIndex, which was causing us to calculate the wrong
address for the saves/restores.
Assisted-by: AI
Co-authored-by: Mitch Briles <mitchbriles at gmail.com>
[HLSL] Allow a groupshared struct to be passed as an implicit parameter (#229939)
If the implicit object parameter is in the groupshared address space and
the function is const then perform an LValue to RValue cast.
If the implicit object parameter is in the groupshared address space
then create an HSLOutArgExpr which handles the writeback of the object
from the temporary.
Adds an AST test and a Codegen test.
Closes #228563
Auto-assign pull requests to their author
Add a pr_assign_author job so each new pull request is assigned to the
person who opened it. Bot accounts such as dependabot are skipped since
they cannot be assignees.
Auto-assign pull requests to their author
Add a pr_assign_author job so each new pull request is assigned to the
person who opened it. Bot accounts such as dependabot are skipped since
they cannot be assignees.