imgact_elf: Unconditionally initialize a variable in a note handler
In the sb == NULL case, we are computing the size of the note using a
dummy sbuf drain handler which counts bytes and discards the contents of
the buffer, so the fact that "structsize" is uninitialized doesn't
matter. But, the compiler may complain about this, so we might as well
just initialize it unconditionally to silence the warning, as other
handlers already do.
PR: 292811
MFC after: 1 week
(cherry picked from commit 8a68c2509c00ae0dbeab64064bb600cfac787a73)
[clang][OpenMP] Fix __llvm_omp_indirect_call_lookup signature for targets with non-default program AS (#192470)
The argument and return value for `__llvm_omp_indirect_call_lookup` are
function pointers so make sure they are in the correct address space.
Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
freebsd32: Fix freebsd11_nstat copyout condition
freebsd11_freebsd32_nstat() invoked copyout(2) when
freebsd11_cvtnstat32() failed and skipped copyout on success. This is
backwards.
Fix this to match freebsd11_freebsd32_nlstat() and freebsd11_nstat(),
and only copy the nstat32 result to userspace when conversion succeeds.
Signed-off-by: Weixie Cui <cuiweixie at gmail.com>
Reviewed by: mhorne
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/2109
(cherry picked from commit c6224994ac70b4f71ef9e11903bb2e50ed2b1bfe)
malloc.9: adjust flag table indentation
The current indentation is shorter than all but one of these flags. This
renders much more nicely.
MFC after: 3 days
(cherry picked from commit be79a42275cad21c6087d8bbd6a328735ea813fa)
mlx5e: Ensure rx timestamps are monotonically increasing
The clock calibration routine currently can result in rx timestamps
jumping backwards, which can confuse the TCP stack.
Ensure they are monotonically increasing by estimating what
we'd calculate as the next timestamp and clamp the calibration
so new timestamps are no earlier in time.
Reviewed by: kib, nickbanks_netflix.com
Tested by: nickbanks_netflix.com
Differential Revision: https://reviews.freebsd.org/D56427
Sponsored by: Netflix
[NFC][SPIRV] Move `SPIRVStripConvergenceIntrinsics` to Utils (#188537)
The `SPIRVStripConvergenceIntrinsic` pass was written as a spirv pass as
it is the currently the only target that emits convergence tokens during
codegen. There is nothing target specific to the pass, and, we plan to
emit convergence tokens when targeting DirectX (and all targets in
general), so move the pass to a common place.
The previous pass used temporary `Undef`s, as part of moving the pass we
can simply reverse the traverse order to remove the use of `Undef` as it
is deprecated.
Enables the pass for targeting DirectX and is a pre-req for:
https://github.com/llvm/llvm-project/pull/188792.
Assisted by: Github Copilot
[MCP][NFC] Opinionated refactoring
There are a few minor inconsistencies across the pass which I found mildly
distracting:
* The use of `Def`/`Dest`/`Dst` to refer to the same thing
* Inconsistent declaration order of `Dst`/`Src` vs `Src`/`Dst`
* Lots of `->getReg()->asMCReg()`, and uses of `Register` when the pass
is always running after RA anyway.
* Some places explicitly `assert(isCopyInstr)` while others just deref
the `optional`.
Standardize on `Dst`/`Src` to match the metaphor and ordering of
`DestSourcePair`.
Assume `std::optional::operator*` will assert in any reasonable
implementation, even though this may technically be undefined behavior.
When asserts are disabled it would be anyway.
[11 lines not shown]
[MCP] Never eliminate frame-setup/destroy instructions
Presumably targets only insert frame instructions which are significant,
and there may be effects MCP doesn't model. Similar to reserved registers this
is probably overly conservative, but as this causes no codegen change in
any lit test I think it is benign.
The motivation is just to clean up #183149 for AMDGPU, as we can spill
to physical registers, and currently have to spill the EXEC mask purely
to enable debug-info.
Change-Id: I9ea4a09b34464c43322edd2900361bf635efd9f7
[MCP][NFC] Cleanup and prepare to preserve frame-setup/destroy
This mixes renames, removing redundant code, avoiding
`else`-after-`return`, etc. with factoring out the `isNeverRedundant`
concept.
Change-Id: I43a62a9415019cdd63c68fd3b915ebb7505d317a
[MCP][NFC] Opinionated refactoring (#186239)
There are a few minor inconsistencies across the pass which I found mildly distracting:
* The use of `Def`/`Dest`/`Dst` to refer to the same thing
* Inconsistent declaration order of `Dst`/`Src` vs `Src`/`Dst`
* Lots of `->getReg()->asMCReg()`, and uses of `Register` when the pass
is always running after RA anyway.
* Some places explicitly `assert(isCopyInstr)` while others just deref
the `optional`.
Standardize on `Dst`/`Src` to match the metaphor and ordering of
`DestSourcePair`.
Assume `std::optional::operator*` will assert in any reasonable
implementation, even though this may technically be undefined behavior.
When asserts are disabled it would be anyway.
The refactor uses structured bindings for a couple reasons:
[9 lines not shown]
[X86] Use unsigned comparison for stack clash probing loop (#192355)
The stack clash probing loop generated in `EmitLoweredProbedAlloca` used
a signed comparison (`X86::COND_GE`) to determine when the allocation
target had been reached.
In 32-bit mode, memory addresses above `0x80000000` have the sign bit
set. If the stack pointer lands in this region, treating the addresses
as signed integers causes the comparison logic to fail. This leads to
incorrect loop execution, resulting in an infinite loop and a crash
(segmentation fault) when setting up custom stacks for pthreads mapped
above `0x80000000` in a 32b process.
This patch changes the condition code to `X86::COND_AE` (Above or
Equal), which generates an unsigned comparison. This ensures that
addresses are treated correctly as unsigned quantities on all targets.
On 64-bit systems, this change has no practical effect on valid
user-space addresses because they do not use the sign bit (being
[4 lines not shown]
raspberry_virtgpio: fix OF_hasprop() usage
The function returns a bool. This driver was merged recently (by me) and
I missed this instance.
While here, adjust the ofw_bus_status_okay() call similarly. This
function still returns an int, but this usage is more widely used in our
drivers.
No functional change intended.
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Fixes: b60cd486a652 ("ofw: bool-ify OF_hasprop()")
OF_getprop.9: update OF_hasprop() signature
The return type has been converted to a bool.
Reported by: manu
Sponsored by: The FreeBSD Foundation
Fixes: b60cd486a652 ("ofw: bool-ify OF_hasprop()")
[CIR][AArch64] Lower NEON vrsra_n intrinsics (#191129)
### Summary
Implement CIR lowering for all intrinsics in
https://arm-software.github.io/acle/neon_intrinsics/advsimd.html#vector-rounding-shift-right-and-accumulate
This PR references the implementation from the ClangIR incubator:
https://github.com/llvm/clangir/blob/main/clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp#L4854
AArch64 does not provide a dedicated "rounding shift right by immediate"
instruction. Instead, the `SRSHL` / `URSHL` intrinsics take a signed
per-lane shift amount where a negative value means right shift, so an
immediate right shift by `n` is encoded as a signed vector splat of
`-n`. The three infrastructure changes below exist to support this
encoding at the call site:
- extends `emitNeonShiftVector` with a `neg` parameter so the
right-shift-as-negative-left-shift encoding is handled inside the
helper;
[8 lines not shown]
Status/2026Q1: Add two reports
Reviewed by: status (Graham Percival <gperciva at tarsnap.com>)
Differential Revision: https://reviews.freebsd.org/D56388
devel/p5-Log-Dispatch-File-Rolling: patch for perl 5.40
The attached patch fixes this message:
Attempt to call undefined import method with arguments ("2.37")
via package "Log::Dispatch::File" (Perhaps you forgot to load the
package?) at /usr/local/lib/perl5/site_perl/Log/Dispatch/File/Rolling.pm line 8.
PR: 288790
Approved by: maintainer timeout (8 months)
[mlir][acc] Add canonicalization patterns for compute_region (#192376)
This PR improves the APIs for navigating through acc.compute_region
block arguments and also adds canonicalization patterns for those
arguments to remove unused ones and merge duplicates.
ports-mgmt/pkg: update to 2.7.4
- repo: do not delete repositories in overrides, simply disable them
- query: fix %y/%Y
- Declare CheriBSD and CheriABI OS and ABI
pmap: Do not use PMAP_LOCK_INIT with kernel_pmap
The kernel_pmap lock is a bit special: it does not need the DUPOK flag,
and it really belongs to a different lock class. If it belongs to the
same class as regular pmap locks, then witness may report warnings when
performing UMA allocations under a regular pmap lock, if the allocation
triggers a pmap_growkernel() call.
Replace instances of PMAP_LOCK_INIT(kernel_pmap) with inline mtx_init()
calls to silence some witness warnings for harmless behaviour I see with
some uncommitted test programs.
Reviewed by: alc, kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D56185
(cherry picked from commit c6a1c1260f02e44b7f44b1e3735ce5dbd785544d)
imgact_elf: Unconditionally initialize a variable in a note handler
In the sb == NULL case, we are computing the size of the note using a
dummy sbuf drain handler which counts bytes and discards the contents of
the buffer, so the fact that "structsize" is uninitialized doesn't
matter. But, the compiler may complain about this, so we might as well
just initialize it unconditionally to silence the warning, as other
handlers already do.
PR: 292811
MFC after: 1 week
(cherry picked from commit 8a68c2509c00ae0dbeab64064bb600cfac787a73)