[X86] Enable preferZeroCompareBranch() (#219919)
This makes CodeGenPrepare reorganize code such as:
```
%c = icmp eq i32 %x, 10
br %c, then, else
%a = add i32 %x, -10
```
into
```
%a = add i32 %x, -10
%cmp = icmp eq %a, 0
%br %cmp, then, else
```
so that the zero-compare and branch gets lowered to a JCC based on the
[3 lines not shown]
[RFC][AMDGPU] Add BARRIER address space (#209746)
Add a new BARRIER address space that is used for global variables that
are used to represent the barrier IDs in GFX12.5.
These barrier addresses just have values corresponding 1-1 to barrier
IDs. They are still implemented on top of LDS, but the offsetting
happens during an addrspacecast to generic, not whenever the barrier GV
is used.
The motivation for this is to make the relation between LDS and barrier
GVs explicit in the compiler. It does add a bit more complexity, but
that complexity was already there, just hidden by pretending barrier GVs
were actual LDS.
Rework snapshot rollback with batched destroys
## Problem
Rolling back past older snapshots destroyed the newer ones one ioctl at a time with no real pre-flight, so a hold or clone discovered midway left some snapshots already gone and, with `recursive_rollback`, a blocked child was only discovered after the parent had already been rolled back - a partially rolled-back tree. Most kernel errors (ESRCH, EBUSY, EDQUOT, ENOSPC) were flattened into `ValidationError(EINVAL)` with a raw strerror, a rollback that had already committed was still reported as a failure when the follow-up zpool-history write failed, and a thick zvol rolled back across a volsize change silently lost its refreservation.
## Solution
- **Enumerate once, up front, for the whole tree.** Newer snapshots are collected for every affected dataset before anything is touched. Without `recursive`, the rollback is refused immediately with every conflicting snapshot named and nothing destroyed; with it, hold/clone blockers are reported before any destroy, and a missing child snapshot fails the whole tree before the parent moves.
- **Batch the destroys.** All newer snapshots go in a single all-or-nothing ioctl per dataset. The kernel checks every snapshot before destroying any, so a blocker - including the long holds from an in-flight send or a `.zfs/snapshot` automount that no pre-flight can see - destroys nothing and is named from the kernel's own error list. A destroy interrupted mid-sync (empty kernel error list) re-enumerates and reports honestly that an unknown number are already gone.
- **Honest error model.** Rollback failures get errno-specific messages; blockers and operational failures surface as `CallError` (EBUSY and friends) while input problems stay `ValidationError`; a committed rollback is never reported as a failure just because the zpool-history write raised afterwards; and any failure partway through a recursive rollback names the datasets that already rolled back, since that cannot be undone.
- **Restore a thick zvol's refreservation** after a rollback that changed the volsize, matching `zfs rollback`. Volumes with a synthetic (larger) refreservation are deliberately left alone, also matching `zfs rollback`.
- **Clones are always unmounted before being destroyed** - `force` now only selects how forcefully - and destroyed via `destroy_resource()`, fixing a path that previously crashed on a method that did not exist.
- **Known limitation: bookmarks are not managed.** A bookmark newer than the target is invisible to the pre-flight and fails the rollback with EEXIST - after the newer snapshots were already destroyed when `recursive` was passed. The error says so and names the manual remedy. TrueNAS itself creates no bookmarks; this only affects externally-created ones.
NAS-143057 / 27.0.0-BETA.1 / Redact uploaded license from the audit trail (by sonicaj) (#19606)
This commit fixes an issue where `truenas.license.upload` recorded its
license argument verbatim in the audit trail, because the field was
never declared `Secret[...]`. Uploading needs FULL_ADMIN but audit
records come back with SYSTEM_AUDIT_READ, so a read-only admin could
pull out the blob a full admin installed, and the same record went to
remote syslog and into debug bundles.
Marking the field `Secret[LongNonEmptyString]` means `check_annotations`
stops accepting the old `license_: str` signature, and the
`str(license_)` that went with it turned out to be wrong already: it
stringified the `LongStringWrapper` and wrote `LongStringWrapper(<pem>)`
into the license file. The daemon's PEM scan skips the leading garbage
so nothing ever failed, but the on-disk copy never matched what was
uploaded, which defeats the TNC heartbeat's raw_license comparison and
makes every HA send_license add another wrapper layer. Unwrapping both
boxes writes the PEM back byte for byte.
[4 lines not shown]
[ADT] Give DenseMapPair its own members instead of a std::pair base. NFC (#221853)
std::pair declares a copy assignment operator, so it is not trivially
copyable. destroyAll and copyFrom therefore ask about KeyT and ValueT
separately. Hold first and second directly.
Conversion to std::pair is explicit; insert also takes a bucket, and a
converting constructor keeps range insert working across pair types.
Co-authored-by: Kazu Hirata <kazu at google.com>
security/q-feeds-connector - add db_update action which indexes the additional feed information in sqlite, which will be executed during a regular update after fetch.
[flang][OpenACC] Don't emit unstructured-loop TODO for wrappable loops
`genOpenACCLoopFromDoConstruct` raised an NYI for any unstructured DO inside `acc kernels`. That check ran before the wrapping in `genFIR(DoConstruct)`, so a loop whose CFG is self-contained aborted lowering even though the fall-back path would have wrapped it in an `scf.execute_region`.
Skip the TODO when `isWrappableConstruct()` accepts the loop. Such a loop is not attached to a directive; it is only nested inside the kernels region.
Correspondingly, a DO loop sitting directly in an `acc kernels` body is no longer wrappable, since it is the loop the directive parallelizes and hiding its CFG would leave the kernels region with nothing to partition.
[CodeGen][NPM] Port MachinePipeliner to NPM (#221676)
changes of note,
1. registers the pass with AMDGPUCodeGenPassBuilder::addPreRegAlloc()
2. Changes the core MachinePipeliner::run() method to return actual
"Changed" state
[IR] Do not inherit ABI attributes from the callee (#207173)
Usually attributes that are missing on the call-site are inherited form
the callee instead. This is fine for optional optimization attributes,
but problematic for ABI-affecting attributes.
ABI attributes generally must be placed at the call-site as well,
because there is no callee to inherit from for indirect calls. Failing
to specify ABI attributes at the call-site generally indicates a bug.
The motivation for being stricter about this (apart from just being the
right thing to do) is to properly support cases where the attributes at
the call-site and the callee actually differ. Two examples I'm aware of
are:
* During cross-language LTO, it's possible to have one side use a `ptr`
argument and the other a `ptr byval(ptr)` argument. Both represent the
same ABI using different IR encodings, but you can't just inherit the
`byval` attribute from one to the other (because the byval case requires
[22 lines not shown]
[flang][OpenACC] Don't emit unstructured-loop TODO for wrappable loops
`genOpenACCLoopFromDoConstruct` raised an NYI for any unstructured DO inside `acc kernels`. That check ran before the wrapping in `genFIR(DoConstruct)`, so a loop whose CFG is self-contained aborted lowering even though the fall-back path would have wrapped it in an `scf.execute_region`.
Skip the TODO when `isWrappableConstruct()` accepts the loop. Such a loop is not attached to a directive; it is only nested inside the kernels region.