vtnet: Accept VIRTIO_NET_F_CTRL_RX_EXTRA
Although the driver does not issue the extra receive-mode commands
accepting the feature is harmless and some devices, notably Apple's
Virtualization.framework, offer their control-queue features as a
group and refuse FEATURES_OK unless the whole set is acknowledged.
Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: adrian
Pull Request: https://github.com/freebsd/freebsd-src/pull/2322
vtnet: Implement VIRTIO_NET_F_GUEST_ANNOUNCE
When the device sets VIRTIO_NET_S_ANNOUNCE in the config status
field, for example after a VM migrates to a new host, announce
the interface's presence on the network so peers and switches
learn the new attachment point, then acknowledge the request
with the VIRTIO_NET_CTRL_ANNOUNCE_ACK control command, as per
VirtIO v1.3, 5.1.6.5.4.
The announcement raises iflladdr_event: the stack sends gratuitous
ARPs and unsolicited neighbor advertisements for the interface's
addresses, and stacked interfaces such as vlan(4) propagate the
event and announce theirs as well. The event handlers may sleep,
so the work is deferred from the config change interrupt to a task
on taskqueue_thread; that context also allows the acknowledgement
to be skipped safely if the interface was stopped in the meantime,
in which case the device keeps the bit set and the request is
re-delivered with the next config change interrupt.
[3 lines not shown]
vtnet: Retry feature negotiation without offloads
A device is permitted to reject an otherwise valid subset of its
offered features by refusing to accept FEATURES_OK (VirtIO v1.3,
2.2.2). Apple's Virtualization.framework does this in practice;
it treats the offered CSUM/TSO offloads as all-or-nothing, while
vtnet's default request contains only part of that group because
of hw.vtnet.lro_disable that would drop the guest TSO bits, thus
negotiation fails and the device does not attach.
If FEATURES_OK is rejected, retry the negotiation once with every
offload-related feature stripped. Changing the feature set after
a failed FEATURES_OK requires re-initialising from device reset
(VirtIO v1.3, 3.1.1), so the retry goes through virtio_reinit().
A NIC without offloads is preferable to no NIC at all. Devices
that accept the initial feature set are unaffected, while those
that also reject the reduced set continue to fail attachment as
before.
[4 lines not shown]
LinuxKPI: 802.11: always lock around (*set_{frag,rts}_threshold)
We would lock the downcalls during normal operation but not during
vap (vif) creation as there was no need for locking.
Add the missing locking there as drivers seem to always expect it
(by assertion) and cannot distinguish between state.
Add the assertions to the downcalls as we need both of them locked
and both of them can sleep.
PR: 296185 ("rtw89(4) freezes the system with INVARIANTS kernel")
Debugged by: Artem Bunichev (temcbun gmail.com)
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
[TableGen][AMDGPU][AsmParser] Catch and fix ambiguous instructions
Declares mutually exclusive assembler predicates and teaches
TableGen to use that knowledge to report matchables that are
indistinguishable to the asm parser.
The instruction changes are effectively NFCI, mostly removing
genuine duplicates and fixing predicates.
Prepared using Claude.
https://github.com/llvm/llvm-project/issues/69256
Fix recursive role assignment
This commit fixes a typo for the PRIVILEGE_WRITE role that
if granted in isolation to a group could cause a
recursion error to surface to API consumer.
(cherry picked from commit 1bfae0d9d6b8a3b90feb11dcaf3b9b35d2522eea)
Fix recursive role assignment
This commit fixes a typo for the PRIVILEGE_WRITE role that
if granted in isolation to a group could cause a
recursion error to surface to API consumer.
(cherry picked from commit 1bfae0d9d6b8a3b90feb11dcaf3b9b35d2522eea)
NAS-141876 / 27.0.0-BETA.1 / Fix recursive role assignment (#19358)
This commit fixes a typo for the PRIVILEGE_WRITE role that if granted in
isolation to a group could cause a
recursion error to surface to API consumer.
[flang][cuda][openacc] Support CUDA calls to ACC routines (#210165)
Enable CUDA device procedures to call !$acc routine procedures.
- Treat ACC routines as device-callable during CUDA semantic checking.
- Apply implicit-device dummy argument handling to ACC routines called
from CUDA device code.
- Defer CUDA cloning of ACC routines until ACC lowering materializes and
moves the specialized routine into the GPU module.
- Add a CUF device-function transform regression test.
[libc++] Use github-script instead of pygithub for benchmark jobs, and report failure (#211074)
Switch GitHub API interactions to use actions/github-script instead of
pygithub, as is done in other Github workflows in the repository. This
is simpler and it also resolves the issue that if setting up the Python
virtual environment fails, there's no way to communicate the issue back
since doing so would require pygithub.
As a drive-by, also report the failure when a step in the libc++ PR
benchmark job fails, instead of leaving a "Running benchmarks in ..."
comment indefinitely.
Assisted by Claude
Fixes #210985
Fix recursive role assignment
This commit fixes a typo for the PRIVILEGE_WRITE role that
if granted in isolation to a group could cause a
recursion error to surface to API consumer.
[ConstraintElim] Derive signed facts for post-increment inductions. (#210079)
Extend logic added in https://github.com/llvm/llvm-project/pull/209199
to also derive signed facts.
To do so, we keep track of whether LowerBound = Start + Step overflows
signed/unsigned. Code that previously bailed out if we were handling a
post-increment induction has been updated to use the computed
LowerBound, if it does not signed-wrap.
Alive2 Proof: https://alive2.llvm.org/ce/z/frskVt
PR: https://github.com/llvm/llvm-project/pull/210079
[mlir-c] Add 1:N TypeConverter conversion and materialization bindings
Builds on the source/target materialization C bindings:
- Target materialization callbacks now receive `originalType` (split from the
previously-shared source/target callback typedef), exposing a documented C++
capability that was otherwise unreachable from C.
- 1:N type conversion: `mlirTypeConverterAdd1ToNConversion` plus an opaque
results accumulator (`MlirTypeConverterConversionResults` /
`mlirTypeConverterConversionResultsAppend`). A declining callback's appended
types are rolled back so the driver's "try the next conversion" invariant
holds.
- 1:N target materialization: `mlirTypeConverterAdd1ToNTargetMaterialization`,
whose callback fills a caller-allocated `outputs` buffer. A success that
leaves any output null is treated as a decline rather than handing the driver
a null-containing result.
- `mlirConversionPatternRewriterReplaceOpWithMultiple` for 1:N value
replacement, which can drive a source materialization with nInputs > 1.
- An optional `matchAndRewrite1ToN` callback on `MlirConversionPatternCallbacks`
[9 lines not shown]
[mlir-c] Test the failure path of the 1:N type conversion callback
Adds a test that registers a 1:N conversion function returning
MlirTypeConverterConversionStatusFailure. Because it is tried before the
i32 -> (i16, i16) conversion, the failure must abort the whole conversion
(rather than falling back), leaving the IR unchanged -- the behavior that a
plain decline would not produce.
[mlir-c] Value-initialize MlirConversionPatternCallbacks in Python bindings
The Python conversion-pattern binding left the struct default-initialized,
so the newly-added optional matchAndRewrite1ToN field held an indeterminate
pointer. The driver's null check then read garbage and jumped into it,
segfaulting mlir/test/python/rewrite.py. Value-initialize the struct so
optional callbacks default to null.
[mlir-c] Fix -Wmissing-field-initializers in rewrite.c test
The new matchAndRewrite1ToN field left three existing
MlirConversionPatternCallbacks initializers under-initialized, which
fails the CI build under -Werror=-Wmissing-field-initializers.
[mlir-c] Use a tri-state status enum for the type conversion callback
MlirTypeConverterConversionCallback returned MlirLogicalResult and used a
null convertedType as a second failure sentinel, which could only express
success or "try another conversion" -- and conflated the C++ decline
(std::nullopt) and hard-failure (failure()) states.
Introduce MlirTypeConverterConversionStatus (Success/Failure/Declined) and
return it from the callback instead, mapping the three states to success(),
failure(), and std::nullopt respectively. Update the Python binding and the
C API test callback accordingly.
Add a C API unit test (testTypeConverterConversionStatus) exercising all
three status values through mlirTypeConverterConvertType.
NAS-141595 / 27.0.0-BETA.1 / Replace zectl with the truenas_bootenv engine (#19298)
### Summary
The `boot_environment` plugin no longer shells out to `zectl`. Query,
clone, activate, destroy and keep now call the `truenas_bootenv` engine
in process on middleware's thread-local libzfs handle. `utils.py` and
`run_zectl_cmd` are deleted, and boot-time promotion goes through the
engine instead of parsing `zfs list -j` out of a shell pipeline.
See [truenas_pylibzfs
PR](https://github.com/truenas/truenas_pylibzfs/pull/260) for the engine
and why zectl is going. This PR is the rewiring, and needs that one
merged first.
### How the plugin is structured
The plugin is split in two. `crud.py` holds the async policy (the
mutation lock, the ordering, the grub marker, the rollback, the error
mapping) and never touches ZFS. `__init__.py` carries the `@api_method`
surface and the `be_*_impl` methods, which are synchronous because
[49 lines not shown]
Set flags for Power ISA 2.06, 2.07, isel, and vec crypto
These are for elf_aux_info(3) AT_HWCAP or AT_HWCAP2. The vec crypto
flag is for accelerating AES and SHA-2. Some ports check these flags,
or will check them if they get patched to call elf_aux_info.
Define PPC_FEATURE2_VEC_CRYPTO with the same value as
PPC_FEATURE2_HAS_VEC_CRYPTO, because I have seen code using the name
without HAS.
ok kettenis@
[flang][OpenMP] Lower DO and SIMD variants in metadirectives
Lower DO, SIMD, and DO SIMD replacement directives selected by a
metadirective. Support standalone and begin/end forms with static or runtime
selection.
A standalone metadirective and its associated loop are represented as sibling
PFT evaluations. For example:
```fortran
!$omp metadirective &
!$omp& when(user={condition(flag)}: do) &
!$omp& otherwise(nothing)
do i = 1, n
a(i) = i
end do
```
has the following evaluation shape:
[45 lines not shown]