[AMDGPU] Add AMDGPU support for llvm-objcopy (#190020)
llvm-objcopy does not support AMDGPU currently. It does not get target
names where all other tools do but has it's own list. Update the list to
support amdgpu.
https://reviews.llvm.org/D143539https://github.com/llvm/llvm-project/pull/92066
---------
Co-authored-by: Aakanksha Patil <paakan at amd.com>
Add middleware support for LIO ALUA HA
Wire up the middleware side of LIO ALUA high-availability: load
lio_ha.ko with per-node addresses on service start, manage ALUA
state across failover events, clean up STANDBY configfs on pool
export, and add pre-flight validation that targets have static
initiator ACLs before ALUA can be enabled.
For each target, create a portal-less phantom TPG carrying the peer
node's controller group so that a single RTPG response from any
connected port lists both ALUA groups. Write tpgt_N/rtpi explicitly
before enable so that relative target port IDs in RTPG match the
tag formula (portal.tag on Node A, portal.tag + 32000 on Node B)
rather than being auto-assigned sequentially by the kernel.
ALUA group states are driven by role and ha_state:
MASTER + synced local=OPTIMIZED remote=NONOPTIMIZED
MASTER + connected local=OPTIMIZED remote=TRANSITIONING
[4 lines not shown]
fts: reduce fd usage by storing fts_dirfd on directory entries only
Previously fts_build() called _dup(_dirfd(dirp)) for every child
entry, holding N simultaneous fds for a directory with N children.
Redefine fts_dirfd: instead of a fd for the entry's parent
directory, it is now a fd for the entry itself, set only for
directory entries. One dup per directory in fts_build() instead
of one per child. Close fts_dirfd during the directory post-order
visit, before advancing to its sibling.
To access a file using fd-relative operations, callers should use
openat(ent->fts_parent->fts_dirfd, ent->fts_name, ...) instead of
openat(ent->fts_dirfd, ent->fts_name, ...). The fd is valid until the
directory's post-order visit (FTS_DP).
Reported by: Mark Johnston <markj at FreeBSD.org>
Fixes: 4bd01d6ae016 (fts: refactor to use fd-relative operations)
Sponsored by: Google LLC (GSoC 2026)
[2 lines not shown]
mpool/mpool_get.c: Avoid clobbering 'errno' when handling 'pread' errors
POSIX.1-2024 states that the 'free' function "shall not modify errno if
ptr is a null pointer or a pointer previously returned as if by malloc()
and not yet deallocated". However this is a fairly recent addition
and non-compliant allocators might still clobber 'errno', causing
'mpool_get' to return the wrong error code. Fix this by saving
and restoring 'errno' after calling 'free'.
Sponsored by: Klara, Inc.
Reviewed by: obiwac
Differential Revision: https://reviews.freebsd.org/D55463
MFC after: 1 week
(cherry picked from commit bce0c14fe19defeef4f02cfebc018e9adf979783)
libc/db: Remove unused hash functions in hash_func.c
Prune unused code hidden behind 'notdef', bringing us in sync with
the changes in OpenBSD. Despite the `__default_hash` function pointer
having external linkage, no ABI change is expected since it was
never exported.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D55842
Reviewed by: allanjude, des
MFC after: 2 weeks
(cherry picked from commit c09ccfc2665bef0d81d1db4e3713e4f2a0b5a064)
clang/AMDGPU: Add half typed image gather4 builtin (#213613)
Follow along with the precedent of using an f32 suffix
for the coordinate type. We probably should have had one
builtin that detected the coordinate type.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
bhyve: Document vCPU range pinning
This change documents the recently introduced changes to -p
that allow users to specify CPU ranges instead of having to
specify each individual mapping.
While we're here, move the -p examples to the EXAMPLES section.
Reviewed by: bcr
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D57480
(cherry picked from commit 23c99b64918eddb6084ffe4347faf95f82661c47)
bhyve(8): allow cpu pinning using N-M:X-Y ranges
bhyve's -p allows to pin guest's virtual CPU vcpu to hostcpu, however
this becomes very tedious work when you have to pin more than a single
CPU.
This allows to pass a range to -p, e.g. -p 0-3:4-7 which will pin the
cpus 0:4, 1:5, 2:6, 3:7. The ranges must be equal and the CPU numbers
must be ascending.
Sponsored by: Armenian Bioinformatics Institute
Reviewed by: corvink, markj
Tested by: bnovkov
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D54937
(cherry picked from commit 8f6c577c9f706aea6f138fa1bec27029d4ab587d)
uart: Add support for the Intel XScale controller
The ns8250 driver avoids clearing IER bit 0x10 to account for the
split "receiver time-out interrupt enable" bit, but it never sets
it in `ier_rxbits` even though a comment in `ns8250_init` implies so.
Fix this by setting `IER_RXTMOUT` if we've matched an XScale uart.
Differential Revision: https://reviews.freebsd.org/D57629
Reviewed by: imp
MFC after: 2 weeks
(cherry picked from commit 1665954e508f74588108e96c30b90d1a88807faa)
[clang][constexpr] Allow IndirectGotoStmt in constexpr functions for C++23 (#213449)
### Summary
P2242R3 relaxed `constexpr` function requirements in C++23 to allow jump
statements such as `goto` and labels inside `constexpr` functions. In
`CheckConstexprFunctionStmt`, `GotoStmtClass` and `LabelStmtClass` were
added, but `IndirectGotoStmtClass` (GNU computed goto) was missed.
This patch adds `case Stmt::IndirectGotoStmtClass:` alongside
`GotoStmtClass` in `CheckConstexprFunctionStmt`.
### Details
- Before this patch, writing `goto *p;` inside a `constexpr` function
resulted in `error: statement not allowed in constexpr function` because
`IndirectGotoStmtClass` fell through to the `default` case in
`CheckConstexprFunctionStmt`.
- With this patch, indirect gotos behave identically to standard gotos
in `constexpr` function bodies:
- Allowed in C++23 mode.
[13 lines not shown]
[SampleProfile] Support Eytzinger layout in SecFuncOffsetTable (#213829)
This patch supports writing SecFuncOffsetTable as an array of
fixed-length uint32_t file offsets parallel to the Eytzinger spans in
SecNameTable for ExtBinary sample profiles.
Without this patch, SecFuncOffsetTable stores pairs of variable-length
ULEB128 integers for GUIDs and file offsets, requiring us to eagerly
load and decode the entire section into an in-memory map.
This patch implements parallel arrays to avoid eager loading:
- In the writer, when -sample-profile-write-eytzinger-name-tables is
set,
SecFuncOffsetTable holds only an array of uint32_t offsets into
SecLBRProfile. The k-th offset entry corresponds to the k-th GUID in the
CSKeys or FlatKeys Eytzinger span of SecNameTable.
- In the reader, when SecFlagEytzinger is set on SecFuncOffsetTable, the
[10 lines not shown]
riscv/pmap.c: Add an Svinval-aware variant of pmap_invalidate_range
This change introduces a variant of `pmap_invalidate_range` that uses
the fine-grained TLB invalidation instructions introduced by the
Svinval extension. These instructions allow for more efficient TLB
flushing on certain implementations. Under this new scheme,
`pmap_invalidate_range` was converted to an ifunc that selects the
appropriate variant during boot.
Event: BSDCan 2026
Reviewed by: markj, mhorne
Differential Revision: https://reviews.freebsd.org/D57624
riscv: Add support for the Svinval extension
This change adds wrappers for the new fine-grained TLB invalidation
instructions and extends the capability detection logic to include
the Svinval extension, which is mandatory in the RVA23S64 profile.
Event: BSDCan 2026
Differential Revision: https://reviews.freebsd.org/D57623
Reviewed by: mhorne, markj
18233 exiting threads should not call freelocale() on their per-thread locale
18330 Fix comment in localeimpl.c to reference __curlocale()
Reviewed by: Robert Mustacchi <rm at fingolfin.org>
Approved by: Dan McDonald <danmcd at Edgecast.io>
[BOLT] Skip non-code relocs as function references (#215028)
handleRelocation looked up the referenced function from the resolved
"symbol + addend" address, ignoring the symbol's section. With biased
array indexing the compiler folds a constant into the displacement, e.g.
```
movq const_int_rtx-0x3fe00(,%rax,8), %r14 # R_X86_64_32S const_int_rtx-0x3fe00
```
so the unbiased displacement is not a live address (only disp + rax*8
is), yet it can land inside an unrelated function. BOLT re-anchored the
relocation onto that function and dropped the addend, then during
disassembly registered an interprocedural reference to a mid-instruction
address, producing:
```
BOLT-WARNING: corrupted control flow detected in function ...: an external
branch/call targets an invalid instruction in function ... ; ignoring both
```
[6 lines not shown]
[docs] [kaleidoscope] Remove misplaced backslash from JIT tutorial (#213483)
In order to represent names starting with the string
"InitializeNativeTarget", use `InitializeNativeTarget*` rather than
`InitializeNativeTarget\*`.
[analyzer] Fix -analyzer-output=html assert on reversed and macro ranges
HTMLDiagnostics::HighlightRange guarded against a reversed range by
comparing line numbers, so a same-line reversal - which is what the piece for
an implicit copy constructor carries - reached html::HighlightRange.
Its scan walks from begin to end, ran off the end of the buffer, and asserted:
https://godbolt.org/z/sTb5qfjjd
Invalid position to insert! (RewriteRope.h)
It also added the end token's length itself and then passed a token range to
html::HighlightRange, which measured the token again, this time from the
interior. For most tokens the two cancel, but where the tail re-lexes longer
the highlight reached past the end of the range, e.g. over a trailing ';'.
Use getExpansionRangeInFile(), which rejects reversed and cross-file ranges,
then convert once and tell html::HighlightRange the range is already
char-granular.
[4 lines not shown]
[analyzer] Fix -analyzer-output=sarif crash on macro-expanded ranges
A path piece whose range ends inside a macro expansion aborted the whole
document: https://godbolt.org/z/61vWYcsWj
Cannot create a physicalLocation from invalid SourceRange!
convertTokenRangeToCharRange() built the end with
Lexer::getLocForEndOfToken(), which returns an invalid location for a macro
ID that is not at the end of its expansion, and used it unchecked. The
analyzer's own test corpus hits this in nine files; text and plist output
were unaffected because both already map such ranges to the expansion.
- Use getExpansionRangeInFile(), so the region covers the macro use like the
other two outputs.
- Fall back to a caret when the range is unusable. A thread flow needs a
location per piece, so dropping one would truncate the reported path. This
also stops reversed ranges producing regions with endColumn < startColumn.
[4 lines not shown]
[clang] Reject ranges getExpansionRangeInFile cannot represent (#214461)
getExpansionRangeInFile was extracted verbatim and inherited two
shortcomings
of the original loop, fixed here before the analyzer's SARIF and HTML
consumers
depend on it:
- It mapped the end with getExpansionRange(SourceLocation), which always
reports a token range, so a char-range input was widened by a whole
token.
Now using the getExpansionRange(CharSourceRange) overload, which keeps
the flag.
- It passed reversed ranges through. Consumers walk begin->end; now
returning
nullopt for those, as Lexer::makeFileCharRange already does.
Separate from the extraction so that stays NFC, and out of the consumer
fixes
[7 lines not shown]
18300 zfs should always allow relaxing quota
Reviewed by: Andy Fiddaman <illumos at fiddaman.net>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Dan McDonald <danmcd at edgecast.io>
18265 strcpy bug in add_drv.c
Reviewed by: Bill Sommerfeld <sommerfeld at hamachi.org>
Reviewed by: Toomas Soome <tsoome at me.com>
Approved by: Dan McDonald <danmcd at edgecast.io>
[AArch64] Validate fixed-point SCVTF/UCVTF scale operands (#213490)
The fixed-point SCVTF/UCVTF operands are missing the ParserMatchClass
used by
fixedpoint_i32/i64. Symbolic scales can therefore reach the encoder and
hit
its MO.isImm() assertion, while out-of-range scales can alias valid
encodings.
Use Imm1_32Operand and Imm1_64Operand for these operands and add
diagnostics
for both source widths and symbolic scales.
Addresses the scvtf/ucvtf part of #185358. The ext case is tracked by
#185361.
[Flang][OpenMP][MLIR] Materialize groupprivate for target without teams (#214316)
Prior to this change, `groupprivate` variables were only materialized
for teams constructs. A `groupprivate` variable used inside a bare
target region was not materialized.
This commit materializes the `groupprivate` copy on the target construct
itself when target does not contain a teams construct. Making the
behavior equivalent to target teams num_teams(1).
Assisted-by: Opus 4.8
18246 libwrap tcpd.h should get function prototypes
Reviewed by: Marco van Wieringen <marco.van.wieringen at planets.elm.net>
Reviewed by: Andy Fiddaman <illumos at fiddaman.net>
Approved by: Dan McDonald <danmcd at Edgecast.io>