NAS-143065 / 26.0.0 / Validate VM and container UUIDs the way libvirt does (by Qubad786) (#19848)
## Problem
`UUIDv4String` did neither thing its name implies. `uuid.UUID(value,
version=4)` overwrites the version and variant bits on a throwaway
object rather than asserting them, so nothing was ever checked; and the
validator returned the caller's original string, so every spelling of a
UUID was stored verbatim. Two things went wrong as a result.
The stored string is the libvirt identity — it is written to both
`<name>` and `<uuid>` of the domain XML, and domains are looked up by
name. Because the create-time uniqueness check was a datastore filter,
i.e. SQL `=` against a BINARY-collated column, two rows spelling one
UUID differently both got in. Domains are only defined at start, so
nothing went wrong until the second one was started, at which point
libvirt refused it while quoting the first row's uuid. `uuid` is
immutable after creation, so that row cannot be repaired.
Separately, Python and libvirt disagree about what a UUID even looks
[36 lines not shown]
NAS-144024 / 26.0.0 / Fix zettarepl crash (by themylogin) (#19849)
`die_with_parent` makes the `fork`ed process die with the parent
_thread_. Sometimes, when under load, zettarepl was started from a
temporary IO thread pool thread, and was killed when that thread was
disposed.
Original PR: https://github.com/truenas/middleware/pull/19837
Co-authored-by: themylogin <themylogin at gmail.com>
Mk: add a BUILD_RUN_DEPENDS variable
Add BUILD_RUN_DEPENDS as a syntastic sugar for adding dependencies to
both BUILD_DEPENDS and RUN_DEPENDS without side effects.
Differential Revision: https://reviews.freebsd.org/D59664
[libc] Implement pause (#225365)
Add the linux_syscalls::pause wrapper using SYS_ppoll, along with the
unistd pause entrypoint and unit test on Linux.
Assisted-by: Automated tooling, human reviewed.
[AArch64][GISel][FastISel] Fix Windows "sret inreg". (#225190)
5dc8aeb26d2896c65cbea0d3b87f090241444bb6 added a special case to
SelectionDAG ISel for "sret inreg" parameters: they are copied to x0 on
return. There was a review comment suggesting that GISel and FastISel
also needed fixes, but through some mixup the followup never happened.
Fixes #225060
(cherry picked from commit 8890be35705834c5af8e21424d7900639be03180)
[DAGCombiner] Restrict combineOrOfSetCCToUSUBOCarry to ZeroOrOneBooleanContent. (#224759)
We need to ensure the carry in matches boolean contents. We are checking
MaskedValueIsZero which is only valid for ZeroOrOneBooleanContent.
We could check ComputeNumSignBits for ZeroOrNegativeOneBooleanContent,
but no in tree target supports USUBO_CARRY and
ZeroOrNegativeOneBooleanContent.
This was an oversight in #223396 due to incorrect documentation for
USUBO_CARRY. I will fix that in a separate patch.
(cherry picked from commit 51d290508d4dd980c3ba03bcc873926c41c6e591)
[DAGCombiner] Require a 0/1 carry-in when rebuilding a borrow chain (#223396)
combineOrOfSetCCToUSUBOCarry (aae871ba1224) rewrites
carry_out = (A <u B) | ((A == B) & carry_in)
to USUBO_CARRY(A, B, carry_in), accepting any value as carry_in.
USUBO_CARRY's third operand is specified as "1 if and only if there is
an incoming carry/borrow", so 0 and 1 are its only meaningful values.
Unlike SADDO_CARRY/SSUBO_CARRY it does not fall back to
getBooleanContents for wider types. The matched `and` is bitwise against
a 0/1 setcc, so only bit 0 of carry_in reaches carry_out and nothing
else constrains it; a carry_in with any other bit set is outside the
operand's contract and miscompiles.
Require carry_in to be known 0/1. Check known bits rather than look for
an `and carry_in, 1`: only bit 0 is demanded inside the `and`, so such a
mask is usually folded away before this combine runs. An i1 carry_in,
[6 lines not shown]
[lld] Don't drop RELR relocations for late-added GOT entries (#211911)
In #208959 we started dropping RELR relocations for late-added GOT
entries when reverting x86-64 GOTPCRELX relaxations in
X86_64::relaxOnce.
There is a separate unrelaxation bug where if the object files didn't
have any relocations of a certain type, we'd prune .relr.dyn (or even
.rela.dyn). Will be addressed separately.
Assisted-by: Gemini
(cherry picked from commit 5565740f2367093b89481ba7371adf820971977d)
[mlir] Reduce generated assembly printer compile time
Use fixed arrays for statically elided attributes and combine leading spaces
with literals. Move common operand printing out of generated call sites and
emit sliced operand getters to reduce optimizer work in large printers.
For omp.target, optimized print IR drops from 3,893 to 2,667 instructions.
The printing benchmark is 2.1% slower; check-mlir passes.
Assisted-by: Codex
Revert "[clang][OpenMP] ORDERED clause is allowed on FOR in 4.5+ (#22… (#225669)
…5106)"
This reverts commit b0d31f40189dbdcf8b62e2c6ef79b039c5202aba.
This missed the restriction that ORDERED is not allowed when DISTRIBUTE
is a constituent construct.
AMDGPU: Mark dead carry-out when rewriting scalar carry op to VALU
If an operation is expanded with a dead scc def, the resultant vcc def will
also be dead, so preserve the dead flag. Reduces implicit reliance on
LiveVariables recomputing dead flags later.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[AArch64][PAC] Reset `killed` operand flags in outlined functions
Presently, MachineOutliner does not take `killed` operand flags into
account when merging instruction sequences. While it sounds perfectly
reasonable not to inhibit merging of the instruction sequences that
only differ in `killed` flags (for N flags there is technically 2^N
valid ways to drop some subset of them), copying these flags from
an arbitrarily chosen representative instruction may result in
incorrect codegen of PAuth-related pseudo instructions on AArch64.
To keep `killed` flags conservatively correct as if `OUTLINED_FUNCTION`s
are virtually re-inserted at every call site, this patch takes the
simplest approach of resetting every `killed` flag inside the
outlined functions.
www/immich: Fix immich-admin for any login shell
su -m runs the command in the caller's login shell, so the wrapper
broke wherever root does not use a POSIX shell. chroot(8) drops the
privileges without a shell in between and passes the arguments to
execve(2) unchanged.
Reported by: mfechner
Sponsored by: Netzkommune GmbH
www/immich: Fix immich-admin for any login shell
su -m runs the command in the caller's login shell, so the wrapper
broke wherever root does not use a POSIX shell. chroot(8) drops the
privileges without a shell in between and passes the arguments to
execve(2) unchanged.
Reported by: mfechner
Sponsored by: Netzkommune GmbH
[AArch64] Allow cost-free cast absorption into widening instructions with multiple users (#210460)
Extend getCastInstrCost to recognize cast absorption into widening
instructions (uaddl, saddw, urhadd, etc.) when the cast has multiple
users, not just one.
Previously, the check only looked at a single user (`I->hasOneUser()`),
so a zext/sext feeding more than one widening-eligible instruction was
always costed as non-free, even when every user could individually
absorb it.
This also affected codegen: `optimizeExtendOrTruncateConversion` in
`AArch64ISelLowering.cpp` decides whether to lower a double-widening
zext via tbl shuffles based on whether `getCastInstrCost` reports the
cast as free. With multi-user casts always costed as non-free, this
took the tbl-lowering path in cases where every user could actually
absorb the cast for free, generating unnecessary tbl instructions.
Compiler Explorer:
[14 lines not shown]