[ClangLinkerWrapper] Use discrete steps in verbose mode (#204186)
Summary:
One persistent problem with the linker wrapper flow is that it was more
difficult to reuse as a script than the previous flow. This is because
it did a lot of work internally. In the past we moved al ot of this into
dedicated LLVM tools, so now it's possible to simply use these tools
instead.
This PR changes the verbose mode handling to defer steps to tools rather
than doing it internally. This allows users to use verbose printing and
can copy/paste the results to re-run the steps.
[ELF] Reuse SHT_GROUP selection verdicts in initializeSections. NFC (#207437)
For each SHT_GROUP section, the parallel initializeSections re-derives
what the serial parse() already decided
(https://reviews.llvm.org/D130810).
Record the kept group section indices during parse() so that we can save
the work (xxh3 string hash and DenseMap lookup) in the parallel
initializeSections().
In a clang-relassert --threads=8 benchmark, "Initialize sections"
decreases from 39.0 to 30.6.
[CIR] Fix lit tests after explicit target feature for module asm (#207741)
- Fix lit tests after the module-level inline assembly is enhanced to
support specifying target features explicitly in
fcfc9167b628a2fae8fe1d662989ff7752d905ad.
arm64/vmm: Make remaining registers use hypctx_*_sys_reg
Move vgic, timer and trapframe registers into sys_regs to handle them
in the same way as all the other registers.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D56556
arm64/vmm: Refactor vmm_hyp.c
Refactor vmm_hyp.c to split register reload logic by type of register,
streamline the implementation and improve readability.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D56553
arm64/vmm: Move vttbr_el2 & vtimer into struct hypctx
Move vttbr_el2 & vtimer from struct hyp into struct hypctx to streamline
the logic and handle them in the same way as other *_el2 registers are
already being handled.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D56554
arm64/vmm: Move host-side EL2 regs into sys_regs
Move EL2 host registers that are not visible to the guest into
hypctx->sys_regs. Prefix them with HOST_ to distinguish from EL2
registers which are part of the guest's own state (e.g. in VNCR).
Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D56555
arm64/vmm: Store non-VNCR registers in an array
Move non-VNCR EL0 and EL1 registers into a dedicated array inside of
hypctx. This enables uniform accesses to both VNCR and non-VNCR guest
register state through hypctx_[read|write]_sys_reg().
The accessors are _not_ used for non-VNCR EL2 registers in order to
create a clear separation between guest-visible and guest-invisible
register state.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D56552
arm64/vmm: Use the VNCR_EL2 memory page to store guest registers
Wherever possible, move the storage space for guest register values from
the hypctx struct into a preallocated memory page matching the layout of
the page pointed to by VNCR_EL2.
This will streamline implementing support for nested virtualization, but
the implementation itself is not reliant on the presence of nested
virtualization architecture features.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D56551
arm64/vmm: Add FEAT_NV2 definitions
Add the definitions for the VNCR_EL2 register and all of the offsets
to registers in memory relative to the page stored in VNCR_EL2.
Signed-off-by: Kajetan Puchalski <kajetan.puchalski at arm.com>
Reviewed by: andrew
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D56550
[FIRToMemRef] Fix wrong-code for array_coor over sliced fir.embox
FIRToMemRef::convertArrayCoorOp routes through getMemrefIndices, which
only folds the first `rank` triples of sliceInfo.sliceVec into the memref
indices (i.e. the array_coor's own slice); the embox's slice triples --
which sit at [rank*3 .. 2*rank*3-1] when both are present -- were dropped.
Three consequences, three fixes here:
1. Non-collapsed embox slice lbs contribute (lb - 1) per Fortran dim to
each memref index. Fold them in in memref order (reversed Fortran
order) so the reinterpret_cast view lands at the right column.
2. The shapeVec-else stride path used shapeVec[0..rank-1] to build the
outer strides. With both slices present, that's the box's (slice's)
extents. Use shapeVec[rank..2*rank-1] instead -- the parent's extents
-- so the outer stride is the parent's leading dim rather than the
slice's own size.
3. Rank-reducing embox slices (undef ub/step triples) have no memref
[5 lines not shown]
NAS-141468 / 26.0.0-RC.1 / Enable IPv6 forwarding for the container bridge (by Qubad786) (#19262)
## Problem
On a clean install, LXC containers on the default `truenasbr0` bridge
get an IPv6 address and default route via the host's RAs but cannot
route IPv6 out. The bridge sets up full IPv6 masquerade and forward nft
rules, yet only the IPv4 forwarding sysctl was enabled, so the kernel
never forwards IPv6. Docker enables IPv6 forwarding as a side effect, so
only LXC-only (Docker-disabled) setups hit this.
## Solution
Enable `net.ipv6.conf.all.forwarding` when the bridge has an IPv6
network. Before doing so, bump `accept_ra` from 1 to 2 on interfaces
that still have it, mirroring incus, so the host keeps honouring router
advertisements while forwarding is on and doesn't lose a SLAAC-derived
address on its own uplink. The IPv4 write is likewise gated on having an
IPv4 network.
Original PR: https://github.com/truenas/middleware/pull/19257
Co-authored-by: M. Rehan <mrehanlm93 at gmail.com>
cpu: cpu_get_pcpuid(): Fix typo in herald comment
Fixes: c3c8f4d9e662 ("cpu: New cpu_get_pcpuid(), retrieves internal CPU ID")
Sponsored by: The FreeBSD Foundation
[clang][AST] Inline StmtVisitor fallback methods (#203125)
Mark the trivial `StmtVisitorBase` fallback methods `always_inline` so
each `VisitFoo`-to-`VisitParent` delegation is folded into its caller
instead of retained as an out-of-line template thunk.
In matched Release assertions-off Darwin arm64 builds, stripped clang
decreased by 266,656 bytes, stripped clangd decreased by 232,912 bytes,
and the stripped upstream `llvm-driver` multicall decreased by 266,336
bytes.
Work towards #202616
AI tool disclosure: Co-authored with OpenAI Codex.
Co-authored-by: OpenAI Codex <noreply at openai.com>
[clang][Frontend] Batch LangOptions context hashing (#203162)
`CompilerInvocation::computeContextHash` currently expands 269
non-benign `LangOptions` into individual `HashBuilder::add` calls. This
collects the values in an `unsigned` array and passes the array to
`HashBuilder::addRangeElements`, which preserves the ordered
native-endian bytes without adding an element count.
In a Release arm64 build, clangd decreases by 16,528 bytes unstripped
and 16,544 bytes stripped.
Work towards #202616
AI tool disclosure: Co-authored with OpenAI Codex.
firewall: change menu registration rules for legacy rules #9947
Keep the logic of the migration assistant but pivot to assuming
MVC rules are used by default and that menu registration hinges
on the fact that the firewall legacy plugin is installed.
Also patch outbound NAT file check although it's not needed yet
as we may want to move quicker in 26.7.x to depreate it. Since
we already have a plugin we can easily move the files there in
a minor iteration.
clang: Remove useFP16ConversionIntrinsics target option
Follow up to #174494. Remove the remnants of the control to
use llvm.convert.to.fp16/llvm.convert.from.fp16. Prefer
directly using the IR half type, unless the value is used
in an ABI context where it needs to remain as i16.
I did the first 80% of this a long time ago, and AI finished
the last bit and handled the recent rebases and test updates.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
Reapply "runtimes: Pass CMAKE_SYSTEM_NAME based on target triple" (#205133)
This reverts commit 08c728e8528c9584bc1fe0f46bbdd657e368be91.
Reapply after runtimes build fixes on platforms without shared libraries.