NAS-144247 / 27.0.0 / Manage container NICs explicitly instead of adding one on the fly
Backport of #20059.
## Problem
A container without a NIC device row got an implicit bridge NIC with no MAC added on the fly at every start, so libvirt generated a new MAC each time and the container came up with a different DHCP address after every restart. Containers migrated from incus are usually in this state because their eth0 came from the incus profile. Beyond the MAC churn, silently attaching a NIC the user never configured isn't always what users want.
## Solution
Container networking is now managed explicitly through NIC devices.
- **No implicit NIC**: a container only has network through its NIC devices, and one without any gets a private namespace with only loopback. This relies on truenas/truenas_pylibvirt#97 emitting `<privnet/>` for such containers. `default_network` is kept on the container entry for compatibility but is always `null`.
- **Default bridge**: creating a NIC without `nic_attach`, or clearing it on an attached NIC, attaches it to the bridge configured in `lxc.config` (`truenasbr0` when automatic) and stores that name. NICs already stored without an attachment keep attaching as macvlan to the default-route interface.
- **truenasbr0 NICs keep working**: it is always offered as a choice and is brought up whenever a starting container has a NIC on it, even after a custom bridge has been configured.
- **Existing containers**: a migration gives every container without a NIC device one on the configured bridge with a persisted MAC, and the incus migration does the same on the bridge incus used, reusing the MAC incus assigned to eth0.
[libc++] Remove unused type_info constructor (#235739)
We have a constructor taking a `const char*` since the initial import.
It's unused in the library and neither the C++ standard nor the Itanium
ABI require it. Since all `type_info` instances are magicked into
existence by the compiler it doesn't make a ton of sense to have a
constructor either.
NAS-144980 / 27.0.0 / Answer whether a file has a POSIX ACL from statx (by yocalebo) (#20099)
filesystem.stat and filesystem.listdir learn whether a file has an ACL
by listing its xattrs, unless ZFS reports the NFSv4 ACL trivial in
stx_zfsflags, which it does on NFSv4 ACL datasets alone. So every file
of a POSIX ACL dataset costs a listxattr. The TrueNAS kernel now answers
STATX_ACL from the ACLs the inode caches, with STATX_ATTR_ACL_ACCESS for
an access ACL and STATX_ATTR_ACL_DEFAULT for a default one.
STATX_DEFAULT_MASK asks STATX_ACL, and zfs_acl_is_trivial becomes
statx_acl_is_trivial, which takes the two bits where the kernel answered
and the trivial flag of ZFS otherwise, so a file with no ACL needs no
listxattr on either acltype. It needs truenas_pyos with STATX_ACL, whose
iter_filesystem_contents asks it for each entry.
A unit test sets an access ACL on a file and a default ACL on a folder
in the temporary folder, which keeps POSIX ACLs on tmpfs, checks the
answer for each, and checks that listdir lists the xattrs of the two
with an ACL alone. It needs a kernel with the change.
[3 lines not shown]
Mk/bsd.sites.mk: Add USE_FORGEJO helper
When a distribution file is to be fetched from a specific commit or tag
on a Forgejo or Gitea site, USE_FORGEJO provides helper variables to
automatically set key variables such as DISTNAME and MASTER_SITES to the
correct values. It is modelled after USE_GITHUB and USE_GITLAB.
Reviewed by: diizzy, fuz, siva
Approved by: portmgrg (bapt)
Sponsored by: The FreeBSD Foundation
Pull Request: https://ron-dev.freebsd.org/FreeBSD/ports/pulls/9
NAS-144980 / 28.0.0-BETA.1 / Answer whether a file has a POSIX ACL from statx (#20098)
filesystem.stat and filesystem.listdir learn whether a file has an ACL
by listing its xattrs, unless ZFS reports the NFSv4 ACL trivial in
stx_zfsflags, which it does on NFSv4 ACL datasets alone. So every file
of a POSIX ACL dataset costs a listxattr. The TrueNAS kernel now answers
STATX_ACL from the ACLs the inode caches, with STATX_ATTR_ACL_ACCESS for
an access ACL and STATX_ATTR_ACL_DEFAULT for a default one.
STATX_DEFAULT_MASK asks STATX_ACL, and zfs_acl_is_trivial becomes
statx_acl_is_trivial, which takes the two bits where the kernel answered
and the trivial flag of ZFS otherwise, so a file with no ACL needs no
listxattr on either acltype. It needs truenas_pyos with STATX_ACL, whose
iter_filesystem_contents asks it for each entry.
A unit test sets an access ACL on a file and a default ACL on a folder
in the temporary folder, which keeps POSIX ACLs on tmpfs, checks the
answer for each, and checks that listdir lists the xattrs of the two
with an ACL alone. It needs a kernel with the change.
[2 lines not shown]
[mlir][tosa] Add integer bitwidth conversion pass (#232853)
Add tosa-convert-integer-types-bitwidth to convert i4 to i8 and/or i48
to i64. This is useful to facilitate lowering to backends that do not
support i4 and/or i48.
Add a host byte-order lit feature to gate tests with little-endian
resource data.
Assisted-by: Codex
[SLP] Freeze undef operand of shl X, 1 expanded to add X, X
add X, X reads X twice, so it does not refine shl X, 1 when X is
undef. Freeze the operand and blend the frozen lanes into the other
operand, unless X is proven not undef or undef X triggers UB.
Assisted-by: Cursor
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/237207
[CIR][AMDGPU] Lower cir.offload.printf to AMDGPU printf (#231563)
Add lowering for cir.offload.printf to the AMDGPU printf logic employed
by OGCG. Most of the functions added in
clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVMOffloadPrintf.cpp are CIR
equivalents to the functions in
llvm/lib/Transforms/Utils/AMDGPUEmitPrintf.cpp.
Assisted-by: Claude Opus 5.5
---------
Signed-off-by: Steffen Holst Larsen <sholstla at amd.com>
NAS-144980 / 28.0.0-BETA.1 / Answer whether a file has a POSIX ACL from statx (#20098)
filesystem.stat and filesystem.listdir learn whether a file has an ACL
by listing its xattrs, unless ZFS reports the NFSv4 ACL trivial in
stx_zfsflags, which it does on NFSv4 ACL datasets alone. So every file
of a POSIX ACL dataset costs a listxattr. The TrueNAS kernel now answers
STATX_ACL from the ACLs the inode caches, with STATX_ATTR_ACL_ACCESS for
an access ACL and STATX_ATTR_ACL_DEFAULT for a default one.
STATX_DEFAULT_MASK asks STATX_ACL, and zfs_acl_is_trivial becomes
statx_acl_is_trivial, which takes the two bits where the kernel answered
and the trivial flag of ZFS otherwise, so a file with no ACL needs no
listxattr on either acltype. It needs truenas_pyos with STATX_ACL, whose
iter_filesystem_contents asks it for each entry.
A unit test sets an access ACL on a file and a default ACL on a folder
in the temporary folder, which keeps POSIX ACLs on tmpfs, checks the
answer for each, and checks that listdir lists the xattrs of the two
with an ACL alone. It needs a kernel with the change.
[libc++] Add a few _LIBCPP_HIDE_FROM_ABI which have been accidentally removed in #201722 (#236733)
These annotations should have stayed, since the functions are in a spot
where explicit annotation are required.
[libc++][NFC] Move checks whether mutex/condition_variable are trivial to their headers (#236806)
The moved macros are only used as implementation details of `mutex` and
`condition_variable` aren't used widely within the library, so they can
be moved to be more local.
[compiler-rt] Remove dlsym interceptor and support `-shared-libsan` for CSan
Summary:
Follow the UBSan offload runtime. Offload now resolves HSA through the
global scope, so the `dlsym` interceptor is no longer needed. The real
HSA entry points are still taken from the loaded HSA library rather than
`RTLD_NEXT`, since every DSO with a static runtime exports the same
wrappers and they would otherwise chain back into each other.
Build `libclang_rt.csan.so` with the offload objects folded in. The
exported HSA wrappers report failure when HSA is absent and warn when HSA
was loaded ahead of the runtime. The preinit hook moves to a separate
`csan_offload-preinit` archive for executables.
[compiler-rt] Add 'csan' library for the concurrency sanitizer
Summary:
Adds the runtime for the concurrency sanitizer, both CPU and GPU.
Fundamentally, this works using the following pseudocode:
```c
static u64 watchpoints[N]; // Hash-indexed, zero is empty.
// Emitted before the access, so we never trip on our own write.
void check_access(volatile void *addr, u32 size, u32 type) {
// Every access probes. A read conflicts only with a watched write, a
// write conflicts with either.
if (u64 *wp = find_watchpoint(addr, size, type))
consume(wp, this_pc()); // Hand our location to the owner.
if (!should_sample()) // Wave-uniform, 1-in-N chance.
return;
[17 lines not shown]